[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37548] branches/soc-2011-carrot: Dynamic Paint:

Miika Hämäläinen miika.hamalainen at kolumbus.fi
Thu Jun 16 12:41:00 CEST 2011


Revision: 37548
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37548
Author:   miikah
Date:     2011-06-16 10:41:00 +0000 (Thu, 16 Jun 2011)
Log Message:
-----------
Dynamic Paint:
Committed changes from previous weeks, biggest changes are:
* Canvas can now have multiple "surfaces" that each can have specific format, type and settings.
* Renewed UI to support this new system.
* Aside from old "image sequence" output format, Dynamic Paint can now work on vertex level as well. Currently vertex paint and displace are supported.
* Integrated vertex level painting with Point Cache.
* Added viewport preview for Point Cache surfaces.

Due to massive amount of changes, old Dynamic Paint saves are no longer supported. Also some features are temporarily missing or may not work properly.

Modified Paths:
--------------
    branches/soc-2011-carrot/release/datafiles/blenderbuttons
    branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_common.py
    branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
    branches/soc-2011-carrot/release/scripts/startup/bl_ui/space_time.py
    branches/soc-2011-carrot/source/blender/blenkernel/BKE_dynamicpaint.h
    branches/soc-2011-carrot/source/blender/blenkernel/BKE_pointcache.h
    branches/soc-2011-carrot/source/blender/blenkernel/intern/cdderivedmesh.c
    branches/soc-2011-carrot/source/blender/blenkernel/intern/dynamicpaint.c
    branches/soc-2011-carrot/source/blender/blenkernel/intern/particle.c
    branches/soc-2011-carrot/source/blender/blenkernel/intern/pointcache.c
    branches/soc-2011-carrot/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-carrot/source/blender/blenloader/intern/writefile.c
    branches/soc-2011-carrot/source/blender/editors/datafiles/blenderbuttons.c
    branches/soc-2011-carrot/source/blender/editors/include/UI_icons.h
    branches/soc-2011-carrot/source/blender/editors/interface/interface_templates.c
    branches/soc-2011-carrot/source/blender/editors/physics/physics_intern.h
    branches/soc-2011-carrot/source/blender/editors/physics/physics_ops.c
    branches/soc-2011-carrot/source/blender/editors/space_outliner/outliner.c
    branches/soc-2011-carrot/source/blender/editors/space_time/space_time.c
    branches/soc-2011-carrot/source/blender/editors/space_view3d/drawobject.c
    branches/soc-2011-carrot/source/blender/makesdna/DNA_dynamicpaint_types.h
    branches/soc-2011-carrot/source/blender/makesdna/DNA_modifier_types.h
    branches/soc-2011-carrot/source/blender/makesdna/DNA_object_force.h
    branches/soc-2011-carrot/source/blender/makesdna/DNA_space_types.h
    branches/soc-2011-carrot/source/blender/makesrna/RNA_access.h
    branches/soc-2011-carrot/source/blender/makesrna/intern/rna_dynamicpaint.c
    branches/soc-2011-carrot/source/blender/makesrna/intern/rna_modifier.c
    branches/soc-2011-carrot/source/blender/makesrna/intern/rna_space.c
    branches/soc-2011-carrot/source/blender/modifiers/intern/MOD_dynamicpaint.c

Modified: branches/soc-2011-carrot/release/datafiles/blenderbuttons
===================================================================
(Binary files differ)

Modified: branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_common.py
===================================================================
--- branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_common.py	2011-06-16 09:13:29 UTC (rev 37547)
+++ branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_common.py	2011-06-16 10:41:00 UTC (rev 37548)
@@ -64,7 +64,7 @@
         if(ob.type == 'MESH'):
             physics_add(self, col, context.collision, "Collision", 'COLLISION', 'MOD_PHYSICS', False)
             physics_add(self, col, context.cloth, "Cloth", 'CLOTH', 'MOD_CLOTH', True)
-            physics_add(self, col, context.dynamic_paint, "Dynamic Paint", 'DYNAMIC_PAINT', 'MOD_FLUIDSIM', True)
+            physics_add(self, col, context.dynamic_paint, "Dynamic Paint", 'DYNAMIC_PAINT', 'MOD_DYNAMICPAINT', True)
 
         col = split.column()
 
@@ -106,7 +106,7 @@
 
         layout.label(text=cache.info)
     else:
-        if cachetype == 'SMOKE':
+        if cachetype in {'SMOKE', 'DYNAMIC_PAINT'}:
             if not bpy.data.is_saved:
                 layout.label(text="Cache is disabled until the file is saved")
                 layout.enabled = False
@@ -118,17 +118,17 @@
 
         row = layout.row(align=True)
 
-        if cachetype != 'PSYS':
+        if cachetype not in {'PSYS', 'DYNAMIC_PAINT'}:
             row.enabled = enabled
             row.prop(cache, "frame_start")
             row.prop(cache, "frame_end")
-        if cachetype not in {'SMOKE', 'CLOTH'}:
+        if cachetype not in {'SMOKE', 'CLOTH', 'DYNAMIC_PAINT'}:
             row.prop(cache, "frame_step")
             row.prop(cache, "use_quick_cache")
         if cachetype != 'SMOKE':
             layout.label(text=cache.info)
 
-        if cachetype != 'SMOKE':
+        if cachetype not in {'SMOKE', 'DYNAMIC_PAINT'}:
             split = layout.split()
             split.enabled = enabled and bpy.data.is_saved
 

Modified: branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
===================================================================
--- branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py	2011-06-16 09:13:29 UTC (rev 37547)
+++ branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py	2011-06-16 10:41:00 UTC (rev 37548)
@@ -19,6 +19,9 @@
 # <pep8 compliant>
 import bpy
 
+from bl_ui.properties_physics_common import (
+    point_cache_ui,
+    )
 
 class PhysicButtonsPanel():
     bl_space_type = 'PROPERTIES'
@@ -46,136 +49,175 @@
 
             if md.dynamicpaint_type == 'CANVAS':
                 canvas = md.canvas_settings
-                
-                layout.operator("dpaint.bake", text="Bake Dynamic Paint", icon='MOD_FLUIDSIM')
-                if len(canvas.ui_info) != 0:
-                    layout.label(text=canvas.ui_info)
+                surface = canvas.active_surface
+                row = layout.row()
+                row.template_list(canvas, "canvas_surfaces", canvas, "active_index", rows=2)
 
-                col = layout.column()
-                col.label(text="Quality:")
-                col.prop(canvas, "resolution")
-                col.prop(canvas, "use_anti_aliasing")
+                col = row.column(align=True)
+                col.operator("dpaint.surface_slot_add", icon='ZOOMIN', text="")
+                col.operator("dpaint.surface_slot_remove", icon='ZOOMOUT', text="")
                 
-                col = layout.column()
-                col.label(text="Frames:")
-                split = col.split()
+                if surface:
+                    layout.prop(surface, "name")
+                    layout.prop(surface, "surface_format", expand=False)
+                    
+                    if surface.surface_format != "VERTEX":
+                        col = layout.column()
+                        col.label(text="Quality:")
+                        col.prop(surface, "image_resolution")
+                        col.prop(surface, "use_anti_aliasing")
                 
-                col = split.column(align=True)
-                col.prop(canvas, "start_frame", text="Start")
-                col.prop(canvas, "end_frame", text="End")
+                    col = layout.column()
+                    col.label(text="Frames:")
+                    split = col.split()
                 
-                col = split.column()
-                col.prop(canvas, "substeps")
+                    col = split.column(align=True)
+                    col.prop(surface, "start_frame", text="Start")
+                    col.prop(surface, "end_frame", text="End")
                 
+                    col = split.column()
+                    col.prop(surface, "substeps")
+                
 
-            elif md.dynamicpaint_type == 'PAINT':
-                paint = md.paint_settings
+            elif md.dynamicpaint_type == 'BRUSH':
+                brush = md.brush_settings
                 
-                layout.prop(paint, "do_paint")
+                layout.prop(brush, "brush_settings_context", expand=True, icon_only=True)
                 
-                split = layout.split()
+                if (brush.brush_settings_context == "GENERAL"):
+                    split = layout.split()
 
-                col = split.column()
-                col.active = paint.do_paint
-                col.prop(paint, "absolute_alpha")
-                col.prop(paint, "paint_erase")
-                col.prop(paint, "paint_wetness", text="Wetness")
+                    col = split.column()
+                    col.prop(brush, "absolute_alpha")
+                    col.prop(brush, "paint_erase")
+                    col.prop(brush, "paint_wetness", text="Wetness")
                 
-                col = split.column()
-                col.active = paint.do_paint
-                sub = col.column()
-                sub.active = (paint.paint_source != "PSYS");
-                sub.prop(paint, "use_material")
-                if paint.use_material and paint.paint_source != "PSYS":
-                    col.prop(paint, "material", text="")
-                else:
-                    col.prop(paint, "paint_color", text="")
-                col.prop(paint, "paint_alpha", text="Alpha")
+                    col = split.column()
+                    sub = col.column()
+                    sub.active = (brush.paint_source != "PSYS");
+                    sub.prop(brush, "use_material")
+                    if brush.use_material and brush.paint_source != "PSYS":
+                        col.prop(brush, "material", text="")
+                        col.prop(brush, "paint_alpha", text="Alpha Factor")
+                    else:
+                        col.prop(brush, "paint_color", text="")
+                        col.prop(brush, "paint_alpha", text="Alpha")
                 
-                layout.label()
-                layout.prop(paint, "do_displace")
+                if (brush.brush_settings_context != "GENERAL"):
+                    layout.label(text="-WIP-")
 
 
-class PHYSICS_PT_dp_output(PhysicButtonsPanel, bpy.types.Panel):
-    bl_label = "Dynamic Paint: Output"
-    bl_options = {'DEFAULT_CLOSED'}
+class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel):
+    bl_label = "Dynamic Paint: Advanced"
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
-        return md and (md.dynamicpaint_type == 'CANVAS')
+        return md and (md.dynamicpaint_type == 'CANVAS') and (context.dynamic_paint.canvas_settings.active_surface)
 
     def draw(self, context):
         layout = self.layout
 
         canvas = context.dynamic_paint.canvas_settings
+        surface = canvas.active_surface
+        ob = context.object
 
-        col = layout.column()
-        col.prop(canvas, "output_paint")
-        sub = col.column()
-        sub.active = canvas.output_paint
-        sub.prop(canvas, "paint_output_path", text="")
-        sub.prop(canvas, "premultiply", text="Premultiply alpha")
-        
-        layout.separator()
+        layout.prop(surface, "surface_type", expand=False)
 
-        col = layout.column()
-        col.prop(canvas, "output_wet")
-        sub = col.column()
-        sub.active = canvas.output_wet
-        sub.prop(canvas, "wet_output_path", text="")
-        
-        layout.separator()
+        if (surface.surface_type == "PAINT"):
+            layout.prop(surface, "initial_color", expand=False)
+            col = layout.split(percentage=0.33)
+            col.prop(surface, "use_dissolve", text="Dissolve:")
+            sub = col.column()
+            sub.active = surface.use_dissolve
+            sub.prop(surface, "dissolve_speed", text="Time")
 
-        col = layout.column()
-        col.prop(canvas, "output_disp")
-        sub = col.column()
-        sub.active = canvas.output_disp
-        sub.prop(canvas, "displace_output_path", text="")
-        sub.prop(canvas, "displacement", text="Strength")
+        if (surface.surface_type == "DISPLACE"):
+            col = layout.split(percentage=0.33)
+            col.prop(surface, "use_dissolve", text="Flatten:")
+            sub = col.column()
+            sub.active = surface.use_dissolve
+            sub.prop(surface, "dissolve_speed", text="Time")
+            
+        layout.label(text="Brush Group:")
+        layout.prop(surface, "brush_group", text="")
 
-        split = sub.split()
-        sub = split.column()
-        sub.prop(canvas, "disp_type", text="Type")
-        sub = split.column()
-        sub.prop(canvas, "disp_format", text="Format")
 
-
-class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel):
-    bl_label = "Dynamic Paint: Advanced"
+class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel):
+    bl_label = "Dynamic Paint: Output"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
-        return md and (md.dynamicpaint_type == 'CANVAS')
+        if ((not md) or (md.dynamicpaint_type != 'CANVAS')):
+            return 0
+        surface = context.dynamic_paint.canvas_settings.active_surface

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list