View3D: Fix object without bounds displaying bounding boxes

This commit is contained in:
Clément Foucault 2019-03-11 14:16:51 +01:00
parent 0142c825b5
commit 9f4ec02bb4
1 changed files with 6 additions and 4 deletions

View File

@ -3109,7 +3109,9 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
DRW_shgroup_forcefield(sgl, ob, view_layer);
}
if (ob->dt == OB_BOUNDBOX) {
if ((ob->dt == OB_BOUNDBOX) &&
!ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_EMPTY, OB_SPEAKER, OB_LIGHTPROBE))
{
if (theme_id == TH_UNDEFINED) {
theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL);
}
@ -3148,9 +3150,9 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
}
/* Don't draw bounding box again if draw type is bound box. */
if ((ob->type == OB_EMPTY) &&
(ob->dtx & OB_DRAWBOUNDOX) &&
(ob->dt != OB_BOUNDBOX))
if ((ob->dtx & OB_DRAWBOUNDOX) &&
(ob->dt != OB_BOUNDBOX) &&
!ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_EMPTY, OB_SPEAKER, OB_LIGHTPROBE))
{
DRW_shgroup_bounds(sgl, ob, theme_id);
}