Cleanup: rename BKE_pose_channel_{verify => ensure}
The term `verify` doesn't fit with what this function does and is sometimes used to check data is valid or to control validity checking as with `RNA_define_verify_sdna`. use more common term `ensure`.
This commit is contained in:
parent
af3eda8185
commit
c51720a6ad
|
@ -161,7 +161,7 @@ void BKE_pose_channel_session_uuid_generate(struct bPoseChannel *pchan);
|
|||
struct bPoseChannel *BKE_pose_channel_find_name(const struct bPose *pose, const char *name);
|
||||
struct bPoseChannel *BKE_pose_channel_active(struct Object *ob);
|
||||
struct bPoseChannel *BKE_pose_channel_active_or_first_selected(struct Object *ob);
|
||||
struct bPoseChannel *BKE_pose_channel_verify(struct bPose *pose, const char *name);
|
||||
struct bPoseChannel *BKE_pose_channel_ensure(struct bPose *pose, const char *name);
|
||||
struct bPoseChannel *BKE_pose_channel_get_mirrored(const struct bPose *pose, const char *name);
|
||||
|
||||
void BKE_pose_check_uuids_unique_and_report(const struct bPose *pose);
|
||||
|
|
|
@ -635,7 +635,7 @@ bPoseChannel *BKE_pose_channel_find_name(const bPose *pose, const char *name)
|
|||
* \note Use with care, not on Armature poses but for temporal ones.
|
||||
* \note (currently used for action constraints and in rebuild_pose).
|
||||
*/
|
||||
bPoseChannel *BKE_pose_channel_verify(bPose *pose, const char *name)
|
||||
bPoseChannel *BKE_pose_channel_ensure(bPose *pose, const char *name)
|
||||
{
|
||||
bPoseChannel *chan;
|
||||
|
||||
|
@ -1191,7 +1191,7 @@ void BKE_pose_free(bPose *pose)
|
|||
* and ID-Props, used when duplicating bones in editmode.
|
||||
* (unlike copy_pose_channel_data which only does posing-related stuff).
|
||||
*
|
||||
* \note use when copying bones in editmode (on returned value from #BKE_pose_channel_verify)
|
||||
* \note use when copying bones in editmode (on returned value from #BKE_pose_channel_ensure)
|
||||
*/
|
||||
void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_from)
|
||||
{
|
||||
|
|
|
@ -2444,7 +2444,7 @@ static void pose_proxy_sync(Object *ob, Object *from, int layer_protected)
|
|||
static int rebuild_pose_bone(
|
||||
bPose *pose, Bone *bone, bPoseChannel *parchan, int counter, Bone **r_last_visited_bone_p)
|
||||
{
|
||||
bPoseChannel *pchan = BKE_pose_channel_verify(pose, bone->name); /* verify checks and/or adds */
|
||||
bPoseChannel *pchan = BKE_pose_channel_ensure(pose, bone->name); /* verify checks and/or adds */
|
||||
|
||||
pchan->bone = bone;
|
||||
pchan->parent = parchan;
|
||||
|
|
|
@ -2836,7 +2836,7 @@ static void actcon_get_tarmat(struct Depsgraph *depsgraph,
|
|||
* including rotation order, otherwise this fails. */
|
||||
pchan = cob->pchan;
|
||||
|
||||
tchan = BKE_pose_channel_verify(&pose, pchan->name);
|
||||
tchan = BKE_pose_channel_ensure(&pose, pchan->name);
|
||||
tchan->rotmode = pchan->rotmode;
|
||||
|
||||
/* evaluate action using workob (it will only set the PoseChannel in question) */
|
||||
|
|
|
@ -390,7 +390,7 @@ static void updateDuplicateSubtarget(EditBone *dup_bone,
|
|||
bConstraint *curcon;
|
||||
ListBase *conlist;
|
||||
|
||||
if ((pchan = BKE_pose_channel_verify(ob->pose, dup_bone->name))) {
|
||||
if ((pchan = BKE_pose_channel_ensure(ob->pose, dup_bone->name))) {
|
||||
if ((conlist = &pchan->constraints)) {
|
||||
for (curcon = conlist->first; curcon; curcon = curcon->next) {
|
||||
/* does this constraint have a subtarget in
|
||||
|
@ -825,7 +825,7 @@ static void updateDuplicateConstraintSettings(EditBone *dup_bone, EditBone *orig
|
|||
bConstraint *curcon;
|
||||
ListBase *conlist;
|
||||
|
||||
if ((pchan = BKE_pose_channel_verify(ob->pose, dup_bone->name)) == NULL ||
|
||||
if ((pchan = BKE_pose_channel_ensure(ob->pose, dup_bone->name)) == NULL ||
|
||||
(conlist = &pchan->constraints) == NULL) {
|
||||
return;
|
||||
}
|
||||
|
@ -855,7 +855,7 @@ static void updateDuplicateCustomBoneShapes(bContext *C, EditBone *dup_bone, Obj
|
|||
return;
|
||||
}
|
||||
bPoseChannel *pchan;
|
||||
pchan = BKE_pose_channel_verify(ob->pose, dup_bone->name);
|
||||
pchan = BKE_pose_channel_ensure(ob->pose, dup_bone->name);
|
||||
|
||||
if (pchan->custom != NULL) {
|
||||
Main *bmain = CTX_data_main(C);
|
||||
|
@ -885,12 +885,12 @@ static void copy_pchan(EditBone *src_bone, EditBone *dst_bone, Object *src_ob, O
|
|||
if (src_ob->pose) {
|
||||
bPoseChannel *chanold, *channew;
|
||||
|
||||
chanold = BKE_pose_channel_verify(src_ob->pose, src_bone->name);
|
||||
chanold = BKE_pose_channel_ensure(src_ob->pose, src_bone->name);
|
||||
if (chanold) {
|
||||
/* WARNING: this creates a new posechannel, but there will not be an attached bone
|
||||
* yet as the new bones created here are still 'EditBones' not 'Bones'.
|
||||
*/
|
||||
channew = BKE_pose_channel_verify(dst_ob->pose, dst_bone->name);
|
||||
channew = BKE_pose_channel_ensure(dst_ob->pose, dst_bone->name);
|
||||
|
||||
if (channew) {
|
||||
BKE_pose_channel_copy_data(channew, chanold);
|
||||
|
@ -1193,7 +1193,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
|
|||
* is synchronized. */
|
||||
bPoseChannel *pchan;
|
||||
/* Make sure we clean up the old data before overwriting it */
|
||||
pchan = BKE_pose_channel_verify(obedit->pose, ebone_iter->temp.ebone->name);
|
||||
pchan = BKE_pose_channel_ensure(obedit->pose, ebone_iter->temp.ebone->name);
|
||||
BKE_pose_channel_free(pchan);
|
||||
/* Sync pchan data */
|
||||
copy_pchan(ebone_iter, ebone_iter->temp.ebone, obedit, obedit);
|
||||
|
|
Loading…
Reference in New Issue