diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-03-25 12:20:19 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-03-25 12:20:19 +0400 |
commit | 3b711a6ed009b35bb69cd0ca878eeb8d55fa0e77 (patch) | |
tree | b3fdb366cb49bdea5b57dfa6ba4a82635c68d0ee /source/blender/editors/space_view3d/drawarmature.c | |
parent | a2ebfc82dbe954acc432ae017ac62a30a11b6a16 (diff) | |
parent | e99a23fc6b33b5097eab44aac19c2a089ddebce6 (diff) |
Merged changes in the trunk up to revision 45133.
Conflicts resolved:
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_mesh_conv.c
source/blender/bmesh/intern/bmesh_mesh_conv.h
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/bmesh_select.c
source/blender/editors/mesh/bmesh_tools.c
source/blender/editors/space_view3d/drawobject.c
source/blender/render/intern/source/shadeoutput.c
Diffstat (limited to 'source/blender/editors/space_view3d/drawarmature.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 62 |
1 files changed, 42 insertions, 20 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 54dff3e4786..aae0348de20 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -170,10 +170,18 @@ static short set_pchan_glColor (short colCode, int boneflag, short constflag) glColor3ubv(cp); } else { - if (boneflag & BONE_DRAW_ACTIVE && boneflag & BONE_SELECTED) UI_ThemeColorShade(TH_BONE_POSE, 40); - else if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorBlend(TH_WIRE, TH_BONE_POSE, 0.15f); /* unselected active */ - else if (boneflag & BONE_SELECTED) UI_ThemeColor(TH_BONE_POSE); - else UI_ThemeColor(TH_WIRE); + if ((boneflag & BONE_DRAW_ACTIVE) && (boneflag & BONE_SELECTED)) { + UI_ThemeColorShade(TH_BONE_POSE, 40); + } + else if (boneflag & BONE_DRAW_ACTIVE) { + UI_ThemeColorBlend(TH_WIRE, TH_BONE_POSE, 0.15f); /* unselected active */ + } + else if (boneflag & BONE_SELECTED) { + UI_ThemeColor(TH_BONE_POSE); + } + else { + UI_ThemeColor(TH_WIRE); + } } return 1; @@ -290,10 +298,18 @@ static short set_pchan_glColor (short colCode, int boneflag, short constflag) static void set_ebone_glColor(const unsigned int boneflag) { - if (boneflag & BONE_DRAW_ACTIVE && boneflag & BONE_SELECTED) UI_ThemeColor(TH_EDGE_SELECT); - else if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, 0.15f); /* unselected active */ - else if (boneflag & BONE_SELECTED) UI_ThemeColorShade(TH_EDGE_SELECT, -20); - else UI_ThemeColor(TH_WIRE); + if ((boneflag & BONE_DRAW_ACTIVE) && (boneflag & BONE_SELECTED)) { + UI_ThemeColor(TH_EDGE_SELECT); + } + else if (boneflag & BONE_DRAW_ACTIVE) { + UI_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, 0.15f); /* unselected active */ + } + else if (boneflag & BONE_SELECTED) { + UI_ThemeColorShade(TH_EDGE_SELECT, -20); + } + else { + UI_ThemeColor(TH_WIRE); + } } /* *************** Armature drawing, helper calls for parts ******************* */ @@ -1749,16 +1765,21 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, OB_SOLID, arm->flag, flag, index, bone->length); } } - else if (arm->drawtype==ARM_LINE) - ; /* nothing in solid */ - else if (arm->drawtype==ARM_WIRE) - ; /* nothing in solid */ - else if (arm->drawtype==ARM_ENVELOPE) + else if (arm->drawtype == ARM_LINE) { + /* nothing in solid */ + } + else if (arm->drawtype == ARM_WIRE) { + /* nothing in solid */ + } + else if (arm->drawtype == ARM_ENVELOPE) { draw_sphere_bone(OB_SOLID, arm->flag, flag, 0, index, pchan, NULL); - else if (arm->drawtype==ARM_B_BONE) + } + else if (arm->drawtype == ARM_B_BONE) { draw_b_bone(OB_SOLID, arm->flag, flag, 0, index, pchan, NULL); - else + } + else { draw_bone(OB_SOLID, arm->flag, flag, 0, index, bone->length); + } glPopMatrix(); } @@ -1843,7 +1864,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, if (index != -1) index+= 0x10000; // pose bones count in higher 2 bytes only } - /* stick or wire bones have not been drawn yet so dont clear object selection in this case */ + /* stick or wire bones have not been drawn yet so don't clear object selection in this case */ if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)==0 && draw_wire) { /* object tag, for bordersel optim */ glLoadName(index & 0xFFFF); @@ -1937,8 +1958,9 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, /* set color-set to use */ set_pchan_colorset(ob, pchan); - if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM)) - ; // custom bone shapes should not be drawn here! + if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM)) { + /* custom bone shapes should not be drawn here! */ + } else if (arm->drawtype==ARM_ENVELOPE) { if (dt < OB_SOLID) draw_sphere_bone_wire(smat, imat, arm->flag, flag, constflag, index, pchan, NULL); @@ -1973,7 +1995,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, draw_pose_dofs(ob); /* finally names and axes */ - if (arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES) && is_outline == 0) { + if ((arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES)) && (is_outline == 0)) { /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */ if ((G.f & G_PICKSEL) == 0) { float vec[3]; @@ -2543,7 +2565,7 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in draw_ebones(v3d, ar, ob, dt); arm->flag &= ~ARM_EDITMODE; } - else{ + else { /* Draw Pose */ if (ob->pose && ob->pose->chanbase.first) { /* drawing posemode selection indices or colors only in these cases */ |