Some pose action ipo corruptions when using BGE, added some debug printf's when copyi...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 13 Jun 2008 02:20:09 +0000 (02:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 13 Jun 2008 02:20:09 +0000 (02:20 +0000)
source/blender/blenkernel/intern/action.c
source/gameengine/Converter/BL_ArmatureObject.cpp

index 5fb3d6f869a707bedeb4cf14aa1bd4b39257587b..4860c65f06cb9296998d800a01a8bdd6c37b2ab8 100644 (file)
@@ -290,6 +290,12 @@ void copy_pose(bPose **dst, bPose *src, int copycon)
                return;
        }
        
+       if (*dst==src) {
+               printf("copy_pose source and target are the same\n");
+               *dst=NULL;
+               return;
+       }
+       
        outPose= MEM_callocN(sizeof(bPose), "pose");
        
        duplicatelist(&outPose->chanbase, &src->chanbase);
@@ -740,6 +746,11 @@ void extract_pose_from_pose(bPose *pose, const bPose *src)
        const bPoseChannel *schan;
        bPoseChannel *pchan= pose->chanbase.first;
 
+       if (pose==src) {
+               printf("extract_pose_from_pose source and target are the same\n");
+               return;
+       }
+
        for (schan=src->chanbase.first; schan; schan=schan->next, pchan= pchan->next) {
                copy_pose_channel_data(pchan, schan);
        }
@@ -817,6 +828,12 @@ void copy_pose_result(bPose *to, bPose *from)
                return;
        }
 
+       if (to==from) {
+               printf("copy_pose_result source and target are the same\n");
+               return;
+       }
+
+
        for(pchanfrom= from->chanbase.first; pchanfrom; pchanfrom= pchanfrom->next) {
                pchanto= get_pose_channel(to, pchanfrom->name);
                if(pchanto) {
index 08567dde84082693db339843e90959eb17f957e3..d4712efda9e3a0cd1b72aa2aea6af1f1c674a419 100644 (file)
@@ -92,9 +92,10 @@ BL_ArmatureObject::~BL_ArmatureObject()
 /* there is only 1 unique Pose per Armature */
 void BL_ArmatureObject::ApplyPose()
 {
-       if (m_pose){
+       if (m_pose) {
                // copy to armature object
-               extract_pose_from_pose(m_objArma->pose, m_pose);
+               if (m_objArma->pose != m_pose)/* This should never happen but it does - Campbell */
+                       extract_pose_from_pose(m_objArma->pose, m_pose);
                
                // is this needed anymore?
                //if (!m_mrdPose)