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

Miika Hamalainen miika.hamalainen at kolumbus.fi
Sun Jul 3 16:01:58 CEST 2011


Revision: 38064
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38064
Author:   miikah
Date:     2011-07-03 14:01:57 +0000 (Sun, 03 Jul 2011)
Log Message:
-----------
Dynamic Paint:
* Some ui and rna tweaking.
* Effects ui panel is no longer visible for non-paint surfaces.

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/editors/interface/interface_templates.c
    branches/soc-2011-carrot/source/blender/makesrna/intern/rna_dynamicpaint.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-07-03 13:20:21 UTC (rev 38063)
+++ branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py	2011-07-03 14:01:57 UTC (rev 38064)
@@ -132,6 +132,7 @@
         layout.separator()
 
         if (surface.surface_type == "PAINT"):
+            layout.label(text="Wetmap drying:")
             split = layout.split(percentage=0.8)
             split.prop(surface, "dry_speed", text="Dry Time")
             split.prop(surface, "use_dry_log", text="Slow")
@@ -206,16 +207,23 @@
             col.label(text="UV layer:")
             col.prop_search(surface, "uv_layer", ob.data, "uv_textures", text="")
             
+            col.separator()
             col = layout.column()
             col.prop(surface, "image_output_path", text="Output directory")
-            col.prop(surface, "image_fileformat", text="Image Format:")
+            col.prop(surface, "image_fileformat", text="Image Format")
+            col.separator()
             if (surface.surface_type == "PAINT"):
+                split = col.split()
+                col = split.column()
                 col.prop(surface, "do_output1", text="Output Paintmaps:")
-                sub = col.column()
+                sub = split.column()
+                sub.prop(surface, "premultiply", text="Premultiply alpha")
                 sub.active = surface.do_output1
+                sub = layout.column()
+                sub.active = surface.do_output1
                 sub.prop(surface, "output_name", text="Filename: ")
-                sub.prop(surface, "premultiply", text="Premultiply alpha")
                 
+                col = layout.column()
                 col.prop(surface, "do_output2", text="Output Wetmaps:")
                 sub = col.column()
                 sub.active = surface.do_output2
@@ -241,7 +249,7 @@
         if ((not md) or (md.dynamicpaint_type != 'CANVAS')):
             return False;
         surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
-        return surface and (surface.surface_format != "PTEX")
+        return surface and (surface.surface_type == "PAINT")
 
     def draw(self, context):
         layout = self.layout

Modified: branches/soc-2011-carrot/source/blender/blenkernel/BKE_dynamicpaint.h
===================================================================
--- branches/soc-2011-carrot/source/blender/blenkernel/BKE_dynamicpaint.h	2011-07-03 13:20:21 UTC (rev 38063)
+++ branches/soc-2011-carrot/source/blender/blenkernel/BKE_dynamicpaint.h	2011-07-03 14:01:57 UTC (rev 38064)
@@ -69,7 +69,7 @@
 void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface);
 void dynamicPaint_clearSurface(DynamicPaintSurface *surface);
 int  dynamicPaint_resetSurface(struct DynamicPaintSurface *surface);
-int  dynamicPaint_surfaceHasPreview(DynamicPaintSurface *surface);
+int  dynamicPaint_surfaceHasColorPreview(DynamicPaintSurface *surface);
 void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface);
 void dynamicPaintSurface_setUniqueName(DynamicPaintSurface *surface, char *basename);
 

Modified: branches/soc-2011-carrot/source/blender/blenkernel/intern/dynamicpaint.c
===================================================================
--- branches/soc-2011-carrot/source/blender/blenkernel/intern/dynamicpaint.c	2011-07-03 13:20:21 UTC (rev 38063)
+++ branches/soc-2011-carrot/source/blender/blenkernel/intern/dynamicpaint.c	2011-07-03 14:01:57 UTC (rev 38064)
@@ -90,7 +90,6 @@
 struct Object;
 struct Scene;
 struct DerivedMesh;
-//struct DynamicPaintModifierData;
 
 /*
 *	Init predefined antialias jitter data
@@ -217,10 +216,11 @@
 }
 
 /* checks whether surface's format/type has realtime preview */
-int dynamicPaint_surfaceHasPreview(DynamicPaintSurface *surface) {
+int dynamicPaint_surfaceHasColorPreview(DynamicPaintSurface *surface) {
 	if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) return 0;
 	else if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
-		if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE) return 0;
+		if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE ||
+			surface->type == MOD_DPAINT_SURFACE_T_WAVE) return 0;
 		else return 1;
 	}
 	else return 1;
@@ -247,7 +247,7 @@
 	int done=0;
 
 	for(; surface; surface=surface->next) {
-		if (!done && dynamicPaint_surfaceHasPreview(surface)) {
+		if (!done && dynamicPaint_surfaceHasColorPreview(surface)) {
 			surface->flags |= MOD_DPAINT_PREVIEW;
 			done=1;
 		}
@@ -295,7 +295,7 @@
 	}
 
 	/* update preview */
-	if (dynamicPaint_surfaceHasPreview(surface))
+	if (dynamicPaint_surfaceHasColorPreview(surface))
 		dynamicPaint_setPreview(surface);
 	else
 		dynamicPaint_resetPreview(surface->canvas);

Modified: branches/soc-2011-carrot/source/blender/editors/interface/interface_templates.c
===================================================================
--- branches/soc-2011-carrot/source/blender/editors/interface/interface_templates.c	2011-07-03 13:20:21 UTC (rev 38063)
+++ branches/soc-2011-carrot/source/blender/editors/interface/interface_templates.c	2011-07-03 14:01:57 UTC (rev 38064)
@@ -2138,7 +2138,7 @@
 
 		sprintf(name_final, "%s (%s)",name,enum_name);
 		uiItemL(sub, name_final, icon);
-		if (dynamicPaint_surfaceHasPreview(surface)) {
+		if (dynamicPaint_surfaceHasColorPreview(surface)) {
 			uiBlockSetEmboss(block, UI_EMBOSSN);
 			uiDefIconButR(block, OPTION, 0, (surface->flags & MOD_DPAINT_PREVIEW) ? ICON_RESTRICT_VIEW_OFF : ICON_RESTRICT_VIEW_ON,
 				0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "show_preview", 0, 0, 0, 0, 0, NULL);

Modified: branches/soc-2011-carrot/source/blender/makesrna/intern/rna_dynamicpaint.c
===================================================================
--- branches/soc-2011-carrot/source/blender/makesrna/intern/rna_dynamicpaint.c	2011-07-03 13:20:21 UTC (rev 38063)
+++ branches/soc-2011-carrot/source/blender/makesrna/intern/rna_dynamicpaint.c	2011-07-03 14:01:57 UTC (rev 38064)
@@ -434,8 +434,8 @@
 	
 	prop= RNA_def_property(srna, "spread_speed", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "spread_speed");
-	RNA_def_property_range(prop, 0.01, 5.0);
-	RNA_def_property_ui_range(prop, 0.001, 20.0, 1, 2);
+	RNA_def_property_range(prop, 0.001, 10.0);
+	RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Spread Speed", "How fast spread effect moves on the canvas surface.");
 	
 	prop= RNA_def_property(srna, "use_drip", PROP_BOOLEAN, PROP_NONE);
@@ -448,8 +448,8 @@
 	
 	prop= RNA_def_property(srna, "shrink_speed", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "shrink_speed");
-	RNA_def_property_range(prop, 0.01, 5.0);
-	RNA_def_property_ui_range(prop, 0.01, 20.0, 1, 2);
+	RNA_def_property_range(prop, 0.001, 10.0);
+	RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Shrink Speed", "How fast shrink effect moves on the canvas surface.");
 
 	prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
@@ -527,7 +527,7 @@
 
 	prop= RNA_def_property(srna, "wave_spring", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "wave_spring");
-	RNA_def_property_range(prop, 0.01, 1.0);
+	RNA_def_property_range(prop, 0.001, 1.0);
 	RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2);
 	RNA_def_property_ui_text(prop, "Spring", "Spring force that pulls water level back to zero.");
 
@@ -627,7 +627,7 @@
 	prop= RNA_def_property(srna, "paint_alpha", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "alpha");
 	RNA_def_property_range(prop, 0.0, 10.0);
-	RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2);
+	RNA_def_property_ui_range(prop, 0.0, 10.0, 5, 2);
 	RNA_def_property_ui_text(prop, "Paint Alpha", "Paint alpha.");
 	
 	prop= RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE);
@@ -646,7 +646,7 @@
 	prop= RNA_def_property(srna, "paint_wetness", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "wetness");
 	RNA_def_property_range(prop, 0.0, 1.0);
-	RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 3);
+	RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
 	RNA_def_property_ui_text(prop, "Paint Wetness", "Paint Wetness. Visible in wet map. Some effects only affect wet paint.");
 	
 	prop= RNA_def_property(srna, "paint_erase", PROP_BOOLEAN, PROP_NONE);
@@ -662,7 +662,7 @@
 	prop= RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "wave_factor");
 	RNA_def_property_range(prop, -2.0, 2.0);
-	RNA_def_property_ui_range(prop, -1.0, 1.0, 1, 2);
+	RNA_def_property_ui_range(prop, -1.0, 1.0, 5, 2);
 	RNA_def_property_ui_text(prop, "Factor", "Multiplier for wave strenght of this brush.");
 	
 	/*




More information about the Bf-blender-cvs mailing list