[Bf-blender-cvs] [aa7105f7599] master: Cleanup: use BKE_pose_is_layer_visible in more places

Philipp Oeser noreply at git.blender.org
Tue Dec 21 16:47:39 CET 2021


Commit: aa7105f7599f8d35438444006eb1e43f211286dd
Author: Philipp Oeser
Date:   Tue Dec 21 14:22:38 2021 +0100
Branches: master
https://developer.blender.org/rBaa7105f7599f8d35438444006eb1e43f211286dd

Cleanup: use BKE_pose_is_layer_visible in more places

This was added in rBd13970de8627, now use in more places.

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

M	source/blender/editors/armature/pose_edit.c
M	source/blender/editors/armature/pose_lib.c
M	source/blender/editors/space_info/info_stats.cc
M	source/blender/editors/transform/transform_convert_armature.c

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

diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index 772fe8f3196..8bd6c9f54fd 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -160,7 +160,7 @@ static bool pose_has_protected_selected(Object *ob, short warn)
     bArmature *arm = ob->data;
 
     for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
-      if (pchan->bone && (pchan->bone->layer & arm->layer)) {
+      if (pchan->bone && BKE_pose_is_layer_visible(arm, pchan)) {
         if (pchan->bone->layer & arm->layer_protected) {
           if (pchan->bone->flag & BONE_SELECTED) {
             break;
diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c
index 646356e7a45..dc96c777be0 100644
--- a/source/blender/editors/armature/pose_lib.c
+++ b/source/blender/editors/armature/pose_lib.c
@@ -1070,7 +1070,7 @@ static void poselib_apply_pose(tPoseLib_PreviewData *pld,
         else if (pchan->bone) {
           /* only ok if bone is visible and selected */
           if ((pchan->bone->flag & BONE_SELECTED) && (pchan->bone->flag & BONE_HIDDEN_P) == 0 &&
-              (pchan->bone->layer & arm->layer)) {
+              BKE_pose_is_layer_visible(arm, pchan)) {
             ok = 1;
           }
         }
diff --git a/source/blender/editors/space_info/info_stats.cc b/source/blender/editors/space_info/info_stats.cc
index bcf26743030..005ae0214cd 100644
--- a/source/blender/editors/space_info/info_stats.cc
+++ b/source/blender/editors/space_info/info_stats.cc
@@ -43,6 +43,7 @@
 
 #include "BLT_translation.h"
 
+#include "BKE_action.h"
 #include "BKE_armature.h"
 #include "BKE_blender_version.h"
 #include "BKE_context.h"
@@ -351,7 +352,7 @@ static void stats_object_pose(const Object *ob, SceneStats *stats)
     LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
       stats->totbone++;
       if (pchan->bone && (pchan->bone->flag & BONE_SELECTED)) {
-        if (pchan->bone->layer & arm->layer) {
+        if (BKE_pose_is_layer_visible(arm, pchan)) {
           stats->totbonesel++;
         }
       }
diff --git a/source/blender/editors/transform/transform_convert_armature.c b/source/blender/editors/transform/transform_convert_armature.c
index 63aada0f797..5d0a3bd9dd1 100644
--- a/source/blender/editors/transform/transform_convert_armature.c
+++ b/source/blender/editors/transform/transform_convert_armature.c
@@ -427,7 +427,7 @@ static short pose_grab_with_ik(Main *bmain, Object *ob)
   /* Rule: allow multiple Bones
    * (but they must be selected, and only one ik-solver per chain should get added) */
   for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
-    if (pchan->bone->layer & arm->layer) {
+    if (BKE_pose_is_layer_visible(arm, pchan)) {
       if (pchan->bone->flag & (BONE_SELECTED | BONE_TRANSFORM_MIRROR)) {
         /* Rule: no IK for solitary (unconnected) bones. */
         for (bonec = pchan->bone->childbase.first; bonec; bonec = bonec->next) {



More information about the Bf-blender-cvs mailing list