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:
authorClément Foucault <foucault.clem@gmail.com>2018-10-17 19:08:00 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-10-17 19:09:37 +0300
commit91e5e02aff46100f9d1172e98768c42db8e70bb6 (patch)
treec773741916e4d676268a94e4d451560544374414 /source/blender/draw
parente5b18390fa591c8b37b9ef9884611b2888bab188 (diff)
ObjectMode: Fix instances with BoundBox drawtype not displaying
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/modes/object_mode.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 222a5977665..57373678a6a 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -2802,6 +2802,13 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
DRW_shgroup_forcefield(sgl, ob, view_layer);
}
+ if (ob->dt == OB_BOUNDBOX) {
+ if (theme_id == TH_UNDEFINED) {
+ theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL);
+ }
+ DRW_shgroup_bounds(sgl, ob, theme_id);
+ }
+
/* don't show object extras in set's */
if ((ob->base_flag & (BASE_FROM_SET | BASE_FROMDUPLI)) == 0) {
if ((draw_ctx->object_mode & (OB_MODE_ALL_PAINT | OB_MODE_ALL_PAINT_GPENCIL)) == 0) {
@@ -2812,7 +2819,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
DRW_shgroup_relationship_lines(sgl, draw_ctx->depsgraph, scene, ob);
}
- const bool draw_extra = (ob->dtx != 0 || ob->dt == OB_BOUNDBOX);
+ const bool draw_extra = (ob->dtx != 0);
if (draw_extra && (theme_id == TH_UNDEFINED)) {
theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL);
}
@@ -2833,7 +2840,8 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
DRW_shgroup_texture_space(sgl, ob, theme_id);
}
- if (ob->dtx & OB_DRAWBOUNDOX || ob->dt == OB_BOUNDBOX) {
+ /* Don't draw bounding box again if draw type is bound box. */
+ if (ob->dtx & OB_DRAWBOUNDOX && ob->dt != OB_BOUNDBOX) {
DRW_shgroup_bounds(sgl, ob, theme_id);
}