[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36854] branches/soc-2011-carrot: Applied Dynamic Paint 1.18f patch as a codebase for GSoC.

Miika Hämäläinen miika.hamalainen at kolumbus.fi
Tue May 24 09:08:58 CEST 2011


Revision: 36854
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36854
Author:   miikah
Date:     2011-05-24 07:08:58 +0000 (Tue, 24 May 2011)
Log Message:
-----------
Applied Dynamic Paint 1.18f patch as a codebase for GSoC.

Modified Paths:
--------------
    branches/soc-2011-carrot/release/scripts/startup/bl_ui/__init__.py
    branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_data_modifier.py
    branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_common.py
    branches/soc-2011-carrot/source/blender/blenkernel/BKE_bvhutils.h
    branches/soc-2011-carrot/source/blender/blenkernel/CMakeLists.txt
    branches/soc-2011-carrot/source/blender/blenkernel/intern/bvhutils.c
    branches/soc-2011-carrot/source/blender/blenkernel/intern/particle.c
    branches/soc-2011-carrot/source/blender/blenlib/BLI_math_geom.h
    branches/soc-2011-carrot/source/blender/blenlib/intern/math_geom.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/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_buttons/buttons_context.c
    branches/soc-2011-carrot/source/blender/editors/space_outliner/outliner.c
    branches/soc-2011-carrot/source/blender/makesdna/DNA_modifier_types.h
    branches/soc-2011-carrot/source/blender/makesdna/intern/makesdna.c
    branches/soc-2011-carrot/source/blender/makesrna/RNA_access.h
    branches/soc-2011-carrot/source/blender/makesrna/intern/makesrna.c
    branches/soc-2011-carrot/source/blender/makesrna/intern/rna_internal.h
    branches/soc-2011-carrot/source/blender/makesrna/intern/rna_modifier.c
    branches/soc-2011-carrot/source/blender/modifiers/CMakeLists.txt
    branches/soc-2011-carrot/source/blender/modifiers/MOD_modifiertypes.h
    branches/soc-2011-carrot/source/blender/modifiers/intern/MOD_util.c
    branches/soc-2011-carrot/source/blender/render/extern/include/RE_shader_ext.h
    branches/soc-2011-carrot/source/blender/render/intern/include/voxeldata.h
    branches/soc-2011-carrot/source/blender/render/intern/source/render_texture.c
    branches/soc-2011-carrot/source/blender/render/intern/source/voxeldata.c
    branches/soc-2011-carrot/source/blenderplayer/bad_level_call_stubs/stubs.c

Added Paths:
-----------
    branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
    branches/soc-2011-carrot/source/blender/blenkernel/BKE_dynamicpaint.h
    branches/soc-2011-carrot/source/blender/blenkernel/intern/dynamicpaint.c
    branches/soc-2011-carrot/source/blender/makesdna/DNA_dynamicpaint_types.h
    branches/soc-2011-carrot/source/blender/makesrna/intern/rna_dynamicpaint.c
    branches/soc-2011-carrot/source/blender/modifiers/intern/MOD_dynamicpaint.c

Modified: branches/soc-2011-carrot/release/scripts/startup/bl_ui/__init__.py
===================================================================
--- branches/soc-2011-carrot/release/scripts/startup/bl_ui/__init__.py	2011-05-24 06:44:39 UTC (rev 36853)
+++ branches/soc-2011-carrot/release/scripts/startup/bl_ui/__init__.py	2011-05-24 07:08:58 UTC (rev 36854)
@@ -43,6 +43,7 @@
     "properties_particle",
     "properties_physics_cloth",
     "properties_physics_common",
+    "properties_physics_dynamicpaint",
     "properties_physics_field",
     "properties_physics_fluid",
     "properties_physics_smoke",

Modified: branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_data_modifier.py
===================================================================
--- branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_data_modifier.py	2011-05-24 06:44:39 UTC (rev 36853)
+++ branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_data_modifier.py	2011-05-24 07:08:58 UTC (rev 36854)
@@ -229,6 +229,9 @@
         row.prop(md, "mid_level")
         row.prop(md, "strength")
 
+    def DYNAMIC_PAINT(self, layout, ob, md):
+        layout.label(text="See Dynamic Paint panel.")
+
     def EDGE_SPLIT(self, layout, ob, md):
         split = layout.split()
 

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-05-24 06:44:39 UTC (rev 36853)
+++ branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_common.py	2011-05-24 07:08:58 UTC (rev 36854)
@@ -64,6 +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)
 
         col = split.column()
 

Added: 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	                        (rev 0)
+++ branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py	2011-05-24 07:08:58 UTC (rev 36854)
@@ -0,0 +1,264 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+import bpy
+
+
+class PhysicButtonsPanel():
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "physics"
+
+    @classmethod
+    def poll(cls, context):
+        ob = context.object
+        rd = context.scene.render
+        return (ob and ob.type == 'MESH') and (not rd.use_game_engine) and (context.dynamic_paint)
+
+
+class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel):
+    bl_label = "Dynamic Paint"
+
+    def draw(self, context):
+        layout = self.layout
+
+        md = context.dynamic_paint
+        ob = context.object
+
+        if md:
+            layout.prop(md, "dynamicpaint_type", expand=True)
+
+            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)
+
+                col = layout.column()
+                col.label(text="Quality:")
+                col.prop(canvas, "resolution")
+                col.prop(canvas, "use_anti_aliasing")
+                
+                col = layout.column()
+                col.label(text="Frames:")
+                split = col.split()
+                
+                col = split.column(align=True)
+                col.prop(canvas, "start_frame", text="Start")
+                col.prop(canvas, "end_frame", text="End")
+                
+                col = split.column()
+                col.prop(canvas, "substeps")
+                
+
+            elif md.dynamicpaint_type == 'PAINT':
+                paint = md.paint_settings
+                
+                layout.prop(paint, "do_paint")
+                
+                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.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")
+                
+                layout.label()
+                layout.prop(paint, "do_displace")
+
+
+class PHYSICS_PT_dp_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')
+
+    def draw(self, context):
+        layout = self.layout
+
+        canvas = context.dynamic_paint.canvas_settings
+
+        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()
+
+        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()
+
+        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")
+
+        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"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        md = context.dynamic_paint
+        return md and (md.dynamicpaint_type == 'CANVAS')
+
+    def draw(self, context):
+        layout = self.layout
+
+        canvas = context.dynamic_paint.canvas_settings
+        ob = context.object
+
+        col = layout.column()
+        split = col.split(percentage=0.7)
+        split.prop(canvas, "dry_speed", text="Dry Time")
+        split.prop(canvas, "use_dry_log", text="Slow")
+
+        col = layout.column()
+        col.prop(canvas, "use_dissolve_paint")
+        sub = col.column()
+        sub.active = canvas.use_dissolve_paint
+        sub.prop(canvas, "dissolve_speed", text="Time")
+
+        col = layout.column()
+        col.prop(canvas, "use_flatten_disp", text="Flatten Displace")
+        sub = col.column()
+        sub.active = canvas.use_flatten_disp
+        sub.prop(canvas, "flatten_speed", text="Time")
+        
+        layout.separator()
+		
+        layout.prop_search(canvas, "uv_layer", ob.data, "uv_textures")
+
+class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel):
+    bl_label = "Dynamic Paint: Effects"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        md = context.dynamic_paint
+        return md and (md.dynamicpaint_type == 'CANVAS')
+
+    def draw(self, context):
+        layout = self.layout
+
+        canvas = context.dynamic_paint.canvas_settings
+
+        layout.prop(canvas, "effect_ui", expand=True)
+
+        if canvas.effect_ui == "SPREAD":
+            layout.prop(canvas, "use_spread")
+            col = layout.column()
+            col.active = canvas.use_spread
+            col.prop(canvas, "spread_speed")
+
+        elif canvas.effect_ui == "DRIP":
+            layout.prop(canvas, "use_drip")
+            col = layout.column()
+            col.active = canvas.use_drip
+            col.prop(canvas, "drip_speed")
+
+        elif canvas.effect_ui == "SHRINK":
+            layout.prop(canvas, "use_shrink")
+            col = layout.column()
+            col.active = canvas.use_shrink
+            col.prop(canvas, "shrink_speed")
+
+class PHYSICS_PT_dp_advanced_paint(PhysicButtonsPanel, bpy.types.Panel):
+    bl_label = "Dynamic Paint: Advanced"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        md = context.dynamic_paint
+        return md and (md.dynamicpaint_type == 'PAINT')
+
+    def draw(self, context):
+        layout = self.layout
+
+        paint = context.dynamic_paint.paint_settings
+        ob = context.object
+		
+        split = layout.split()
+        col = split.column()
+        col.prop(paint, "paint_source")
+
+        if paint.paint_source == "PSYS":
+            col.prop_search(paint, "psys", ob, "particle_systems", text="")
+            if paint.psys:

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list