[Bf-blender-cvs] [4ea79fc] master: Patch T37363: Highlight bone layers with active bones (as for Object Layers)
Joshua Leung
noreply at git.blender.org
Mon Nov 18 04:07:44 CET 2013
Commit: 4ea79fcdda6523faf875128ef3d6e8a8ecff67c9
Author: Joshua Leung
Date: Mon Nov 18 16:06:31 2013 +1300
http://developer.blender.org/rB4ea79fcdda6523faf875128ef3d6e8a8ecff67c9
Patch T37363: Highlight bone layers with active bones (as for Object Layers)
Patch by Jose Molina Garcia (sentinel), with style fixes by myself.
===================================================================
M source/blender/editors/interface/interface_layout.c
===================================================================
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index b23d701..0f6034b 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -54,6 +54,8 @@
#include "UI_interface.h"
+#include "ED_armature.h"
+
#include "WM_api.h"
#include "WM_types.h"
@@ -375,6 +377,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in
int cols = (len >= 20) ? 2 : 1;
const unsigned int colbuts = len / (2 * cols);
unsigned int layer_used = 0;
+ unsigned int layer_active = 0;
uiBlockSetCurLayout(block, uiLayoutAbsolute(layout, FALSE));
@@ -384,7 +387,15 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in
if (ptr->type == &RNA_Armature) {
bArmature *arm = (bArmature *)ptr->data;
+
layer_used = arm->layer_used;
+
+ if (arm->edbo && arm->act_edbone) {
+ layer_active |= arm->act_edbone->layer;
+ }
+ else if (arm->act_bone) {
+ layer_active |= arm->act_bone->layer;
+ }
}
for (b = 0; b < cols; b++) {
@@ -394,8 +405,15 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in
int layer_num = a + b * colbuts;
int layer_flag = 1 << layer_num;
- if (layer_used & layer_flag) icon = ICON_LAYER_USED;
- else icon = ICON_BLANK1;
+ if (layer_used & layer_flag) {
+ if (layer_active & layer_flag)
+ icon = ICON_LAYER_ACTIVE;
+ else
+ icon = ICON_LAYER_USED;
+ }
+ else {
+ icon = ICON_BLANK1;
+ }
but = uiDefAutoButR(block, ptr, prop, layer_num, "", icon, x + butw * a, y + buth, butw, buth);
if (subtype == PROP_LAYER_MEMBER)
@@ -405,8 +423,15 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in
int layer_num = a + len / 2 + b * colbuts;
int layer_flag = 1 << layer_num;
- if (layer_used & layer_flag) icon = ICON_LAYER_USED;
- else icon = ICON_BLANK1;
+ if (layer_used & layer_flag) {
+ if (layer_active & layer_flag)
+ icon = ICON_LAYER_ACTIVE;
+ else
+ icon = ICON_LAYER_USED;
+ }
+ else {
+ icon = ICON_BLANK1;
+ }
but = uiDefAutoButR(block, ptr, prop, layer_num, "", icon, x + butw * a, y, butw, buth);
if (subtype == PROP_LAYER_MEMBER)
More information about the Bf-blender-cvs
mailing list