Revision: 15110
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15110
Author:   ben2610
Date:     2008-06-04 00:54:24 +0200 (Wed, 04 Jun 2008)

Log Message:
-----------
Fix BGE bug #13605: GameEngine corrupts Pose data

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

Modified: trunk/blender/source/gameengine/Converter/BL_ArmatureObject.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_ArmatureObject.cpp     
2008-06-03 21:51:46 UTC (rev 15109)
+++ trunk/blender/source/gameengine/Converter/BL_ArmatureObject.cpp     
2008-06-03 22:54:24 UTC (rev 15110)
@@ -153,9 +153,12 @@
                int copy_constraint_channels_hack = 1;
                copy_pose(pose, m_pose, copy_constraint_channels_hack);
        }
-       else
+       else {
+               if (*pose == m_pose)
+                       // no need to copy if the pointers are the same
+                       return;
                extract_pose_from_pose(*pose, m_pose);
-
+       }
 }
 
 void BL_ArmatureObject::GetMRDPose(bPose **pose)
@@ -169,7 +172,11 @@
        //}
 
        if (!*pose)
-               copy_pose(pose, m_objArma->pose, 0);
+               // must duplicate the constraints too otherwise we have 
corruption in free_pose_channels()
+               // because it will free the blender constraints. 
+               // Ideally, blender should rememeber that the constraints were 
not copied so that
+               // free_pose_channels() would not free them.
+               copy_pose(pose, m_objArma->pose, 1);
        else
                extract_pose_from_pose(*pose, m_objArma->pose);
 


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to