Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2020-04-15 13:32:06 +0300
committerSebastian Parborg <darkdefende@gmail.com>2020-04-15 13:36:14 +0300
commit6547d9d3e2cb0eb0b3da8ebf3a96f6664f9c2610 (patch)
tree54f526fae9df8442f59fded7d65f9b09a7b256e3 /source/blender/editors/transform/transform_convert_armature.c
parentc1edbe791794e678ab8a986b559b9c117ed7b971 (diff)
Fix T75649: Using "Auto IK" on FK controls with Rigify will crash Blender.
Fixed a coding mistake when adding temp IK chains with Auto-IK. We need to use the data from the new temporary constraint.
Diffstat (limited to 'source/blender/editors/transform/transform_convert_armature.c')
-rw-r--r--source/blender/editors/transform/transform_convert_armature.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_convert_armature.c b/source/blender/editors/transform/transform_convert_armature.c
index 0106f4f41c7..4a79fd672b6 100644
--- a/source/blender/editors/transform/transform_convert_armature.c
+++ b/source/blender/editors/transform/transform_convert_armature.c
@@ -58,7 +58,8 @@ typedef struct BoneInitData {
float zwidth;
} BoneInitData;
-static void add_temporary_ik_constraint(bPoseChannel *pchan, bKinematicConstraint *targetless_con)
+static bConstraint *add_temporary_ik_constraint(bPoseChannel *pchan,
+ bKinematicConstraint *targetless_con)
{
bConstraint *con = BKE_constraint_add_for_pose(
NULL, pchan, "TempConstraint", CONSTRAINT_TYPE_KINEMATIC);
@@ -77,6 +78,8 @@ static void add_temporary_ik_constraint(bPoseChannel *pchan, bKinematicConstrain
}
temp_con_data->flag |= CONSTRAINT_IK_TEMP | CONSTRAINT_IK_AUTO | CONSTRAINT_IK_POS;
+
+ return con;
}
static void update_deg_with_temporary_ik(Main *bmain, Object *ob)
@@ -324,7 +327,8 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan)
}
}
- add_temporary_ik_constraint(pchan, targetless);
+ data = add_temporary_ik_constraint(pchan, targetless)->data;
+
copy_v3_v3(data->grabtarget, pchan->pose_tail);
/* watch-it! has to be 0 here, since we're still on the