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 2869ce6cfa (2009).
No functional changes.
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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) */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user