[Bf-extensions-cvs] [86e03ba4] master: POV: fix specular ui panel

Maurice Raybaud noreply at git.blender.org
Sun Dec 22 00:30:36 CET 2019


Commit: 86e03ba498290f2f6b9ae7a29defc2b290232260
Author: Maurice Raybaud
Date:   Sun Dec 22 00:30:28 2019 +0100
Branches: master
https://developer.blender.org/rBA86e03ba498290f2f6b9ae7a29defc2b290232260

POV: fix specular ui panel 

add back specular buttons removed since 2.8

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

M	render_povray/ui.py

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

diff --git a/render_povray/ui.py b/render_povray/ui.py
index b2194375..dcf84757 100644
--- a/render_povray/ui.py
+++ b/render_povray/ui.py
@@ -1750,6 +1750,62 @@ class MATERIAL_PT_POV_active_node(MaterialButtonsPanel, Panel):
                 else:
                     layout.label(text="No active nodes!")
 
+class MATERIAL_PT_POV_specular(MaterialButtonsPanel, Panel):
+    """Use this class to define standard material specularity (highlights) buttons."""
+
+    bl_label = "Specular"
+    COMPAT_ENGINES = {'POVRAY_RENDER'}
+
+    @classmethod
+    def poll(cls, context):
+        mat = context.material
+        engine = context.scene.render.engine
+        return (
+            check_material(mat)
+            and (mat.pov.type in {'SURFACE', 'WIRE'})
+            and (engine in cls.COMPAT_ENGINES)
+        )
+    def draw(self, context):
+        layout = self.layout
+
+        mat = context.material.pov
+
+        layout.active = (not mat.use_shadeless)
+
+        split = layout.split()
+
+        col = split.column()
+        col.prop(mat, "specular_color", text="")
+        col.prop(mat, "specular_intensity", text="Intensity")
+
+        col = split.column()
+        col.prop(mat, "specular_shader", text="")
+        col.prop(mat, "use_specular_ramp", text="Ramp")
+
+        col = layout.column()
+        if mat.specular_shader in {'COOKTORR', 'PHONG'}:
+            col.prop(mat, "specular_hardness", text="Hardness")
+        elif mat.specular_shader == 'BLINN':
+            row = col.row()
+            row.prop(mat, "specular_hardness", text="Hardness")
+            row.prop(mat, "specular_ior", text="IOR")
+        elif mat.specular_shader == 'WARDISO':
+            col.prop(mat, "specular_slope", text="Slope")
+        elif mat.specular_shader == 'TOON':
+            row = col.row()
+            row.prop(mat, "specular_toon_size", text="Size")
+            row.prop(mat, "specular_toon_smooth", text="Smooth")
+
+        if mat.use_specular_ramp:
+            layout.separator()
+            layout.template_color_ramp(mat, "specular_ramp", expand=True)
+            layout.separator()
+
+            row = layout.row()
+            row.prop(mat, "specular_ramp_input", text="Input")
+            row.prop(mat, "specular_ramp_blend", text="Blend")
+
+            layout.prop(mat, "specular_ramp_factor", text="Factor")
 
 class MATERIAL_PT_POV_mirror(MaterialButtonsPanel, Panel):
     """Use this class to define standard material reflectivity (mirror) buttons."""
@@ -4138,6 +4194,7 @@ classes = (
     MATERIAL_PT_strand,
     MATERIAL_PT_POV_activate_node,
     MATERIAL_PT_POV_active_node,
+    MATERIAL_PT_POV_specular,
     MATERIAL_PT_POV_mirror,
     MATERIAL_PT_POV_transp,
     MATERIAL_PT_POV_reflection,



More information about the Bf-extensions-cvs mailing list