diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-06-04 02:54:24 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-06-04 02:54:24 +0400 |
commit | 772d241582a8d396425cd7f53438871858669a99 (patch) | |
tree | dc501cd230509ffe51e29a25b9bb22fe7ec1615c /source/gameengine | |
parent | 0c0c43f62001eb652b8a8c374cca390824ef2c5e (diff) |
Fix BGE bug #13605: GameEngine corrupts Pose data
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Converter/BL_ArmatureObject.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index ff9c6a75aa9..08567dde840 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -153,9 +153,12 @@ void BL_ArmatureObject::GetPose(bPose **pose) 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 @@ void BL_ArmatureObject::GetMRDPose(bPose **pose) //} 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); |