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:
authorSybren A. Stüvel <sybren@blender.org>2021-03-29 19:22:42 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-03-30 10:46:26 +0300
commitfd10c21f51243921e645939e3f6a569c19864d8e (patch)
tree3cf02051eb3a3e00c671477a39e7a27a911d1bd2
parent563d513e37b68431fe1006450e5736e763c70a7b (diff)
Cleanup: animation, remove `BONE_UNKEYED` flag
Remove the `BONE_UNKEYED` flag. It was only written (set/cleared) but never actually read. Also remove `framechange_poses_clear_unkeyed()` as its only function was to clear the `BONE_UNKEYED` flag. It wasn't used anywhere either. The only code that used the flag was the `extract_pose_from_action()`, which was removed in 2869ce6cfab3aa4ff471bef6e49ac6fe15426247 (2009). No functional changes.
-rw-r--r--source/blender/blenkernel/BKE_action.h4
-rw-r--r--source/blender/blenkernel/intern/action.c24
-rw-r--r--source/blender/editors/animation/keyframing.c10
-rw-r--r--source/blender/editors/armature/pose_lib.c11
-rw-r--r--source/blender/editors/armature/pose_transform.c13
-rw-r--r--source/blender/editors/armature/pose_utils.c5
-rw-r--r--source/blender/editors/transform/transform_convert_armature.c11
-rw-r--r--source/blender/makesdna/DNA_armature_types.h2
8 files changed, 2 insertions, 78 deletions
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 62315643647..e27cb2be8ee 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -188,10 +188,6 @@ void BKE_pose_itasc_init(struct bItasc *itasc);
/* Checks if a bone is part of an IK chain or not */
bool BKE_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan);
-/* clears BONE_UNKEYED flags for frame changing */
-// XXX to be deprecated for a more general solution in animsys...
-void framechange_poses_clear_unkeyed(struct Main *bmain);
-
/* Bone Groups API --------------------- */
/* Adds a new bone-group */
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index f9c2a4e53ad..0b38e2d9f75 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -1316,30 +1316,6 @@ void BKE_pose_tag_update_constraint_flags(bPose *pose)
pose->flag |= POSE_CONSTRAINTS_NEED_UPDATE_FLAGS;
}
-/* Clears all BONE_UNKEYED flags for every pose channel in every pose
- * This should only be called on frame changing, when it is acceptable to
- * do this. Otherwise, these flags should not get cleared as poses may get lost.
- */
-void framechange_poses_clear_unkeyed(Main *bmain)
-{
- Object *ob;
- bPose *pose;
- bPoseChannel *pchan;
-
- /* This needs to be done for each object that has a pose */
- /* TODO: proxies may/may not be correctly handled here... (this needs checking) */
- for (ob = bmain->objects.first; ob; ob = ob->id.next) {
- /* we only need to do this on objects with a pose */
- if ((pose = ob->pose)) {
- for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
- if (pchan->bone) {
- pchan->bone->flag &= ~BONE_UNKEYED;
- }
- }
- }
- }
-}
-
/* ************************** Bone Groups ************************** */
/* Adds a new bone-group (name may be NULL) */
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 4cc0413be5b..9cbb799082c 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -3034,19 +3034,9 @@ bool ED_autokeyframe_pchan(
ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
BLI_freelistN(&dsources);
- /* clear any unkeyed tags */
- if (pchan->bone) {
- pchan->bone->flag &= ~BONE_UNKEYED;
- }
-
return true;
}
- /* add unkeyed tags */
- if (pchan->bone) {
- pchan->bone->flag |= BONE_UNKEYED;
- }
-
return false;
}
diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c
index dd90f9f2cc3..21fcbf8886b 100644
--- a/source/blender/editors/armature/pose_lib.c
+++ b/source/blender/editors/armature/pose_lib.c
@@ -1108,17 +1108,6 @@ static void poselib_keytag_pose(bContext *C, Scene *scene, tPoseLib_PreviewData
if (autokey) {
/* Add data-source override for the PoseChannel, to be used later. */
ANIM_relative_keyingset_add_source(&dsources, &pld->ob->id, &RNA_PoseBone, pchan);
-
- /* clear any unkeyed tags */
- if (pchan->bone) {
- pchan->bone->flag &= ~BONE_UNKEYED;
- }
- }
- else {
- /* add unkeyed tags */
- if (pchan->bone) {
- pchan->bone->flag |= BONE_UNKEYED;
- }
}
}
}
diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c
index 8d1c196e9c2..43ab20eb71c 100644
--- a/source/blender/editors/armature/pose_transform.c
+++ b/source/blender/editors/armature/pose_transform.c
@@ -172,9 +172,6 @@ static void applyarmature_transfer_properties(EditBone *curbone,
unit_qt(pchan->quat);
unit_axis_angle(pchan->rotAxis, &pchan->rotAngle);
pchan->size[0] = pchan->size[1] = pchan->size[2] = 1.0f;
-
- /* Set anim lock. */
- curbone->flag |= BONE_UNKEYED;
}
/* Adjust the current edit position of the bone using the pose space matrix. */
@@ -1200,10 +1197,6 @@ static int pose_clear_transform_generic_exec(bContext *C,
/* do auto-keyframing as appropriate */
if (autokeyframe_cfra_can_key(scene, &ob_iter->id)) {
- /* clear any unkeyed tags */
- if (pchan->bone) {
- pchan->bone->flag &= ~BONE_UNKEYED;
- }
/* tag for autokeying later */
ANIM_relative_keyingset_add_source(&dsources, &ob_iter->id, &RNA_PoseBone, pchan);
@@ -1212,12 +1205,6 @@ static int pose_clear_transform_generic_exec(bContext *C,
clear_func(ob_iter->pose, pchan_eval);
#endif
}
- else {
- /* add unkeyed tags */
- if (pchan->bone) {
- pchan->bone->flag |= BONE_UNKEYED;
- }
- }
}
FOREACH_PCHAN_SELECTED_IN_OBJECT_END;
diff --git a/source/blender/editors/armature/pose_utils.c b/source/blender/editors/armature/pose_utils.c
index c75e9c9ef69..75348c2b196 100644
--- a/source/blender/editors/armature/pose_utils.c
+++ b/source/blender/editors/armature/pose_utils.c
@@ -313,11 +313,6 @@ void poseAnim_mapping_autoKeyframe(bContext *C, Scene *scene, ListBase *pfLinks,
/* Add data-source override for the PoseChannel, to be used later. */
ANIM_relative_keyingset_add_source(&dsources, &pfl->ob->id, &RNA_PoseBone, pchan);
-
- /* clear any unkeyed tags */
- if (pchan->bone) {
- pchan->bone->flag &= ~BONE_UNKEYED;
- }
}
/* insert keyframes for all relevant bones in one go */
diff --git a/source/blender/editors/transform/transform_convert_armature.c b/source/blender/editors/transform/transform_convert_armature.c
index a4edf51ffee..7f24a0fa5f8 100644
--- a/source/blender/editors/transform/transform_convert_armature.c
+++ b/source/blender/editors/transform/transform_convert_armature.c
@@ -99,15 +99,7 @@ static void autokeyframe_pose(
bPoseChannel *pchan;
FCurve *fcu;
- /* TODO: this should probably be done per channel instead. */
if (!autokeyframe_cfra_can_key(scene, id)) {
- /* tag channels that should have unkeyed data */
- for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
- if (pchan->bone->flag & BONE_TRANSFORM) {
- /* tag this channel */
- pchan->bone->flag |= BONE_UNKEYED;
- }
- }
return;
}
@@ -139,9 +131,6 @@ static void autokeyframe_pose(
ListBase dsources = {NULL, NULL};
- /* clear any 'unkeyed' flag it may have */
- pchan->bone->flag &= ~BONE_UNKEYED;
-
/* add datasource override for the camera object */
ANIM_relative_keyingset_add_source(&dsources, id, &RNA_PoseBone, pchan);
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index 09304ce09f2..411fde13bb2 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -230,8 +230,10 @@ typedef enum eBone_Flag {
BONE_MULT_VG_ENV = (1 << 11),
/** bone doesn't deform geometry */
BONE_NO_DEFORM = (1 << 12),
+#ifdef DNA_DEPRECATED_ALLOW
/** set to prevent destruction of its unkeyframed pose (after transform) */
BONE_UNKEYED = (1 << 13),
+#endif
/** set to prevent hinge child bones from influencing the transform center */
BONE_HINGE_CHILD_TRANSFORM = (1 << 14),
#ifdef DNA_DEPRECATED_ALLOW