diff options
author | Julian Eisel <julian@blender.org> | 2020-03-13 14:29:37 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-03-13 14:29:37 +0300 |
commit | 2c4399701297bff9ff1a8ee0d0ffd3f28e5520fe (patch) | |
tree | 2986f6bc12c7c66ea441aa392693779ab2ff0439 | |
parent | 329bc262c8be4927ed378924f09af06369bbe418 (diff) |
Update to use new 3D View Shading layout utilities
-rw-r--r-- | viewport_vr_preview.py | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/viewport_vr_preview.py b/viewport_vr_preview.py index b155ae84..4849b38c 100644 --- a/viewport_vr_preview.py +++ b/viewport_vr_preview.py @@ -23,16 +23,18 @@ from bpy.types import ( Gizmo, GizmoGroup, ) -from bpy.props import( +from bpy.props import ( CollectionProperty, IntProperty, BoolProperty, ) from bpy.app.handlers import persistent -from bl_ui.space_view3d import ( - VIEW3D_PT_shading_lighting, - VIEW3D_PT_shading_color, - VIEW3D_PT_shading_options, +from bl_ui.utils import ( + View3DShadingLayout, + View3DShadingLightingLayout, + View3DShadingColorLayout, + View3DShadingOptionsLayout, + View3DShadingRenderPassLayout ) bl_info = { @@ -356,7 +358,7 @@ class VIEW3D_PT_vr_session_shading(bpy.types.Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_category = "VR" - bl_label = "Shading" + bl_label = View3DShadingLayout.bl_label def draw(self, context): layout = self.layout @@ -370,48 +372,63 @@ class VIEW3D_PT_vr_session_shading_lighting(bpy.types.Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_category = "VR" - bl_label = VIEW3D_PT_shading_lighting.bl_label + bl_label = View3DShadingLightingLayout.bl_label bl_parent_id = "VIEW3D_PT_vr_session_shading" bl_options = {'DEFAULT_CLOSED'} + @classmethod + def poll(cls, context): + session_settings = context.window_manager.xr_session_settings + shading = session_settings.shading + return View3DShadingLightingLayout.poll(context, shading) + def draw(self, context): session_settings = context.window_manager.xr_session_settings shading = session_settings.shading - if VIEW3D_PT_shading_lighting.poll_ex(context, shading): - VIEW3D_PT_shading_lighting.draw_ex(self, context, shading) + View3DShadingLightingLayout.draw(context, shading, self.layout) class VIEW3D_PT_vr_session_shading_color(bpy.types.Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_category = "VR" - bl_label = VIEW3D_PT_shading_color.bl_label + bl_label = View3DShadingColorLayout.bl_label bl_parent_id = "VIEW3D_PT_vr_session_shading" bl_options = {'DEFAULT_CLOSED'} + @classmethod + def poll(cls, context): + session_settings = context.window_manager.xr_session_settings + shading = session_settings.shading + return View3DShadingColorLayout.poll(context, shading) + def draw(self, context): session_settings = context.window_manager.xr_session_settings shading = session_settings.shading - if VIEW3D_PT_shading_color.poll_ex(context, shading): - VIEW3D_PT_shading_color.draw_ex(self, context, shading) + View3DShadingColorLayout.draw(context, shading, self.layout) class VIEW3D_PT_vr_session_shading_options(bpy.types.Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_category = "VR" - bl_label = VIEW3D_PT_shading_options.bl_label + bl_label = View3DShadingOptionsLayout.bl_label bl_parent_id = "VIEW3D_PT_vr_session_shading" bl_options = {'DEFAULT_CLOSED'} + @classmethod + def poll(cls, context): + session_settings = context.window_manager.xr_session_settings + shading = session_settings.shading + return View3DShadingOptionsLayout.poll(context, shading) + def draw(self, context): session_settings = context.window_manager.xr_session_settings shading = session_settings.shading - if VIEW3D_PT_shading_options.poll_ex(context, shading): - VIEW3D_PT_shading_options.draw_ex(self, context, shading) + View3DShadingOptionsLayout.draw(context, shading, self.layout) class VIEW3D_PT_vr_viewport_feedback(bpy.types.Panel): |