svn merge -r 37306:39975 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorBenoit Bolsee <benoit.bolsee@online.be>
Wed, 7 Sep 2011 15:34:04 +0000 (15:34 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Wed, 7 Sep 2011 15:34:04 +0000 (15:34 +0000)
43 files changed:
1  2 
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_game.py
release/scripts/startup/bl_ui/properties_scene.py
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/sca.c
source/blender/blenkernel/intern/scene.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/object/CMakeLists.txt
source/blender/editors/object/SConscript
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_ops.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/util/CMakeLists.txt
source/blender/gpu/intern/gpu_shader_material.glsl
source/blender/makesdna/DNA_actuator_types.h
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_actuator.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_scene.c
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/SConscript
source/blender/modifiers/intern/MOD_util.c
source/creator/CMakeLists.txt
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/CMakeLists.txt
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/Converter/SConscript
source/gameengine/Ketsji/CMakeLists.txt
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_GameObject.h
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_Scene.h
source/gameengine/Ketsji/SConscript
source/gameengine/Rasterizer/RAS_IRasterizer.h
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h

@@@ -838,14 -857,17 +857,19 @@@ static const LayerTypeInfo LAYERTYPEINF
        {sizeof(MDisps), "MDisps", 1, NULL, layerCopy_mdisps,
         layerFree_mdisps, layerInterp_mdisps, layerSwap_mdisps, NULL, layerRead_mdisps, layerWrite_mdisps,
         layerFilesize_mdisps, layerValidate_mdisps},
+       /* 20: CD_WEIGHT_MCOL */
        {sizeof(MCol)*4, "MCol", 4, "WeightCol", NULL, NULL, layerInterp_mcol,
         layerSwap_mcol, layerDefault_mcol},
-        {sizeof(MCol)*4, "MCol", 4, "IDCol", NULL, NULL, layerInterp_mcol,
+       /* 21: CD_ID_MCOL */
+       {sizeof(MCol)*4, "MCol", 4, "IDCol", NULL, NULL, layerInterp_mcol,
         layerSwap_mcol, layerDefault_mcol},
-        {sizeof(MCol)*4, "MCol", 4, "TexturedCol", NULL, NULL, layerInterp_mcol,
+       /* 22: CD_TEXTURE_MCOL */
+       {sizeof(MCol)*4, "MCol", 4, "TexturedCol", NULL, NULL, layerInterp_mcol,
         layerSwap_mcol, layerDefault_mcol},
 -      {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}
+       /* 23: CD_CLOTH_ORCO */
 +      {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
++      /* 24: CD_RECAST */
 +      {sizeof(MRecast), "MRecast", 1,"Recast",NULL,NULL,NULL,NULL}
  };
  
  static const char *LAYERTYPENAMES[CD_NUMTYPES] = {
@@@ -11686,45 -11812,193 +11834,230 @@@ static void do_versions(FileData *fd, L
                                }
                        }
                }
+               {
+                       /* add default value for behind strength of camera actuator */
+                       Object *ob;
+                       bActuator *act;
+                       for(ob = main->object.first; ob; ob= ob->id.next) {
+                               for(act= ob->actuators.first; act; act= act->next) {
+                                       if (act->type == ACT_CAMERA) {
+                                               bCameraActuator *ba= act->data;
+                                               ba->damping = 1.0/32.0;
+                                       }
+                               }
+                       }
+               }
+               {
+                       ParticleSettings *part;
+                       for(part = main->particle.first; part; part = part->id.next) {
+                               /* Initialize particle billboard scale */
+                               part->bb_size[0] = part->bb_size[1] = 1.0f;
+                       }
+               }
        }
-       
+       if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 1)){
+               {
+                       Scene *scene;
+                       Sequence *seq;
+                       for (scene=main->scene.first; scene; scene=scene->id.next)
+                       {
+                               scene->r.ffcodecdata.audio_channels = 2;
+                               scene->audio.volume = 1.0f;
+                               SEQ_BEGIN(scene->ed, seq) {
+                                       seq->pitch = 1.0f;
+                               }
+                               SEQ_END
+                       }
+               }
+               {
+                       bScreen *screen;
+                       for(screen= main->screen.first; screen; screen= screen->id.next) {
+                               ScrArea *sa;
+                               /* add regions */
+                               for(sa= screen->areabase.first; sa; sa= sa->next) {
+                                       SpaceLink *sl= sa->spacedata.first;
+                                       if(sl->spacetype==SPACE_SEQ) {
+                                               ARegion *ar;
+                                               for (ar=sa->regionbase.first; ar; ar= ar->next) {
+                                                       if(ar->regiontype == RGN_TYPE_WINDOW) {
+                                                               if(ar->v2d.min[1] == 4.0f)
+                                                                       ar->v2d.min[1]= 0.5f;
+                                                       }
+                                               }
+                                       }
+                                       for (sl= sa->spacedata.first; sl; sl= sl->next) {
+                                               if(sl->spacetype==SPACE_SEQ) {
+                                                       ARegion *ar;
+                                                       for (ar=sl->regionbase.first; ar; ar= ar->next) {
+                                                               if(ar->regiontype == RGN_TYPE_WINDOW) {
+                                                                       if(ar->v2d.min[1] == 4.0f)
+                                                                               ar->v2d.min[1]= 0.5f;
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+               {
+                       /* Make "auto-clamped" handles a per-keyframe setting instead of per-FCurve 
+                        *
+                        * We're only patching F-Curves in Actions here, since it is assumed that most
+                        * drivers out there won't be using this (and if they are, they're in the minority).
+                        * While we should aim to fix everything ideally, in practice it's far too hard
+                        * to get to every animdata block, not to mention the performance hit that'd have
+                        */
+                       bAction *act;
+                       FCurve *fcu;
+                       
+                       for (act = main->action.first; act; act = act->id.next) {
+                               for (fcu = act->curves.first; fcu; fcu = fcu->next) {
+                                       BezTriple *bezt;
+                                       unsigned int i = 0;
+                                       
+                                       /* only need to touch curves that had this flag set */
+                                       if ((fcu->flag & FCURVE_AUTO_HANDLES) == 0)
+                                               continue;
+                                       if ((fcu->totvert == 0) || (fcu->bezt == NULL))
+                                               continue;
+                                               
+                                       /* only change auto-handles to auto-clamped */
+                                       for (bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) {
+                                               if (bezt->h1 == HD_AUTO) bezt->h1 = HD_AUTO_ANIM;
+                                               if (bezt->h2 == HD_AUTO) bezt->h2 = HD_AUTO_ANIM;
+                                       }
+                                       
+                                       fcu->flag &= ~FCURVE_AUTO_HANDLES;
+                               }
+                       }
+               }
+               {
+                       /* convert fcurve and shape action actuators to action actuators */
+                       Object *ob;
+                       bActuator *act;
+                       bIpoActuator *ia;
+                       bActionActuator *aa;
+                       for (ob= main->object.first; ob; ob= ob->id.next) {
+                               for (act= ob->actuators.first; act; act= act->next) {
+                                       if (act->type == ACT_IPO) {
+                                               // Create the new actuator
+                                               ia= act->data;
+                                               aa= MEM_callocN(sizeof(bActionActuator), "fcurve -> action actuator do_version");
+                                               // Copy values
+                                               aa->type = ia->type;
+                                               aa->flag = ia->flag;
+                                               aa->sta = ia->sta;
+                                               aa->end = ia->end;
+                                               strcpy(aa->name, ia->name);
+                                               strcpy(aa->frameProp, ia->frameProp);
+                                               if (ob->adt)
+                                                       aa->act = ob->adt->action;
+                                               // Get rid of the old actuator
+                                               MEM_freeN(ia);
+                                               // Assign the new actuator
+                                               act->data = aa;
+                                               act->type= act->otype= ACT_ACTION;
+                                               
+                                       }
+                                       else if (act->type == ACT_SHAPEACTION)  {
+                                               act->type = act->otype = ACT_ACTION;
+                                       }
+                               }
+                       }
+               }
+       }
+       if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 2)){
+               {
+                       /* Convert default socket values from bNodeStack */
+                       Scene *sce;
+                       Material *mat;
+                       Tex *tex;
+                       bNodeTree *ntree;
+                       for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next) {
+                               do_versions_nodetree_default_value(ntree);
+                               ntree->update |= NTREE_UPDATE;
+                       }
+                       for (sce=main->scene.first; sce; sce=sce->id.next)
+                               if (sce->nodetree) {
+                               do_versions_nodetree_default_value(sce->nodetree);
+                               sce->nodetree->update |= NTREE_UPDATE;
+                       }
+                       for (mat=main->mat.first; mat; mat=mat->id.next)
+                               if (mat->nodetree) {
+                               do_versions_nodetree_default_value(mat->nodetree);
+                               mat->nodetree->update |= NTREE_UPDATE;
+                       }
+                       for (tex=main->tex.first; tex; tex=tex->id.next)
+                               if (tex->nodetree) {
+                               do_versions_nodetree_default_value(tex->nodetree);
+                               tex->nodetree->update |= NTREE_UPDATE;
+                       }
+               }
+               /* add SOCK_DYNAMIC flag to existing group sockets */
+               {
+                       bNodeTree *ntree;
+                       /* only need to do this for trees in main, local trees are not used as groups */
+                       for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next) {
+                               do_versions_nodetree_dynamic_sockets(ntree);
+                               ntree->update |= NTREE_UPDATE;
+                       }
+               }
+       }
+       /* put compatibility code here until next subversion bump */
+       {
+       }
 +      //set defaults for obstacle avoidance, recast data
 +      {
 +              Scene *sce;
 +              for(sce = main->scene.first; sce; sce = sce->id.next)
 +              {
 +                      if (sce->gm.levelHeight == 0.f)
 +                              sce->gm.levelHeight = 2.f;
 +
 +                      if(sce->gm.recastData.cellsize == 0.0f)
 +                              sce->gm.recastData.cellsize = 0.3f;
 +                      if(sce->gm.recastData.cellheight == 0.0f)
 +                              sce->gm.recastData.cellheight = 0.2f;
 +                      if(sce->gm.recastData.agentmaxslope == 0.0f)
 +                              sce->gm.recastData.agentmaxslope = M_PI/4;
 +                      if(sce->gm.recastData.agentmaxclimb == 0.0f)
 +                              sce->gm.recastData.agentmaxclimb = 0.9f;
 +                      if(sce->gm.recastData.agentheight == 0.0f)
 +                              sce->gm.recastData.agentheight = 2.0f;
 +                      if(sce->gm.recastData.agentradius == 0.0f)
 +                              sce->gm.recastData.agentradius = 0.6f;
 +                      if(sce->gm.recastData.edgemaxlen == 0.0f)
 +                              sce->gm.recastData.edgemaxlen = 12.0f;
 +                      if(sce->gm.recastData.edgemaxerror == 0.0f)
 +                              sce->gm.recastData.edgemaxerror = 1.3f;
 +                      if(sce->gm.recastData.regionminsize == 0.0f)
 +                              sce->gm.recastData.regionminsize = 50.f;
 +                      if(sce->gm.recastData.regionmergesize == 0.0f)
 +                              sce->gm.recastData.regionmergesize = 20.f;
 +                      if(sce->gm.recastData.vertsperpoly<3)
 +                              sce->gm.recastData.vertsperpoly = 6;
 +                      if(sce->gm.recastData.detailsampledist == 0.0f)
 +                              sce->gm.recastData.detailsampledist = 6.0f;
 +                      if(sce->gm.recastData.detailsamplemaxerror == 0.0f)
 +                              sce->gm.recastData.detailsamplemaxerror = 1.0f;
 +              }                       
 +      }
 +      
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
        /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
  
@@@ -30,10 -30,9 +30,10 @@@ set(IN
        ../../makesdna
        ../../makesrna
        ../../python
-       ../../windowmanager
        ../../render/extern/include
+       ../../windowmanager
        ../../../../intern/guardedalloc
 +      ../../../../extern/recastnavigation/Recast/Include
  )
  
  set(INC_SYS
@@@ -22,9 -22,8 +22,9 @@@
  set(INC
        ../include
        ../../blenkernel
-       ../../blenloader
        ../../blenlib
+       ../../blenloader
 +      ../../../../extern/recastnavigation/Recast/Include
        ../../makesdna
        ../../makesrna
        ../../windowmanager
@@@ -477,9 -452,9 +472,10 @@@ typedef struct GameData 
  
        /* stereo/dome mode */
        struct GameDome dome;
-       short stereoflag, stereomode, xsch, ysch; //xsch and ysch used for backwards compat.
+       short stereoflag, stereomode;
+       short pad2, pad3;
        float eyeseparation, pad1;
 +      RecastData recastData;
  } GameData;
  
  #define STEREO_NOSTEREO               1
  #define WOPHY_ODE             4
  #define WOPHY_BULLET  5
  
 +/* obstacleSimulation */
 +#define OBSTSIMULATION_NONE           0
 +#define OBSTSIMULATION_TOI_rays               1
 +#define OBSTSIMULATION_TOI_cells      2
 +
  /* GameData.flag */
+ #define GAME_RESTRICT_ANIM_UPDATES                    (1 << 0)
  #define GAME_ENABLE_ALL_FRAMES                                (1 << 1)
  #define GAME_SHOW_DEBUG_PROPS                         (1 << 2)
  #define GAME_SHOW_FRAMERATE                                   (1 << 3)
  #define GAME_IGNORE_DEPRECATION_WARNINGS      (1 << 12)
  #define GAME_ENABLE_ANIMATION_RECORD          (1 << 13)
  #define GAME_SHOW_MOUSE                                               (1 << 14)
 +#define GAME_SHOW_OBSTACLE_SIMULATION         (1 << 15)
  #define GAME_GLSL_NO_COLOR_MANAGEMENT         (1 << 15)
+ /* Note: GameData.flag is a short (max 16 flags). To add more flags, GameData.flag needs to be an int */
  
  /* GameData.matmode */
  #define GAME_MAT_TEXFACE      0
@@@ -446,14 -435,7 +438,8 @@@ EnumPropertyItem *rna_Actuator_type_ite
        RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_PROPERTY);
        RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_RANDOM);
        RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SCENE);
 +      RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_STEERING);
  
-       if (ob != NULL) {
-               if (ob->type==OB_MESH){
-                       RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SHAPEACTION);
-               }
-       }
        RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SOUND);
        RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_STATE);
        RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_VISIBILITY);
@@@ -29,14 -32,10 +32,13 @@@ set(IN
        ../blenlib
        ../blenloader
        ../makesdna
-       ../blenkernel
-       ../blenkernel/intern
+       ../makesrna
        ../render/extern/include
-       ../../../intern/guardedalloc
 +      ../editors/include
 +      ../gpu
        ../../../intern/elbeem/extern
+       ../../../intern/guardedalloc
 +      ../../../extern/recastnavigation/Recast/Include
  )
  
  set(INC_SYS
@@@ -1,14 -1,12 +1,14 @@@
  #!/usr/bin/python
  Import ('env')
  
 -sources = env.Glob('intern/*.c')
 +sources = env.Glob('intern/*.c') + env.Glob('intern/*.cpp')
  
  incs = '. ./intern'
 -incs += ' #/intern/guardedalloc #/intern/decimation/extern #/intern/bsp/extern #/intern/elbeem/extern'
 +incs += ' #/intern/guardedalloc #/intern/decimation/extern #/intern/bsp/extern #/intern/elbeem/extern #/extern/glew/include'
  incs += ' ../render/extern/include ../blenloader'
- incs += ' ../include ../blenlib ../makesdna ../blenkernel ../blenkernel/intern'
+ incs += ' ../include ../blenlib ../makesdna ../makesrna ../blenkernel ../blenkernel/intern'
 +incs += ' ../editors/include ../gpu'
 +incs += ' #extern/recastnavigation/Recast/Include'
  
  incs += ' ' + env['BF_ZLIB_INC']
  
Simple merge
  
  set(INC
        .
-       ../../../intern/string
-       ../../../intern/guardedalloc
+       ../BlenderRoutines
+       ../Expressions
+       ../GameLogic
+       ../Ketsji
+       ../Ketsji/KXNetwork
+       ../Network
+       ../Network/LoopBackNetwork
+       ../Physics/Bullet
+       ../Physics/Dummy
+       ../Physics/common
+       ../Rasterizer
+       ../Rasterizer/RAS_OpenGLRasterizer
+       ../Rasterizer/RAS_OpenGLRasterizer
+       ../SceneGraph
+       ../../blender
+       ../../blender/blenkernel
+       ../../blender/blenlib
+       ../../blender/blenloader
+       ../../blender/gpu
+       ../../blender/ikplugin
+       ../../blender/imbuf
+       ../../blender/makesdna
+       ../../blender/makesrna
+       ../../blender/windowmanager
+       ../../../extern/bullet2/src
+       ../../../extern/Eigen2
        ../../../intern/container
-       ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
-       ../../../intern/audaspace/intern
-       ../../../source/gameengine/Converter
-       ../../../source/gameengine/BlenderRoutines
-       ../../../source/blender/imbuf
+       ../../../intern/guardedalloc
        ../../../intern/moto/include
-       ../../../source/gameengine/Ketsji
-       ../../../source/gameengine/Ketsji/KXNetwork
-       ../../../source/blender/blenlib
-       ../../../source/blender/blenkernel
-       ../../../source/blender/windowmanager
-       ../../../source/blender
-       ../../../source/blender/makesdna
-       ../../../source/blender/makesrna
-       ../../../source/gameengine/Rasterizer
-       ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
-       ../../../source/gameengine/GameLogic
-       ../../../source/gameengine/Expressions
-       ../../../source/gameengine/Network
-       ../../../source/gameengine/SceneGraph
-       ../../../source/gameengine/Physics/common
-       ../../../source/gameengine/Physics/Bullet
-       ../../../source/gameengine/Physics/Dummy
-       ../../../source/gameengine/Network/LoopBackNetwork
-       ../../../source/blender/blenloader
-       ../../../source/blender/gpu
-       ../../../source/blender/ikplugin
-       ../../../extern/bullet2/src
+       ../../../intern/string
 +      ../../../extern/recastnavigation/Detour/Include
  )
  
  set(INC_SYS
  #include "BL_ActionActuator.h"
  #include "BL_ShapeActionActuator.h"
  #include "BL_ArmatureActuator.h"
 +#include "RNA_access.h"
+ #include "BL_Action.h"
  /* end of blender include block */
  
  #include "BL_BlenderDataConversion.h"
@@@ -20,7 -20,7 +20,8 @@@ incs += ' #source/blender/misc #source/
  incs += ' #source/blender/windowmanager'
  incs += ' #source/blender/makesrna'
  incs += ' #source/blender/ikplugin'
 +incs += ' #extern/recastnavigation/Detour/Include'
+ incs += ' #extern/Eigen2'
  
  incs += ' ' + env['BF_BULLET_INC']
  
@@@ -73,8 -73,9 +73,10 @@@ typedef unsigned long uint_ptr
  #include "SCA_ISensor.h"
  #include "SCA_IController.h"
  #include "NG_NetworkScene.h" //Needed for sendMessage()
 +#include "KX_ObstacleSimulation.h"
  
+ #include "BL_ActionManager.h"
  #include "PyObjectPlus.h" /* python stuff */
  
  // This file defines relationships between parents and children
  
  static MT_Point3 dummy_point= MT_Point3(0.0, 0.0, 0.0);
  static MT_Vector3 dummy_scaling = MT_Vector3(1.0, 1.0, 1.0);
- static MT_Matrix3x3 dummy_orientation = MT_Matrix3x3( 1.0, 0.0, 0.0,
-                                                                                                               0.0, 1.0, 0.0,
-                                                                                                               0.0, 0.0, 1.0);
+ static MT_Matrix3x3 dummy_orientation = MT_Matrix3x3(1.0, 0.0, 0.0,
+                                                      0.0, 1.0, 0.0,
+                                                      0.0, 0.0, 1.0);
  
  KX_GameObject::KX_GameObject(
-       void* sgReplicationInfo,
-       SG_Callbacks callbacks)
-       : SCA_IObject(),
-       m_bDyna(false),
-       m_layer(0),
-       m_pBlenderObject(NULL),
-       m_pBlenderGroupObject(NULL),
-       m_bSuspendDynamics(false),
-       m_bUseObjectColor(false),
-       m_bIsNegativeScaling(false),
-       m_bVisible(true),
-       m_bCulled(true),
-       m_bOccluder(false),
-       m_pPhysicsController1(NULL),
-       m_pGraphicController(NULL),
-       m_xray(false),
-       m_pHitObject(NULL),
-       m_isDeformable(false),
-       m_pObstacleSimulation(NULL)
+         void* sgReplicationInfo,
+         SG_Callbacks callbacks)
+     : SCA_IObject(),
+       m_bDyna(false),
+       m_layer(0),
+       m_pBlenderObject(NULL),
+       m_pBlenderGroupObject(NULL),
+       m_bSuspendDynamics(false),
+       m_bUseObjectColor(false),
+       m_bIsNegativeScaling(false),
+       m_bVisible(true),
+       m_bCulled(true),
+       m_bOccluder(false),
+       m_pPhysicsController1(NULL),
+       m_pGraphicController(NULL),
+       m_xray(false),
+       m_pHitObject(NULL),
+       m_actionManager(NULL),
 -      m_isDeformable(false)
++      m_isDeformable(false),
++      m_pObstacleSimulation(NULL)
  #ifdef WITH_PYTHON
-       , m_attr_dict(NULL)
+     , m_attr_dict(NULL)
  #endif
  {
        m_ignore_activity_culling = false;
@@@ -156,12 -157,11 +159,17 @@@ KX_GameObject::~KX_GameObject(
        {
                delete m_pGraphicController;
        }
 +
 +      if (m_pObstacleSimulation)
 +      {
 +              m_pObstacleSimulation->DestroyObstacleForObj(this);
 +      }
 +
+       if (m_actionManager)
+       {
+               KX_GetActiveScene()->RemoveAnimatedObject(this);
+               delete m_actionManager;
+       }
  #ifdef WITH_PYTHON
        if (m_attr_dict) {
                PyDict_Clear(m_attr_dict); /* incase of circular refs or other weird cases */
@@@ -361,16 -424,10 +432,18 @@@ void KX_GameObject::ProcessReplica(
        m_pSGNode = NULL;
        m_pClient_info = new KX_ClientObjectInfo(*m_pClient_info);
        m_pClient_info->m_gameobject = this;
+       if (m_actionManager)
+               m_actionManager = new BL_ActionManager(this);
        m_state = 0;
  
 +      KX_Scene* scene = KX_GetActiveScene();
 +      KX_ObstacleSimulation* obssimulation = scene->GetObstacleSimulation();
 +      struct Object* blenderobject = GetBlenderObject();
 +      if (obssimulation && (blenderobject->gameflag & OB_HASOBSTACLE))
 +      {
 +              obssimulation->AddObstacleForObj(this);
 +      }
 +
  #ifdef WITH_PYTHON
        if(m_attr_dict)
                m_attr_dict= PyDict_Copy(m_attr_dict);
@@@ -63,8 -63,9 +63,10 @@@ class RAS_MeshObject
  class KX_IPhysicsController;
  class PHY_IGraphicController;
  class PHY_IPhysicsEnvironment;
+ class BL_ActionManager;
  struct Object;
 +class KX_ObstacleSimulation;
+ struct bAction;
  
  #ifdef WITH_PYTHON
  /* utility conversion function */
@@@ -114,8 -115,11 +116,14 @@@ protected
  
        MT_CmMatrix4x4                                          m_OpenGL_4x4Matrix;
  
 +      KX_ObstacleSimulation*                          m_pObstacleSimulation;
 +
++
+       // The action manager is used to play/stop/update actions
+       BL_ActionManager*                               m_actionManager;
+       BL_ActionManager* GetActionManager();
+       
  public:
        bool                                                            m_isDeformable;
  
@@@ -1637,21 -1655,16 +1664,26 @@@ PyObject* initGameLogic(KX_KetsjiEngin
        KX_MACRO_addTypesToDict(d, ROT_MODE_ZXY, ROT_MODE_ZXY);
        KX_MACRO_addTypesToDict(d, ROT_MODE_ZYX, ROT_MODE_ZYX);
  
 +      /* Steering actuator */
 +      KX_MACRO_addTypesToDict(d, KX_STEERING_SEEK, KX_SteeringActuator::KX_STEERING_SEEK);
 +      KX_MACRO_addTypesToDict(d, KX_STEERING_FLEE, KX_SteeringActuator::KX_STEERING_FLEE);
 +      KX_MACRO_addTypesToDict(d, KX_STEERING_PATHFOLLOWING, KX_SteeringActuator::KX_STEERING_PATHFOLLOWING);
 +
 +      /* KX_NavMeshObject render mode */
 +      KX_MACRO_addTypesToDict(d, RM_WALLS, KX_NavMeshObject::RM_WALLS);
 +      KX_MACRO_addTypesToDict(d, RM_POLYS, KX_NavMeshObject::RM_POLYS);
 +      KX_MACRO_addTypesToDict(d, RM_TRIS, KX_NavMeshObject::RM_TRIS);
 +
+       /* BL_Action play modes */
+       KX_MACRO_addTypesToDict(d, KX_ACTION_MODE_PLAY, BL_Action::ACT_MODE_PLAY);
+       KX_MACRO_addTypesToDict(d, KX_ACTION_MODE_LOOP, BL_Action::ACT_MODE_LOOP);
+       KX_MACRO_addTypesToDict(d, KX_ACTION_MODE_PING_PONG, BL_Action::ACT_MODE_PING_PONG);
        // Check for errors
        if (PyErr_Occurred())
-     {
+       {
                Py_FatalError("can't initialize module bge.logic");
-     }
+       }
  
        return m;
  }
Simple merge
Simple merge
Simple merge