diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-06-10 18:42:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-06-10 18:42:24 +0400 |
commit | 64fbe2ee215821ad99b2554dd49cb16b20f867e3 (patch) | |
tree | c2a27bbb902355bf9a52bee5b7a8402ec3711328 /source/gameengine | |
parent | 0cfdb63499075e8ff70b986e6f80df31f2457a4d (diff) |
Minor modification to how objects are selected for animation baking,
Rather then only baking parent objects. Only bake objects which are have no parents in the original scene.
This allows for parenting and unparenting within the game engine without gaps in the animation curves.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Converter/KX_BlenderSceneConverter.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 3a5bb92b4fa..0575c55846b 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -752,22 +752,21 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber) { KX_Scene* scene = scenes->at(i); //PHY_IPhysicsEnvironment* physEnv = scene->GetPhysicsEnvironment(); - CListValue* parentList = scene->GetRootParentList(); + CListValue* parentList = scene->GetObjectList(); int numObjects = parentList->GetCount(); int g; for (g=0;g<numObjects;g++) { KX_GameObject* gameObj = (KX_GameObject*)parentList->GetValue(g); - if (gameObj->IsDynamic()) + Object* blenderObject = gameObj->GetBlenderObject(); + if (blenderObject && blenderObject->parent==NULL && gameObj->GetPhysicsController() != NULL) { //KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController(); - - Object* blenderObject = gameObj->GetBlenderObject(); if(blenderObject->adt==NULL) BKE_id_add_animdata(&blenderObject->id); - if (blenderObject && blenderObject->adt) + if (blenderObject->adt) { const MT_Point3& position = gameObj->NodeGetWorldPosition(); //const MT_Vector3& scale = gameObj->NodeGetWorldScaling(); |