diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-03-22 17:27:24 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-03-22 17:27:24 +0400 |
commit | bdebaf0fb49ff05750b283bbd92d21bb57127a19 (patch) | |
tree | 0e9e1645a983364e15cbc0abb9b3c910c0edf2b9 /source/blender/editors | |
parent | 44eb9cc2721463ee302dc3a74d45092bd10c12ac (diff) |
Fix [#30614] (some Display settings are uneeded for non-geometry/material object types, and armature have no boundbox).
This commit:
* Removes the Wire and Color options from the UI for all object types but meshes, curves/surfaces/texts, and metas.
* Adds a basic bounding box drawing (and computing) for armatures.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 82dca500737..f18ee9220a9 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -56,6 +56,7 @@ #include "BLI_utildefines.h" #include "BKE_anim.h" //for the where_on_path function +#include "BKE_armature.h" #include "BKE_camera.h" #include "BKE_constraint.h" // for the get_constraint_target function #include "BKE_curve.h" @@ -6134,6 +6135,9 @@ static void draw_bounding_volume(Scene *scene, Object *ob, char type) } } } + else if (ob->type == OB_ARMATURE) { + bb = BKE_armature_get_bb(ob); + } else { drawcube(); return; @@ -6715,10 +6719,20 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } break; case OB_ARMATURE: - if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { - if (dt>OB_WIRE) GPU_enable_material(0, NULL); // we use default material - empty_object= draw_armature(scene, v3d, ar, base, dt, flag, FALSE); - if (dt>OB_WIRE) GPU_disable_material(); + if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) { + /* Do not allow boundbox in edit nor pose mode! */ + if ((dt == OB_BOUNDBOX) && (ob->mode & (OB_MODE_EDIT | OB_MODE_POSE))) + dt = OB_WIRE; + if (dt == OB_BOUNDBOX) { + draw_bounding_volume(scene, ob, ob->boundtype); + } + else { + if (dt>OB_WIRE) + GPU_enable_material(0, NULL); /* we use default material */ + empty_object = draw_armature(scene, v3d, ar, base, dt, flag, FALSE); + if (dt>OB_WIRE) + GPU_disable_material(); + } } break; default: |