diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 9aebb4427d2..4f1d001b2f3 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -5684,13 +5684,14 @@ class VIEW3D_PT_object_type_visibility(Panel): bl_label = "View Object Types" bl_ui_units_x = 7 - def draw(self, context): + # Allows derived classes to pass view data other than context.space_data. + # This is used by the official VR add-on, which passes XrSessionSettings + # since VR has a 3D view that only exists for the duration of the VR session. + def draw_ex(self, context, view, show_select): layout = self.layout layout.use_property_split = True layout.use_property_decorate = False - view = context.space_data - layout.label(text="Object Types Visibility") layout.separator() col = layout.column() @@ -5728,19 +5729,25 @@ class VIEW3D_PT_object_type_visibility(Panel): continue attr_v = "show_object_viewport_" + attr - attr_s = "show_object_select_" + attr - icon_v = 'HIDE_OFF' if getattr(view, attr_v) else 'HIDE_ON' - icon_s = 'RESTRICT_SELECT_OFF' if getattr(view, attr_s) else 'RESTRICT_SELECT_ON' row = col.row(align=True) row.alignment = 'RIGHT' row.label(text=attr_name) row.prop(view, attr_v, text="", icon=icon_v, emboss=False) - rowsub = row.row(align=True) - rowsub.active = getattr(view, attr_v) - rowsub.prop(view, attr_s, text="", icon=icon_s, emboss=False) + + if show_select: + attr_s = "show_object_select_" + attr + icon_s = 'RESTRICT_SELECT_OFF' if getattr(view, attr_s) else 'RESTRICT_SELECT_ON' + + rowsub = row.row(align=True) + rowsub.active = getattr(view, attr_v) + rowsub.prop(view, attr_s, text="", icon=icon_s, emboss=False) + + def draw(self, context): + view = context.space_data + self.draw_ex(context, view, True) class VIEW3D_PT_shading(Panel): |