diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2021-05-21 17:51:37 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2021-08-10 18:30:43 +0300 |
commit | 6806459246255440aade69bc0e00a40325dfd95c (patch) | |
tree | 26d1bfa545d6f0f17a1a7d03885988a5614bd67c /release | |
parent | b6538e1492bfc03bf5e06c25002f4626a62590b5 (diff) |
UI: hide Viewport Display Bounds for object types that dont have
bounding boxes
These are namely 'LIGHT', 'CAMERA', 'EMPTY', 'SPEAKER' and 'LIGHTPROBE'.
Note that Empties are included here despite the fact that they have
instancing capabilities ('Display As' can be 'Bounds' for example which
then displays all instanced geometry with boundingboxes -- this however
is not meant to work with the 'Bounds' checkbox and the display bounds
type, these are only affective for the object itself, not its instances)
Issue came up in T88443.
Maniphest Tasks: T88443
Differential Revision: https://developer.blender.org/D11344
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_object.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index e93b0b0d0a1..52af4fafd09 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -216,6 +216,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel): obj = context.object obj_type = obj.type is_geometry = (obj_type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT', 'VOLUME', 'HAIR', 'POINTCLOUD'}) + has_bounds = (is_geometry or obj_type in {'LATTICE', 'ARMATURE'}) is_wire = (obj_type in {'CAMERA', 'EMPTY'}) is_empty_image = (obj_type == 'EMPTY' and obj.empty_display_type == 'IMAGE') is_dupli = (obj.instance_type != 'NONE') @@ -247,15 +248,16 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel): # Only useful with object having faces/materials... col.prop(obj, "color") - col = layout.column(align=False, heading="Bounds") - col.use_property_decorate = False - row = col.row(align=True) - sub = row.row(align=True) - sub.prop(obj, "show_bounds", text="") - sub = sub.row(align=True) - sub.active = obj.show_bounds or (obj.display_type == 'BOUNDS') - sub.prop(obj, "display_bounds_type", text="") - row.prop_decorator(obj, "display_bounds_type") + if has_bounds: + col = layout.column(align=False, heading="Bounds") + col.use_property_decorate = False + row = col.row(align=True) + sub = row.row(align=True) + sub.prop(obj, "show_bounds", text="") + sub = sub.row(align=True) + sub.active = obj.show_bounds or (obj.display_type == 'BOUNDS') + sub.prop(obj, "display_bounds_type", text="") + row.prop_decorator(obj, "display_bounds_type") class OBJECT_PT_instancing(ObjectButtonsPanel, Panel): |