diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-02-14 14:26:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-02-14 14:29:45 +0300 |
commit | cfa1fd1c1f72411bbb79668f1f00425d6ed75964 (patch) | |
tree | 1a0ea1cdae9355f200dcf3b99e4b92a8511f80c6 /source/blender | |
parent | dd6edac8037a6b999cf1f41fdcdc93f2531a7155 (diff) |
object drawing: only use halo-draw in object mode
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 01a70d36eda..250d8c6278e 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3675,6 +3675,12 @@ static void draw_mesh_object_outline(View3D *v3d, Object *ob, DerivedMesh *dm) } } +static bool object_is_halo(Scene *scene, Object *ob) +{ + const Material *ma = give_current_material(ob, 1); + return (ma && (ma->material_type == MA_TYPE_HALO) && !BKE_scene_use_new_shading_nodes(scene)); +} + static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, Base *base, const char dt, const unsigned char ob_wire_col[4], const short dflag) { @@ -3684,8 +3690,6 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D Object *ob = base->object; #endif Mesh *me = ob->data; - Material *ma = give_current_material(ob, 1); - const bool hasHaloMat = (ma && (ma->material_type == MA_TYPE_HALO) && !BKE_scene_use_new_shading_nodes(scene)); eWireDrawMode draw_wire = OBDRAW_WIRE_OFF; int /* totvert,*/ totedge, totface; DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask); @@ -3721,7 +3725,9 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D if (((v3d->flag2 & V3D_RENDER_OVERRIDE) && v3d->drawtype >= OB_WIRE) == 0) draw_bounding_volume(ob, ob->boundtype); } - else if (hasHaloMat || (totface == 0 && totedge == 0)) { + else if ((totface == 0 && totedge == 0) || + ((!is_obact || (ob->mode == OB_MODE_OBJECT)) && object_is_halo(scene, ob))) + { glPointSize(1.5); dm->drawVerts(dm); glPointSize(1.0); |