[Bf-blender-cvs] [eb0fcd4574a] blender2.8: Generic Viewport Panel for Materials

Jeroen Bakker noreply at git.blender.org
Wed May 30 19:59:04 CEST 2018


Commit: eb0fcd4574aaac732045058dce71a17f6900384c
Author: Jeroen Bakker
Date:   Wed May 30 19:53:46 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBeb0fcd4574aaac732045058dce71a17f6900384c

Generic Viewport Panel for Materials

Is enabled for all render engines as workbench will be rendering
SOLID/Texture modes and uses these settings.

===================================================================

M	intern/cycles/blender/addon/ui.py
M	release/scripts/startup/bl_ui/properties_material.py

===================================================================

diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 0d9c6166566..032b3e9573d 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1253,31 +1253,6 @@ class CYCLES_MATERIAL_PT_settings(CyclesButtonsPanel, Panel):
         col.prop(mat, "pass_index")
 
 
-class CYCLES_MATERIAL_PT_viewport(CyclesButtonsPanel, Panel):
-    bl_label = "Viewport"
-    bl_context = "material"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(cls, context):
-        return context.material and CyclesButtonsPanel.poll(context)
-
-    def draw(self, context):
-        mat = context.material
-
-        layout = self.layout
-        split = layout.split()
-
-        col = split.column(align=True)
-        col.label("Color:")
-        col.prop(mat, "diffuse_color", text="")
-        col.prop(mat, "alpha")
-
-        col = split.column(align=True)
-        col.label("Specular:")
-        col.prop(mat, "specular_color", text="")
-
-
 class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
     bl_label = "Bake"
     bl_context = "render"
@@ -1563,7 +1538,6 @@ classes = (
     CYCLES_MATERIAL_PT_volume,
     CYCLES_MATERIAL_PT_displacement,
     CYCLES_MATERIAL_PT_settings,
-    CYCLES_MATERIAL_PT_viewport,
     CYCLES_RENDER_PT_bake,
     CYCLES_RENDER_PT_debug,
     CYCLES_SCENE_PT_simplify,
diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py
index 9b70c8f22d4..56e87f3799e 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -215,6 +215,25 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
         row.prop(mat, "use_sss_translucency")
 
 
+class MATERIAL_PT_viewport(MaterialButtonsPanel, Panel):
+    bl_label = "Viewport"
+    bl_context = "material"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        return context.material
+
+    def draw(self, context):
+        mat = context.material
+
+        layout = self.layout
+        split = layout.split()
+
+        col = split.column(align=True)
+        col.prop(mat, "diffuse_color")
+
+
 classes = (
     MATERIAL_MT_specials,
     MATERIAL_UL_matslots,
@@ -223,8 +242,10 @@ classes = (
     EEVEE_MATERIAL_PT_context_material,
     EEVEE_MATERIAL_PT_surface,
     EEVEE_MATERIAL_PT_options,
+    MATERIAL_PT_viewport,
 )
 
+
 if __name__ == "__main__":  # only for live edit.
     from bpy.utils import register_class
     for cls in classes:



More information about the Bf-blender-cvs mailing list