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

Miika Hamalainen miika.hamalainen at kolumbus.fi
Sat Oct 22 18:16:17 CEST 2011


Revision: 41198
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41198
Author:   miikah
Date:     2011-10-22 16:16:14 +0000 (Sat, 22 Oct 2011)
Log Message:
-----------
Dynamic Paint:
* Some changes and cleanup pointed on the codereview.

Modified 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/blenlib/BLI_kdtree.h
    branches/soc-2011-carrot/source/blender/blenlib/BLI_threads.h
    branches/soc-2011-carrot/source/blender/blenlib/intern/BLI_kdtree.c
    branches/soc-2011-carrot/source/blender/blenlib/intern/threads.c
    branches/soc-2011-carrot/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-carrot/source/blender/editors/physics/dynamicpaint_ops.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
    branches/soc-2011-carrot/source/blender/render/extern/include/RE_render_ext.h
    branches/soc-2011-carrot/source/blender/render/intern/include/texture.h
    branches/soc-2011-carrot/source/blender/render/intern/source/render_texture.c
    branches/soc-2011-carrot/source/blender/render/intern/source/shadeinput.c
    branches/soc-2011-carrot/source/blender/render/intern/source/shadeoutput.c
    branches/soc-2011-carrot/source/blenderplayer/bad_level_call_stubs/stubs.c

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-10-22 16:01:19 UTC (rev 41197)
+++ branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py	2011-10-22 16:16:14 UTC (rev 41198)
@@ -92,59 +92,28 @@
                     layout.operator("dpaint.type_toggle", text="Add Brush").type = 'BRUSH'
                 else:
                     layout.operator("dpaint.type_toggle", text="Remove Brush", icon='X').type = 'BRUSH'
-                    
-                    layout.prop(brush, "brush_settings_context", expand=True, icon_only=True)
-                    
-                    if (brush.brush_settings_context == "GENERAL"):
-                        split = layout.split()
 
-                        col = split.column()
-                        col.prop(brush, "absolute_alpha")
-                        col.prop(brush, "paint_erase")
-                        col.prop(brush, "paint_wetness", text="Wetness")
-                    
-                        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")
-                    
-                    elif (brush.brush_settings_context == "WAVE"):
-                        layout.prop(brush, "wave_type")
-                        if (brush.wave_type != "REFLECT"):
-                            split = layout.split(percentage=0.5)
-                            col = split.column()
-                            col.prop(brush, "wave_factor")
-                            col = split.column()
-                            col.prop(brush, "wave_clamp")
-                    elif (brush.brush_settings_context == "VELOCITY"):
-                        col = layout.row().column()
-                        col.label(text="Velocity Settings:")
-                        split = layout.split()
-                        col = split.column()
-                        col.prop(brush, "velocity_alpha")
-                        col.prop(brush, "velocity_color")
-                        col = split.column()
-                        col.prop(brush, "velocity_depth")
-                        sub = layout.row().column()
-                        sub.active = (brush.velocity_alpha or brush.velocity_color or brush.velocity_depth)
-                        sub.prop(brush, "max_velocity")
-                        sub.template_color_ramp(brush, "velocity_ramp", expand=True)
-                        layout.separator()
-                        layout.label(text="Smudge:")
-                        layout.prop(brush, "do_smudge")
-                        layout.prop(brush, "smudge_strength")
+                    split = layout.split()
+
+                    col = split.column()
+                    col.prop(brush, "absolute_alpha")
+                    col.prop(brush, "paint_erase")
+                    col.prop(brush, "paint_wetness", text="Wetness")
+                
+                    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:
-                        layout.label(text="-WIP-")
+                        col.prop(brush, "paint_color", text="")
+                        col.prop(brush, "paint_alpha", text="Alpha")
 
 
 class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel):
-    bl_label = "Dynamic Paint: Advanced"
+    bl_label = "Dynamic Paint Advanced"
 
     @classmethod
     def poll(cls, context):
@@ -208,7 +177,7 @@
         layout.prop(surface, "brush_group", text="")
 
 class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel):
-    bl_label = "Dynamic Paint: Output"
+    bl_label = "Dynamic Paint Output"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
@@ -299,7 +268,7 @@
                 layout.label(text=canvas.ui_info)
 
 class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel):
-    bl_label = "Dynamic Paint: Initial Color"
+    bl_label = "Dynamic Paint Initial Color"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
@@ -332,7 +301,7 @@
             layout.prop_search(surface, "init_layername", ob.data, "vertex_colors", text="Color Layer: ")
 
 class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel):
-    bl_label = "Dynamic Paint: Effects"
+    bl_label = "Dynamic Paint Effects"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
@@ -383,7 +352,7 @@
 			
 
 class PHYSICS_PT_dp_cache(PhysicButtonsPanel, bpy.types.Panel):
-    bl_label = "Dynamic Paint: Cache"
+    bl_label = "Dynamic Paint Cache"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
@@ -401,9 +370,8 @@
         point_cache_ui(self, context, cache, (cache.is_baked is False), 'DYNAMIC_PAINT')
 
 
-class PHYSICS_PT_dp_advanced_brush(PhysicButtonsPanel, bpy.types.Panel):
-    bl_label = "Dynamic Paint: Advanced"
-    bl_options = {'DEFAULT_CLOSED'}
+class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, bpy.types.Panel):
+    bl_label = "Dynamic Paint Source"
 
     @classmethod
     def poll(cls, context):
@@ -450,7 +418,62 @@
                 col.separator()
                 col.prop(brush, "prox_ramp_alpha", text="Only Use Alpha")
                 col.template_color_ramp(brush, "paint_ramp", expand=True)
+                
+class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, bpy.types.Panel):
+    bl_label = "Dynamic Paint Velocity"
+    bl_options = {'DEFAULT_CLOSED'}
 
+    @classmethod
+    def poll(cls, context):
+        md = context.dynamic_paint
+        return md and (md.ui_type == "BRUSH") and (md.brush_settings)
+
+    def draw(self, context):
+        layout = self.layout
+
+        brush = context.dynamic_paint.brush_settings
+        ob = context.object
+		
+        col = layout.row().column()
+        col.label(text="Brush Velocity Settings:")
+        split = layout.split()
+        col = split.column()
+        col.prop(brush, "velocity_alpha")
+        col.prop(brush, "velocity_color")
+        col = split.column()
+        col.prop(brush, "velocity_depth")
+        sub = layout.row().column()
+        sub.active = (brush.velocity_alpha or brush.velocity_color or brush.velocity_depth)
+        sub.prop(brush, "max_velocity")
+        sub.template_color_ramp(brush, "velocity_ramp", expand=True)
+        layout.separator()
+        layout.label(text="Smudge:")
+        layout.prop(brush, "do_smudge")
+        layout.prop(brush, "smudge_strength")
+        
+class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, bpy.types.Panel):
+    bl_label = "Dynamic Paint Wave"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        md = context.dynamic_paint
+        return md and (md.ui_type == "BRUSH") and (md.brush_settings)
+
+    def draw(self, context):
+        layout = self.layout
+
+        brush = context.dynamic_paint.brush_settings
+        ob = context.object
+		
+        layout.prop(brush, "wave_type")
+        if (brush.wave_type != "REFLECT"):
+            split = layout.split(percentage=0.5)
+            col = split.column()
+            col.prop(brush, "wave_factor")
+            col = split.column()
+            col.prop(brush, "wave_clamp")
+
 def register():
     bpy.utils.register_module(__name__)
 

Modified: branches/soc-2011-carrot/source/blender/blenkernel/BKE_dynamicpaint.h
===================================================================
--- branches/soc-2011-carrot/source/blender/blenkernel/BKE_dynamicpaint.h	2011-10-22 16:01:19 UTC (rev 41197)
+++ branches/soc-2011-carrot/source/blender/blenkernel/BKE_dynamicpaint.h	2011-10-22 16:16:14 UTC (rev 41198)
@@ -16,8 +16,6 @@
 
 #include "DNA_dynamicpaint_types.h"
 
-struct PaintEffectData;
-struct PaintBakeData;
 struct bContext;
 struct wmOperator;
 

Modified: branches/soc-2011-carrot/source/blender/blenkernel/intern/dynamicpaint.c
===================================================================
--- branches/soc-2011-carrot/source/blender/blenkernel/intern/dynamicpaint.c	2011-10-22 16:01:19 UTC (rev 41197)
+++ branches/soc-2011-carrot/source/blender/blenkernel/intern/dynamicpaint.c	2011-10-22 16:16:14 UTC (rev 41198)
@@ -20,17 +20,19 @@
 #include "BLI_blenlib.h"
 #include "BLI_math.h"
 #include "BLI_kdtree.h"
+#include "BLI_threads.h"
 #include "BLI_utildefines.h"
 
 #include "DNA_anim_types.h"
 #include "DNA_dynamicpaint_types.h"
 #include "DNA_group_types.h" /*GroupObject*/
+#include "DNA_material_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
 #include "DNA_modifier_types.h"
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"	/* to get temp file path	*/
+#include "DNA_texture_types.h"
 
 #include "BKE_animsys.h"
 #include "BKE_bvhutils.h"	/* bvh tree	*/
@@ -45,6 +47,7 @@
 #include "BKE_dynamicpaint.h"
 #include "BKE_effect.h"
 #include "BKE_global.h"
+#include "BKE_image.h"
 #include "BKE_main.h"
 #include "BKE_material.h"
 #include "BKE_modifier.h"
@@ -61,19 +64,10 @@
 /* for image output	*/
 #include "IMB_imbuf_types.h"
 #include "IMB_imbuf.h"
-#include "BKE_image.h"
 
-/* uv validate	*/
-#include "intern/MOD_util.h"
-
-/* to read object material color	*/
-#include "DNA_texture_types.h"
-#include "../render/intern/include/pointdensity.h"
-#include "../render/intern/include/render_types.h"
-#include "../render/intern/include/voxeldata.h"
-#include "../render/intern/include/texture.h"
-#include "DNA_material_types.h"
+/* to read material/texture color	*/
 #include "RE_render_ext.h"

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list