diff options
author | Maurice Raybaud <mauriceraybaud@hotmail.fr> | 2019-04-27 21:12:29 +0300 |
---|---|---|
committer | Maurice Raybaud <mauriceraybaud@hotmail.fr> | 2019-04-27 21:12:29 +0300 |
commit | 573847caa34747a163d15b0410025d6bcda02663 (patch) | |
tree | 5752e4076faf70684d585144f2361ff7a0063819 /render_povray/ui.py | |
parent | 18661f8ee717dc156181453353ed43b3ec6d9f53 (diff) |
Pass 5 of 2.8 syntax update...
Diffstat (limited to 'render_povray/ui.py')
-rw-r--r-- | render_povray/ui.py | 63 |
1 files changed, 46 insertions, 17 deletions
diff --git a/render_povray/ui.py b/render_povray/ui.py index ce282134..cfb0051c 100644 --- a/render_povray/ui.py +++ b/render_povray/ui.py @@ -104,10 +104,10 @@ class AddPresetWorld(AddPresetBase, bpy.types.Operator): preset_subdir = "pov/world" -classes = ( - POV_WORLD_MT_presets, - AddPresetWorld, - ) +# classes = ( + # POV_WORLD_MT_presets, + # AddPresetWorld, + # ) # Example of wrapping every class 'as is' from bl_ui import properties_texture @@ -558,7 +558,7 @@ class AddPresetLamp(AddPresetBase, bpy.types.Operator): -# Draw into an existing panel +# Draw into the existing light panel def light_panel_func(self, context): layout = self.layout @@ -568,10 +568,10 @@ def light_panel_func(self, context): row.operator(AddPresetLamp.bl_idname, text="", icon='REMOVE').remove_active = True -classes = ( - POV_LIGHT_MT_presets, - AddPresetLamp, - ) +# classes = ( + # POV_LIGHT_MT_presets, + # AddPresetLamp, + # ) '''#TORECREATE##DEPRECATED# class LIGHT_PT_POV_sunsky(PovLampButtonsPanel, bpy.types.Panel): bl_label = properties_data_light.DATA_PT_sunsky.bl_label @@ -1001,10 +1001,10 @@ def rad_panel_func(self, context): row.operator(AddPresetRadiosity.bl_idname, text="", icon='REMOVE').remove_active = True -classes = ( - POV_RADIOSITY_MT_presets, - AddPresetRadiosity, - ) +# classes = ( + # POV_RADIOSITY_MT_presets, + # AddPresetRadiosity, + # ) class RENDER_PT_povray_media(WorldButtonsPanel, bpy.types.Panel): @@ -1085,6 +1085,33 @@ class MODIFIERS_PT_povray_modifiers(ModifierButtonsPanel, bpy.types.Panel): # Inside Vector for CSG col.prop(ob.pov, "inside_vector") +class MATERIAL_MT_POV_sss_presets(bpy.types.Menu): + bl_label = "SSS Presets" + preset_subdir = "pov/material/sss" + preset_operator = "script.execute_preset" + draw = bpy.types.Menu.draw_preset + +class AddPresetSSS(AddPresetBase, bpy.types.Operator): + '''Add an SSS Preset''' + bl_idname = "material.sss_preset_add" + bl_label = "Add SSS Preset" + preset_menu = "MATERIAL_MT_POV_sss_presets" + + # variable used for all preset values + preset_defines = [ + "material = bpy.context.material" + ] + + # properties to store in the preset + preset_values = [ + "material.pov_subsurface_scattering.radius", + "material.pov_subsurface_scattering.color", + ] + + # where to store the preset + preset_subdir = "pov/material/sss" + + class MATERIAL_PT_POV_sss(MaterialButtonsPanel, bpy.types.Panel): bl_label = "Subsurface Scattering" bl_options = {'DEFAULT_CLOSED'} @@ -1112,10 +1139,10 @@ class MATERIAL_PT_POV_sss(MaterialButtonsPanel, bpy.types.Panel): layout.active = (sss.use) and (not mat.pov.use_shadeless) row = layout.row().split() - sub = row.row(align=True).split(align=True, percentage=0.75) - sub.menu("MATERIAL_MT_sss_presets", text=bpy.types.MATERIAL_MT_sss_presets.bl_label) - sub.operator("material.sss_preset_add", text="", icon='ADD') - sub.operator("material.sss_preset_add", text="", icon='REMOVE').remove_active = True + sub = row.row(align=True).split(align=True, factor=0.75) + sub.menu("MATERIAL_MT_POV_sss_presets", text=MATERIAL_MT_POV_sss_presets.bl_label) + sub.operator("AddPresetSSS.bl_idname", text="", icon='ADD') + sub.operator("AddPresetSSS.bl_idname", text="", icon='REMOVE').remove_active = True split = layout.split() @@ -2367,6 +2394,8 @@ classes = ( RENDER_PT_povray_media, MODIFIERS_PT_povray_modifiers, MATERIAL_PT_POV_sss, + MATERIAL_MT_POV_sss_presets, + AddPresetSSS, MATERIAL_PT_povray_activate_node, MATERIAL_PT_povray_active_node, MATERIAL_PT_POV_mirror, |