[Bf-blender-cvs] [c51720a6add] master: Cleanup: rename BKE_pose_channel_{verify => ensure}

Campbell Barton noreply at git.blender.org
Fri Apr 30 08:18:15 CEST 2021


Commit: c51720a6add99a728c3784a5ff507a619e797316
Author: Campbell Barton
Date:   Fri Apr 30 15:30:41 2021 +1000
Branches: master
https://developer.blender.org/rBc51720a6add99a728c3784a5ff507a619e797316

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`.

===================================================================

M	source/blender/blenkernel/BKE_action.h
M	source/blender/blenkernel/intern/action.c
M	source/blender/blenkernel/intern/armature.c
M	source/blender/blenkernel/intern/constraint.c
M	source/blender/editors/armature/armature_add.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index e9ac865cfd2..3d81fcba37d 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -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);
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 933d0678bf5..3f3aa0386e2 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -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)
 {
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 146a482e72a..80992cff34d 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -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;
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 2ee030ca83f..17f36bd0860 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -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) */
diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c
index 3d5f0ac5c10..3902f6613a1 100644
--- a/source/blender/editors/armature/armature_add.c
+++ b/source/blender/editors/armature/armature_add.c
@@ -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);



More information about the Bf-blender-cvs mailing list