Dynamic Paint:
authorMiika Hamalainen <blender@miikah.org>
Sun, 3 Jul 2011 14:01:57 +0000 (14:01 +0000)
committerMiika Hamalainen <blender@miikah.org>
Sun, 3 Jul 2011 14:01:57 +0000 (14:01 +0000)
* Some ui and rna tweaking.
* Effects ui panel is no longer visible for non-paint surfaces.

release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
source/blender/blenkernel/BKE_dynamicpaint.h
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/editors/interface/interface_templates.c
source/blender/makesrna/intern/rna_dynamicpaint.c

index 806256dd502ff50f4244d8255161e17886241bfd..d93645d0c5cf869e3d44ebfec8ff98108e738649 100644 (file)
@@ -132,6 +132,7 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel):
         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 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel):
             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 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel):
         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
index f9b16336de8b2d80351f8faca245d41304a95a5f..5c041cb4a5b1adb48ec5fea527bca0481c4fbd61 100644 (file)
@@ -69,7 +69,7 @@ void dynamicPaint_Modifier_copy(struct DynamicPaintModifierData *pmd, struct Dyn
 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);
 
index f0785d1f0fe81e5714a04bad29060f3f1d989bc9..e36167fb23f1bbc33cc79943d1bbcab9fac1310b 100644 (file)
@@ -90,7 +90,6 @@
 struct Object;
 struct Scene;
 struct DerivedMesh;
-//struct DynamicPaintModifierData;
 
 /*
 *      Init predefined antialias jitter data
@@ -217,10 +216,11 @@ static int dynamicPaint_surfaceNumOfPoints(DynamicPaintSurface *surface)
 }
 
 /* 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 @@ static void dynamicPaint_resetPreview(DynamicPaintCanvasSettings *canvas)
        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 @@ void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface) {
        }
 
        /* update preview */
-       if (dynamicPaint_surfaceHasPreview(surface))
+       if (dynamicPaint_surfaceHasColorPreview(surface))
                dynamicPaint_setPreview(surface);
        else
                dynamicPaint_resetPreview(surface->canvas);
index e25af029fe4c0627d9f7fb18c3bc697c51b43f20..c4308798fa70362225b85a10b4c90a774d1c5b5f 100644 (file)
@@ -2138,7 +2138,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
 
                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);
index d89df053a30f423ffb711ff7531daba2a4be1b1a..deff2332b7f812a580665d84e42eb6b533e1dc80 100644 (file)
@@ -434,8 +434,8 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
        
        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 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
        
        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 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
 
        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 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
        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 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
        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 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
        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.");
        
        /*