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>2019-06-06 16:52:52 +0300
committerSebastian Parborg <darkdefende@gmail.com>2019-06-06 16:54:49 +0300
commit93ec2c94e5afef18563cbefa0d12275ebabb7ff0 (patch)
tree0737c00fa59f32a55573e17bb2a42f91d2f5b6e5 /source/blender
parent3a20c056e89a50ee39a228f59868c26ac750fac8 (diff)
Fix T64533: Using "X-Axis Mirror" while posing with auto keyframe on does not keyframe the mirrored bone
Use an additional pose bone flag so we can keep track of mirrored bones that should be autokeyframed. Reviewed By: Brecht Differential Revision: https://developer.blender.org/D5033
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/transform/transform_conversions.c9
-rw-r--r--source/blender/editors/transform/transform_generics.c3
-rw-r--r--source/blender/makesdna/DNA_armature_types.h2
3 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index e766709cdf1..19a61e1daa7 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -812,7 +812,7 @@ static void bone_children_clear_transflag(int mode, short around, ListBase *lb)
bone->flag |= BONE_TRANSFORM_CHILD;
}
else {
- bone->flag &= ~BONE_TRANSFORM;
+ bone->flag &= ~(BONE_TRANSFORM | BONE_TRANSFORM_MIRROR);
}
bone_children_clear_transflag(mode, around, &bone->childbase);
@@ -838,14 +838,14 @@ int count_set_pose_transflags(Object *ob,
bone->flag |= BONE_TRANSFORM;
}
else {
- bone->flag &= ~BONE_TRANSFORM;
+ bone->flag &= ~(BONE_TRANSFORM | BONE_TRANSFORM_MIRROR);
}
bone->flag &= ~BONE_HINGE_CHILD_TRANSFORM;
bone->flag &= ~BONE_TRANSFORM_CHILD;
}
else {
- bone->flag &= ~BONE_TRANSFORM;
+ bone->flag &= ~(BONE_TRANSFORM | BONE_TRANSFORM_MIRROR);
}
}
@@ -6778,7 +6778,8 @@ void autokeyframe_pose(bContext *C, Scene *scene, Object *ob, int tmode, short t
}
for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
- if (pchan->bone->flag & BONE_TRANSFORM) {
+ if (pchan->bone->flag & (BONE_TRANSFORM | BONE_TRANSFORM_MIRROR)) {
+
ListBase dsources = {NULL, NULL};
/* clear any 'unkeyed' flag it may have */
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 0a361d0d09e..d6c09716a63 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -819,6 +819,9 @@ static void pose_transform_mirror_update(Object *ob, PoseInitData_Mirror *pid)
pid++;
}
BKE_pchan_apply_mat4(pchan, pchan_mtx_final, false);
+
+ /* set flag to let autokeyframe know to keyframe the mirrred bone */
+ pchan->bone->flag |= BONE_TRANSFORM_MIRROR;
}
}
}
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index b18ab503e94..589b657e5b8 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -249,6 +249,8 @@ typedef enum eBone_Flag {
BONE_RELATIVE_PARENTING = (1 << 23),
/** it will add the parent end roll to the inroll */
BONE_ADD_PARENT_END_ROLL = (1 << 24),
+ /** this bone was transformed by the mirror function */
+ BONE_TRANSFORM_MIRROR = (1 << 25),
} eBone_Flag;