Fix: Dynamic Paint Image Bake button missing when using certain Surface types
authorWilliam Reynish <billrey@me.com>
Sun, 2 Jun 2019 18:24:54 +0000 (20:24 +0200)
committerWilliam Reynish <billrey@me.com>
Sun, 2 Jun 2019 18:24:54 +0000 (20:24 +0200)
This required doing a very slight UI re-org of a few properties to work reasonably.

release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py

index 4eb43695eb53717050c9fc94d745f654b7ce3f83..5dd9800347f8294f184e2c3a42d5a5ff128034c7 100644 (file)
@@ -203,8 +203,8 @@ class PHYSICS_PT_dynamic_paint_settings(PhysicButtonsPanel, Panel):
             col.prop(brush, "use_paint_erase")
 
 
-class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel):
-    bl_label = "Advanced"
+class PHYSICS_PT_dp_surface_canvas(PhysicButtonsPanel, Panel):
+    bl_label = "Surface"
     bl_parent_id = "PHYSICS_PT_dynamic_paint"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
 
@@ -265,9 +265,9 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel):
         col.prop(surface, "brush_radius_scale", text="Radius")
 
 
-class PHYSICS_PT_dp_advanced_canvas_paint_dry(PhysicButtonsPanel, Panel):
+class PHYSICS_PT_dp_surface_canvas_paint_dry(PhysicButtonsPanel, Panel):
     bl_label = "Dry"
-    bl_parent_id = "PHYSICS_PT_dp_advanced_canvas"
+    bl_parent_id = "PHYSICS_PT_dp_surface_canvas"
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
 
@@ -301,9 +301,9 @@ class PHYSICS_PT_dp_advanced_canvas_paint_dry(PhysicButtonsPanel, Panel):
         col.prop(surface, "use_dry_log", text="Slow")
 
 
-class PHYSICS_PT_dp_advanced_canvas_paint_dissolve(PhysicButtonsPanel, Panel):
+class PHYSICS_PT_dp_surface_canvas_paint_dissolve(PhysicButtonsPanel, Panel):
     bl_label = "Dissolve"
-    bl_parent_id = "PHYSICS_PT_dp_advanced_canvas"
+    bl_parent_id = "PHYSICS_PT_dp_surface_canvas"
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
 
@@ -387,7 +387,10 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel):
 
         # image format outputs.
         if surface.surface_format == 'IMAGE':
-            # layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT')
+
+            layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT')
+
+            layout.prop(surface, "image_output_path", text="Cache Path")
 
             flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
 
@@ -441,33 +444,6 @@ class PHYSICS_PT_dp_canvas_output_paintmaps(PhysicButtonsPanel, Panel):
         sub.prop(surface, "output_name_a", text="Name")
 
 
-class PHYSICS_PT_dp_canvas_output_bake(PhysicButtonsPanel, Panel):
-    bl_label = "Bake"
-    bl_parent_id = "PHYSICS_PT_dp_canvas_output"
-    bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
-
-    @classmethod
-    def poll(cls, context):
-        if not PhysicButtonsPanel.poll_dyn_output_maps(context):
-            return False
-
-        return (context.engine in cls.COMPAT_ENGINES)
-
-    def draw(self, context):
-        layout = self.layout
-
-        canvas = context.dynamic_paint.canvas_settings
-        surface = canvas.canvas_surfaces.active
-
-        row = layout.row(align=True)
-        row.alignment = 'RIGHT'
-        row.label(text="Cache Path")
-
-        layout.prop(surface, "image_output_path", text="")
-        layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT')
-
-
 class PHYSICS_PT_dp_canvas_output_wetmaps(PhysicButtonsPanel, Panel):
     bl_label = "Wetmaps"
     bl_parent_id = "PHYSICS_PT_dp_canvas_output"
@@ -905,9 +881,9 @@ classes = (
     PHYSICS_UL_dynapaint_surfaces,
     PHYSICS_PT_dynamic_paint,
     PHYSICS_PT_dynamic_paint_settings,
-    PHYSICS_PT_dp_advanced_canvas,
-    PHYSICS_PT_dp_advanced_canvas_paint_dissolve,
-    PHYSICS_PT_dp_advanced_canvas_paint_dry,
+    PHYSICS_PT_dp_surface_canvas,
+    PHYSICS_PT_dp_surface_canvas_paint_dissolve,
+    PHYSICS_PT_dp_surface_canvas_paint_dry,
     PHYSICS_PT_dp_cache,
     PHYSICS_PT_dp_effects,
     PHYSICS_PT_dp_effects_spread,
@@ -922,7 +898,6 @@ classes = (
     PHYSICS_PT_dp_brush_velocity_smudge,
     PHYSICS_PT_dp_brush_wave,
     PHYSICS_PT_dp_canvas_output,
-    PHYSICS_PT_dp_canvas_output_bake,
     PHYSICS_PT_dp_canvas_output_paintmaps,
     PHYSICS_PT_dp_canvas_output_wetmaps,
 )