[Bf-blender-cvs] [5d0a3d3c9ce] blender2.8: UI: Dynamic Paint single column and sub panels

William Reynish noreply at git.blender.org
Wed Jul 25 15:57:59 CEST 2018


Commit: 5d0a3d3c9ce326ba0f90d43d8215b755418aa081
Author: William Reynish
Date:   Wed Jul 25 15:57:30 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB5d0a3d3c9ce326ba0f90d43d8215b755418aa081

UI: Dynamic Paint single column and sub panels

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

M	release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py

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

diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
index 611f477a31b..44d07ff53e6 100644
--- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
+++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
@@ -87,24 +87,22 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
                 col.operator("dpaint.surface_slot_add", icon='ZOOMIN', text="")
                 col.operator("dpaint.surface_slot_remove", icon='ZOOMOUT', text="")
 
+                layout.use_property_split = True
+
                 if surface:
                     layout.prop(surface, "surface_format")
 
                     col = layout.column()
                     if surface.surface_format != 'VERTEX':
-                        col.label(text="Quality:")
                         col.prop(surface, "image_resolution")
                     col.prop(surface, "use_antialiasing")
 
-                    col = layout.column()
-                    col.label(text="Frames:")
-                    split = col.split()
 
-                    col = split.column(align=True)
-                    col.prop(surface, "frame_start", text="Start")
-                    col.prop(surface, "frame_end", text="End")
+                    sub = col.column(align=True)
+                    sub.prop(surface, "frame_start", text="Frame Start")
+                    sub.prop(surface, "frame_end", text="End")
 
-                    split.prop(surface, "frame_substeps")
+                    col.prop(surface, "frame_substeps")
 
         elif md.ui_type == 'BRUSH':
             brush = md.brush_settings
@@ -114,16 +112,14 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
             else:
                 layout.operator("dpaint.type_toggle", text="Remove Brush", icon='X').type = 'BRUSH'
 
-                split = layout.split()
+                layout.use_property_split = True
 
-                col = split.column()
+                col = layout.column()
+                col.prop(brush, "paint_color")
+                col.prop(brush, "paint_alpha", text="Alpha", slider=True)
+                col.prop(brush, "paint_wetness", text="Wetness", slider=True)
                 col.prop(brush, "use_absolute_alpha")
                 col.prop(brush, "use_paint_erase")
-                col.prop(brush, "paint_wetness", text="Wetness")
-
-                col = split.column()
-                col.prop(brush, "paint_color", text="")
-                col.prop(brush, "paint_alpha", text="Alpha")
 
 
 class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel):
@@ -141,65 +137,113 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel):
 
         canvas = context.dynamic_paint.canvas_settings
         surface = canvas.canvas_surfaces.active
-
         surface_type = surface.surface_type
 
+        layout.use_property_split = True
+
         layout.prop(surface, "surface_type")
+
         layout.separator()
 
-        # dissolve
-        if surface_type == 'PAINT':
-            split = layout.split(percentage=0.35)
-            split.prop(surface, "use_drying", text="Dry:")
-
-            col = split.column()
-            col.active = surface.use_drying
-            split = col.split(percentage=0.7)
-            col = split.column(align=True)
-            col.prop(surface, "dry_speed", text="Time")
-            col.prop(surface, "color_dry_threshold")
-            split.prop(surface, "use_dry_log", text="Slow")
-
-        if surface_type != 'WAVE':
-            split = layout.split(percentage=0.35)
-            col = split.column()
-            if surface_type == 'WEIGHT':
-                col.prop(surface, "use_dissolve", text="Fade:")
-            else:
-                col.prop(surface, "use_dissolve", text="Dissolve:")
-            col = split.column()
-            col.active = surface.use_dissolve
-            split = col.split(percentage=0.7)
-            split.prop(surface, "dissolve_speed", text="Time")
-            split.prop(surface, "use_dissolve_log", text="Slow")
+        col = layout.column()
 
         # per type settings
         if surface_type == 'DISPLACE':
-            layout.prop(surface, "use_incremental_displace")
+            col.prop(surface, "use_incremental_displace")
             if surface.surface_format == 'VERTEX':
-                row = layout.row()
-                row.prop(surface, "depth_clamp")
-                row.prop(surface, "displace_factor")
-
-        elif surface_type == 'WAVE':
-            layout.prop(surface, "use_wave_open_border")
+                col.prop(surface, "depth_clamp")
+                col.prop(surface, "displace_factor")
 
-            split = layout.split()
+            col.separator()
 
-            col = split.column(align=True)
+        elif surface_type == 'WAVE':
+            col.prop(surface, "use_wave_open_border")
             col.prop(surface, "wave_timescale")
             col.prop(surface, "wave_speed")
-
-            col = split.column(align=True)
             col.prop(surface, "wave_damping")
             col.prop(surface, "wave_spring")
             col.prop(surface, "wave_smoothness")
 
-        layout.separator()
-        layout.prop(surface, "brush_group")
-        row = layout.row()
-        row.prop(surface, "brush_influence_scale")
-        row.prop(surface, "brush_radius_scale")
+            col.separator()
+
+        col.prop(surface, "brush_group")
+        col.prop(surface, "brush_influence_scale")
+        col.prop(surface, "brush_radius_scale")
+
+
+class PHYSICS_PT_dp_advanced_canvas_paint_dry(PhysicButtonsPanel, Panel):
+    bl_label = "Dry"
+    bl_parent_id = "PHYSICS_PT_dp_advanced_canvas"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    @classmethod
+    def poll(cls, context):
+        md = context.dynamic_paint
+        canvas = context.dynamic_paint.canvas_settings
+        surface = canvas.canvas_surfaces.active
+        surface_type = surface.surface_type
+
+        return md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active and surface_type == 'PAINT' and context.engine in cls.COMPAT_ENGINES
+
+    def draw_header(self, context):
+        canvas = context.dynamic_paint.canvas_settings
+        surface = canvas.canvas_surfaces.active
+        self.layout.prop(surface, "use_drying", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        canvas = context.dynamic_paint.canvas_settings
+        surface = canvas.canvas_surfaces.active
+        surface_type = surface.surface_type
+
+        layout.use_property_split = True
+
+        layout.active = surface.use_drying
+
+        col = layout.column()
+        col.prop(surface, "dry_speed", text="Time")
+        col.prop(surface, "color_dry_threshold")
+        col.prop(surface, "use_dry_log", text="Slow")
+
+
+class PHYSICS_PT_dp_advanced_canvas_paint_dissolve(PhysicButtonsPanel, Panel):
+    bl_label = "Dissolve"
+    bl_parent_id = "PHYSICS_PT_dp_advanced_canvas"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    @classmethod
+    def poll(cls, context):
+        md = context.dynamic_paint
+        canvas = context.dynamic_paint.canvas_settings
+        surface = canvas.canvas_surfaces.active
+        surface_type = surface.surface_type
+
+        return md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active and surface_type != 'WAVE' and context.engine in cls.COMPAT_ENGINES
+
+    def draw_header(self, context):
+        canvas = context.dynamic_paint.canvas_settings
+        surface = canvas.canvas_surfaces.active
+        self.layout.prop(surface, "use_dissolve", text="")
+
+
+    def draw(self, context):
+        layout = self.layout
+
+        canvas = context.dynamic_paint.canvas_settings
+        surface = canvas.canvas_surfaces.active
+        surface_type = surface.surface_type
+
+        layout.use_property_split = True
+
+        layout.active = surface.use_dissolve
+
+        col = layout.column()
+
+        col.prop(surface, "dissolve_speed", text="Time")
+        col.prop(surface, "use_dissolve_log", text="Slow")
 
 
 class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel):
@@ -220,6 +264,7 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        layout.use_property_split = True
 
         canvas = context.dynamic_paint.canvas_settings
         surface = canvas.canvas_surfaces.active
@@ -317,6 +362,8 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel):
         surface = canvas.canvas_surfaces.active
         ob = context.object
 
+        layout.use_property_split = True
+
         layout.prop(surface, "init_color_type", expand=False)
         if surface.init_color_type != 'NONE':
             layout.separator()
@@ -350,37 +397,86 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel):
     def draw(self, context):
         layout = self.layout
 
+
+
+class PHYSICS_PT_dp_effects_spread(PhysicButtonsPanel, Panel):
+    bl_label = "Spread"
+    bl_parent_id = "PHYSICS_PT_dp_effects"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    def draw_header(self, context):
         canvas = context.dynamic_paint.canvas_settings
         surface = canvas.canvas_surfaces.active
 
-        layout.row().prop(surface, "effect_ui", expand=True)
+        self.layout.prop(surface, "use_spread", text="")
 
-        if surface.effect_ui == 'SPREAD':
-            layout.prop(surface, "use_spread")
+    def draw(self, context):
+        layout = self.layout
 
-            row = layout.row()
-            row.active = surface.use_spread
-            row.prop(surface, "spread_speed")
-            row.prop(surface, "color_spread_speed")
+        layout.use_property_split = True
 
-        elif surface.effect_ui == 'DRIP':
-            layout.prop(surface, "use_drip")
+        canvas = context.dynamic_paint.canvas_setti

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list