Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2008-01-23 13:14:45 +0300
committerJoshua Leung <aligorith@gmail.com>2008-01-23 13:14:45 +0300
commit9cd27e908b4f4a607b2325be45491d465742e4bb (patch)
tree57fb5722a38e3a298e1c51c4c8ed954d4d7fad73 /source/blender/src/buttons_editing.c
parent93f3585f8bd703e874752ef367717740248ff2c1 (diff)
== "Custom Bone Colors" ==
This commit introduces the ability to give groups of bones different colour-sets, which enables them to be more easily identified in the 3d-view. Currently, custom bone colours have been implemented as a way to visualise bone-group membership (after all, colours and groups are both just ways of managing bones). Usage Notes: * Each theme currently has 20 Color-Sets available for Bones. These can be accessed from the "Bone Color Sets" option under the Theme buttons. (Note: currently, I haven't defined any default colour-sets. Donations welcome on this ;-) ) As such, colour sets are not saved per file! You will need to save the theme to preserve the color set for the next session. * Each Bone-Group can use any one of these 20 sets, or just use the default colour-set. Use the "GroupCol" button to set this. When a set has been chosen, three little rectangles are drawn beside the button to preview the colours the set provides. * A bone must belong to a Bone-Group to get that group's colours. * "Colors" toggle on "Armature" panel must be enabled for these custom-colours to be shown for all bones that can have them. This toggle is off by default, but is there to allow rigs to be debugged (by colours) for example. * The "Use 'Constraint' Colouring" option (per Colour Set), determines whether the colours denoting presences of constraints, ik, or keyframes are drawn in conjunction with the custom colours. It is off by default, as in many combinations, they look quite ugly when used in conjunction with custom colours. * Custom colours are only shown in PoseMode Assorted Notes: * I've tested this thoroughly, and there shouldn't be any problems caused by this. * In the process, I found a bug with envelope bone drawmode. In wire-frame mode, all bones got scaled up by several types. * I've cleaned up the armature drawing code a bit (mostly fixing messy white-space usage), but also creating a centralised method of setting colours for bones (currently only used for bones in PoseMode).
Diffstat (limited to 'source/blender/src/buttons_editing.c')
-rw-r--r--source/blender/src/buttons_editing.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
index 4bd16f16027..b1b948c56e8 100644
--- a/source/blender/src/buttons_editing.c
+++ b/source/blender/src/buttons_editing.c
@@ -4071,9 +4071,10 @@ static void editing_panel_armature_type(Object *ob, bArmature *arm)
uiDefButI(block, ROW, REDRAWVIEW3D, "B-Bone", 155, 87,70,20, &arm->drawtype, 0, ARM_B_BONE, 0, 0, "Draw bones as boxes, showing subdivision and b-splines");
uiDefButI(block, ROW, REDRAWVIEW3D, "Envelope", 225, 87,85,20, &arm->drawtype, 0, ARM_ENVELOPE, 0, 0, "Draw bones as extruded spheres, showing deformation influence volume");
- uiDefButBitI(block, TOG, ARM_DRAWAXES, REDRAWVIEW3D, "Draw Axes", 10, 67,100,20, &arm->flag, 0, 0, 0, 0, "Draw bone axes");
- uiDefButBitI(block, TOG, ARM_DRAWNAMES, REDRAWVIEW3D, "Draw Names", 110,67,100,20, &arm->flag, 0, 0, 0, 0, "Draw bone names");
- uiDefButBitI(block, TOGN, ARM_NO_CUSTOM, REDRAWVIEW3D, "Draw Shapes", 210,67,100,20, &arm->flag, 0, 0, 0, 0, "Draw custom bone shapes");
+ uiDefButBitI(block, TOG, ARM_DRAWAXES, REDRAWVIEW3D, "Axes", 10, 67,75,20, &arm->flag, 0, 0, 0, 0, "Draw bone axes");
+ uiDefButBitI(block, TOG, ARM_DRAWNAMES, REDRAWVIEW3D, "Names", 85,67,75,20, &arm->flag, 0, 0, 0, 0, "Draw bone names");
+ uiDefButBitI(block, TOGN, ARM_NO_CUSTOM, REDRAWVIEW3D, "Shapes", 160,67,75,20, &arm->flag, 0, 0, 0, 0, "Draw custom bone shapes");
+ uiDefButBitI(block, TOG, ARM_COL_CUSTOM, REDRAWVIEW3D, "Colors", 235,67,75,20, &arm->flag, 0, 0, 0, 0, "Draw custom bone colors (colors are set per Bone Group)");
uiBlockEndAlign(block);
@@ -5167,7 +5168,19 @@ static void editing_panel_links(Object *ob)
uiDefIconBut(block, BUT, B_POSEGRP_REMOVE, VICON_X, xco+140-20, 85, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Remove this Pose Group");
/* set custom color set */
- uiDefButI(block, MENU,B_POSEGRP_RECALC, "Custom Color Set%t|GrpCol: [None]%x0", xco,65,140,19, &grp->customCol, 0.0, 0.0, 0.0, 0.0, "Set of Custom Colors to shade Group's bones with. (NOT YET FUNCTIONAL)");
+ uiDefButI(block, NUM,B_POSEGRP_RECALC, "GroupColor: ", xco,65,110,19, &grp->customCol, 0, 20, 0.0, 0.0, "Index of set of Custom Colors to shade Group's bones with. 0 = Use Default Color Scheme");
+ if (grp->customCol) {
+ bTheme *btheme= U.themes.first;
+ ThemeWireColor *col_set= &btheme->tarm[(grp->customCol - 1)];
+
+ uiSetButLock(1, "To change these colors, see Themes -> Bone Color Sets");
+
+ uiDefButC(block, COL, B_POSEGRP_RECALC, "", xco+110, 65, 10, 19, col_set->solid, 0, 0, 0, 0, "Color to use for surface of bones. See current theme in Info Window.");
+ uiDefButC(block, COL, B_POSEGRP_RECALC, "", xco+120, 65, 10, 19, col_set->select, 0, 0, 0, 0, "Color to use for 'selected' bones. See current theme in Info Window.");
+ uiDefButC(block, COL, B_POSEGRP_RECALC, "", xco+130, 65, 10, 19, col_set->active, 0, 0, 0, 0, "Color to use for 'active' bones. See current theme in Info Window.");
+
+ uiClearButLock();
+ }
}
uiBlockEndAlign(block);
}