[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29384] trunk/blender/source/gameengine/ Converter/KX_BlenderSceneConverter.cpp: Minor modification to how objects are selected for animation baking,

Campbell Barton ideasman42 at gmail.com
Thu Jun 10 16:42:25 CEST 2010


Revision: 29384
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29384
Author:   campbellbarton
Date:     2010-06-10 16:42:24 +0200 (Thu, 10 Jun 2010)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp

Modified: trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp	2010-06-10 08:06:11 UTC (rev 29383)
+++ trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp	2010-06-10 14:42:24 UTC (rev 29384)
@@ -752,22 +752,21 @@
 	{
 		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();





More information about the Bf-blender-cvs mailing list