diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-10 00:03:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-10 00:03:54 +0300 |
commit | 5935ef004935b27fc5795349aed32f87cf637049 (patch) | |
tree | f36022abb03938420606405e9afc841b14d4bd81 /source/blender/editors/space_view3d/drawarmature.c | |
parent | 3e2766bc2ee7523ea68caedc5b11e9498ddcbbc1 (diff) |
use armature active bone as a pointer rather then a flag for each bone that needs looking up.
- rna vars arm.bones.active & rna.edit_bones.active
- needed special undo support.
- readfile.c loads.
- duplicate and copy_armature support.
- keep the draw flag, renamed to BONE_DRAW_ACTIVE, only use for openGL drawing.
Note: it may be better to allow active/unselected as with objects.
Diffstat (limited to 'source/blender/editors/space_view3d/drawarmature.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 656d7061d48..230bacf4f7f 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -166,7 +166,7 @@ static short set_pchan_glColor (short colCode, int armflag, int boneflag, int co if (bcolor) { char cp[3]; - if (boneflag & BONE_ACTIVE) { + if (boneflag & BONE_DRAW_ACTIVE) { VECCOPY(cp, bcolor->active); } else if (boneflag & BONE_SELECTED) { @@ -181,7 +181,7 @@ static short set_pchan_glColor (short colCode, int armflag, int boneflag, int co glColor3ub(cp[0], cp[1], cp[2]); } else { - if (boneflag & BONE_ACTIVE) UI_ThemeColorShade(TH_BONE_POSE, 40); + if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorShade(TH_BONE_POSE, 40); else if (boneflag & BONE_SELECTED) UI_ThemeColor(TH_BONE_POSE); else UI_ThemeColor(TH_WIRE); } @@ -225,7 +225,7 @@ static short set_pchan_glColor (short colCode, int armflag, int boneflag, int co if (bcolor) { char cp[3]; - if (boneflag & BONE_ACTIVE) { + if (boneflag & BONE_DRAW_ACTIVE) { VECCOPY(cp, bcolor->active); } else if (boneflag & BONE_SELECTED) { @@ -238,7 +238,7 @@ static short set_pchan_glColor (short colCode, int armflag, int boneflag, int co glColor3ub(cp[0], cp[1], cp[2]); } else { - if (boneflag & BONE_ACTIVE) UI_ThemeColorShade(TH_BONE_POSE, 40); + if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorShade(TH_BONE_POSE, 40); else if (boneflag & BONE_SELECTED) UI_ThemeColor(TH_BONE_POSE); else UI_ThemeColor(TH_BONE_SOLID); } @@ -251,7 +251,7 @@ static short set_pchan_glColor (short colCode, int armflag, int boneflag, int co if (bcolor) { char cp[3]; - if (boneflag & BONE_ACTIVE) { + if (boneflag & BONE_DRAW_ACTIVE) { VECCOPY(cp, bcolor->active); cp_shade_color3ub(cp, 10); } @@ -267,7 +267,7 @@ static short set_pchan_glColor (short colCode, int armflag, int boneflag, int co glColor3ub(cp[0], cp[1], cp[2]); } else { - if (boneflag & BONE_ACTIVE) UI_ThemeColorShade(TH_BONE_POSE, 10); + if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorShade(TH_BONE_POSE, 10); else if (boneflag & BONE_SELECTED) UI_ThemeColorShade(TH_BONE_POSE, -30); else UI_ThemeColorShade(TH_BONE_SOLID, -30); } @@ -1151,7 +1151,7 @@ static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsign } else if (armflag & ARM_EDITMODE) { if (dt==OB_WIRE) { - if (boneflag & BONE_ACTIVE) UI_ThemeColor(TH_EDGE_SELECT); + if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColor(TH_EDGE_SELECT); else if (boneflag & BONE_SELECTED) UI_ThemeColorShade(TH_EDGE_SELECT, -20); else UI_ThemeColor(TH_WIRE); } @@ -1236,7 +1236,7 @@ static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned if (dt <= OB_WIRE) { /* colors */ if (armflag & ARM_EDITMODE) { - if (boneflag & BONE_ACTIVE) UI_ThemeColor(TH_EDGE_SELECT); + if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColor(TH_EDGE_SELECT); else if (boneflag & BONE_SELECTED) UI_ThemeColorShade(TH_EDGE_SELECT, -20); else UI_ThemeColor(TH_WIRE); } @@ -1629,7 +1629,10 @@ static void draw_pose_channels(Scene *scene, View3D *v3d, ARegion *ar, Base *bas flag= bone->flag; if ( (bone->parent) && (bone->parent->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG)) ) flag &= ~BONE_CONNECTED; - + + if(bone==arm->act_bone) + flag |= BONE_DRAW_ACTIVE; + /* set color-set to use */ set_pchan_colorset(ob, pchan); |