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:
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py29
1 files changed, 17 insertions, 12 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 2c1ee3c5338..e8c640721c8 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3748,6 +3748,15 @@ class VIEW3D_PT_shading(Panel):
bl_label = "Shading"
bl_ui_units_x = 11
+ @classmethod
+ def get_shading(cls, context):
+ # Get settings from 3D viewport or OpenGL render engine
+ view = context.space_data
+ if view.type == 'VIEW_3D':
+ return view.shading
+ else:
+ return context.scene.display.shading
+
def draw(self, context):
pass
@@ -3760,9 +3769,7 @@ class VIEW3D_PT_shading_lighting(Panel):
def draw(self, context):
layout = self.layout
-
- view = context.space_data
- shading = view.shading
+ shading = VIEW3D_PT_shading.get_shading(context)
col = layout.column()
split = col.split(0.9)
@@ -3824,15 +3831,13 @@ class VIEW3D_PT_shading_color(Panel):
@classmethod
def poll(cls, context):
- view = context.space_data
- shading = view.shading
+ shading = VIEW3D_PT_shading.get_shading(context)
return shading.type == 'SOLID'
def draw(self, context):
layout = self.layout
- view = context.space_data
- shading = view.shading
+ shading = VIEW3D_PT_shading.get_shading(context)
layout.row().prop(shading, "color_type", expand=True)
@@ -3848,15 +3853,13 @@ class VIEW3D_PT_shading_options(Panel):
@classmethod
def poll(cls, context):
- view = context.space_data
- shading = view.shading
+ shading = VIEW3D_PT_shading.get_shading(context)
return shading.type == 'SOLID'
def draw(self, context):
layout = self.layout
- view = context.space_data
- shading = view.shading
+ shading = VIEW3D_PT_shading.get_shading(context)
col = layout.column()
@@ -3909,7 +3912,9 @@ class VIEW3D_PT_shading_options(Panel):
if not shading.light == 'MATCAP':
col.prop(shading, "show_specular_highlight")
- col.prop(view, "show_world")
+ view = context.space_data
+ if view.type == 'VIEW_3D':
+ col.prop(view, "show_world")
class VIEW3D_PT_shading_options_shadow(Panel):