fix [#26164] bpy.ops.transform.translate ignores AutoIK mode
authorCampbell Barton <ideasman42@gmail.com>
Wed, 23 Feb 2011 04:03:58 +0000 (04:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 23 Feb 2011 04:03:58 +0000 (04:03 +0000)
auto-ik updates are done by notifiers at the moment which are ignored when running bpy.ops.transform.translate(), so add an special_aftertrans_update() check for this case.

source/blender/editors/transform/transform_conversions.c

index dbed27e95a145b3919f3e3d3110ab17a0f4484e4..11559cc85c7a17ba9c207cd94183a8194107a259 100644 (file)
@@ -4898,6 +4898,14 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
                arm= ob->data;
                pose= ob->pose;
 
+               if((t->flag & T_AUTOIK) && (t->options & CTX_AUTOCONFIRM)) {
+                       /* when running transform non-interactively (operator exec),
+                        * we need to update the pose otherwise no updates get called during
+                        * transform and the auto-ik is not applied. see [#26164] */
+                       struct Object *ob=t->poseobj;
+                       where_is_pose(t->scene, ob);
+               }
+
                /* if target-less IK grabbing, we calculate the pchan transforms and clear flag */
                if (!cancelled && t->mode==TFM_TRANSLATION)
                        targetless_ik= apply_targetless_ik(ob);