Fix #33324: Auto IK not working after recent changes. iTaSC it seems never worked
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 27 Nov 2012 20:07:12 +0000 (20:07 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 27 Nov 2012 20:07:12 +0000 (20:07 +0000)
with Auto IK, now that's fixed too.

source/blender/editors/transform/CMakeLists.txt
source/blender/editors/transform/SConscript
source/blender/editors/transform/transform_conversions.c

index 05a4f6f4ce50f6d489c0a58b3148212b2b3d907b..ec114bc30197692288b3ae1a93173098e5387319 100644 (file)
@@ -25,6 +25,7 @@ set(INC
        ../../blenlib
        ../../blenloader
        ../../bmesh
+       ../../ikplugin
        ../../makesdna
        ../../makesrna
        ../../windowmanager
index dbf6179035cb549b5494a08851d938cfc9f1a020..9cf36a2d9706e0cf28b1689bb63d91357524c0e5 100644 (file)
@@ -6,7 +6,7 @@ sources = env.Glob('*.c')
 incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
 incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
 incs += ' ../../render/extern/include'
-incs += ' ../../gpu ../../makesrna ../../blenloader ../../bmesh'
+incs += ' ../../gpu ../../makesrna ../../blenloader ../../bmesh ../../ikplugin'
 
 defs = []
 
index 5b79b69f7ec5aaaee0bbab5226e566b5baa76e27..1cf01bc1bbceef67262466703bd71077421e7561 100644 (file)
@@ -91,6 +91,7 @@
 #include "BKE_tracking.h"
 #include "BKE_mask.h"
 
+#include "BIK_api.h"
 
 #include "ED_anim_api.h"
 #include "ED_armature.h"
@@ -773,6 +774,9 @@ static void pose_grab_with_ik_clear(Object *ob)
                        if (con->type == CONSTRAINT_TYPE_KINEMATIC) {
                                data = con->data;
                                if (data->flag & CONSTRAINT_IK_TEMP) {
+                                       /* iTaSC needs clear for removed constraints */
+                                       BIK_clear_data(ob->pose);
+
                                        BLI_remlink(&pchan->constraints, con);
                                        MEM_freeN(con->data);
                                        MEM_freeN(con);
@@ -839,7 +843,7 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan)
        }
        else
                data->flag = CONSTRAINT_IK_TIP;
-       data->flag |= CONSTRAINT_IK_TEMP | CONSTRAINT_IK_AUTO;
+       data->flag |= CONSTRAINT_IK_TEMP | CONSTRAINT_IK_AUTO | CONSTRAINT_IK_POS;
        copy_v3_v3(data->grabtarget, pchan->pose_tail);
        data->rootbone = 0; /* watch-it! has to be 0 here, since we're still on the same bone for the first time through the loop [#25885] */
        
@@ -933,6 +937,10 @@ static short pose_grab_with_ik(Object *ob)
                }
        }
 
+       /* iTaSC needs clear for new IK constraints */
+       if(tot_ik)
+               BIK_clear_data(ob->pose);
+
        return (tot_ik) ? 1 : 0;
 }