Dynamic Paint:

* More code changes pointed by Brecht in codereview.
* Some user interface improvements.
* Updating brush settings now also updates canvas preview.
This commit is contained in:
Miika Hamalainen 2011-10-28 14:46:09 +00:00
parent e441c71f77
commit fae903e263
14 changed files with 398 additions and 503 deletions

@ -72,18 +72,18 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel):
if surface.surface_format != "VERTEX":
col.label(text="Quality:")
col.prop(surface, "image_resolution")
col.prop(surface, "use_anti_aliasing")
col.prop(surface, "use_antialiasing")
col = layout.column()
col.label(text="Frames:")
split = col.split()
col = split.column(align=True)
col.prop(surface, "start_frame", text="Start")
col.prop(surface, "end_frame", text="End")
col.prop(surface, "frame_start", text="Start")
col.prop(surface, "frame_end", text="End")
col = split.column()
col.prop(surface, "substeps")
col.prop(surface, "frame_substeps")
elif (md.ui_type == "BRUSH"):
brush = md.brush_settings
@ -102,9 +102,9 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel):
col = split.column()
sub = col.column()
sub.active = (brush.paint_source != "PSYS");
sub.active = (brush.paint_source != "PARTICLE_SYSTEM");
sub.prop(brush, "use_material")
if brush.use_material and brush.paint_source != "PSYS":
if brush.use_material and brush.paint_source != "PARTICLE_SYSTEM":
col.prop(brush, "material", text="")
col.prop(brush, "paint_alpha", text="Alpha Factor")
else:
@ -132,33 +132,42 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel):
# dissolve
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")
split = layout.split(percentage=0.35)
col = split.column()
col.label(text="Wetmap drying:")
col = split.column()
split = col.split(percentage=0.7)
col = split.column()
col.prop(surface, "dry_speed", text="Time")
col = split.column()
col.prop(surface, "use_dry_log", text="Slow")
if (surface.surface_type != "WAVE"):
split = layout.split(percentage=0.35)
col = split.column()
if (surface.surface_type == "DISPLACE"):
layout.prop(surface, "use_dissolve", text="Dissolve:")
col.prop(surface, "use_dissolve", text="Dissolve:")
elif (surface.surface_type == "WEIGHT"):
layout.prop(surface, "use_dissolve", text="Fade:")
col.prop(surface, "use_dissolve", text="Fade:")
else:
layout.prop(surface, "use_dissolve", text="Dissolve:")
sub = layout.column()
sub.active = surface.use_dissolve
split = sub.split(percentage=0.8)
split.prop(surface, "dissolve_speed", text="Time")
split.prop(surface, "use_dissolve_log", text="Slow")
col.prop(surface, "use_dissolve", text="Dissolve:")
col = split.column()
col.active = surface.use_dissolve
split = col.split(percentage=0.7)
col = split.column()
col.prop(surface, "dissolve_speed", text="Time")
col = split.column()
col.prop(surface, "use_dissolve_log", text="Slow")
# per type settings
if (surface.surface_type == "DISPLACE"):
layout.prop(surface, "incremental_disp")
layout.prop(surface, "use_incremental_displace")
if (surface.surface_format == "VERTEX"):
split = layout.split()
col = split.column()
col.prop(surface, "depth_clamp")
col = split.column()
col.prop(surface, "disp_factor")
col.prop(surface, "displace_factor")
if (surface.surface_type == "WAVE"):
layout.prop(surface, "wave_open_borders")
@ -173,8 +182,8 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel):
col.prop(surface, "wave_damping")
col.prop(surface, "wave_spring")
layout.label(text="Brush Group:")
layout.prop(surface, "brush_group", text="")
layout.separator()
layout.prop(surface, "brush_group", text="Brush Group")
class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Dynamic Paint Output"
@ -230,42 +239,42 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel):
# image format outputs
if (surface.surface_format == "IMAGE"):
col = layout.column()
col.label(text="UV layer:")
col.prop_search(surface, "uv_layer", ob.data, "uv_textures", text="")
col.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT')
col.prop_search(surface, "uv_layer", ob.data, "uv_textures", text="UV layer:")
layout.separator()
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_output_path", text="")
split = layout.split()
col = split.column()
col.prop(surface, "image_fileformat", text="")
col = split.column()
col.prop(surface, "premultiply", text="Premultiply alpha")
col.separator()
if (surface.surface_type == "PAINT"):
split = col.split()
split = layout.split(percentage=0.4)
col = split.column()
col.prop(surface, "do_output1", text="Output Paintmaps:")
col.prop(surface, "do_output1", text="Paintmaps:")
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, "output_name", text="")
col = layout.column()
col.prop(surface, "do_output2", text="Output Wetmaps:")
sub = col.column()
split = layout.split(percentage=0.4)
col = split.column()
col.prop(surface, "do_output2", text="Wetmaps:")
sub = split.column()
sub.active = surface.do_output2
sub.prop(surface, "output_name2", text="Filename: ")
sub.prop(surface, "output_name2", text="")
else:
col = layout.column()
col.prop(surface, "output_name", text="Filename: ")
if (surface.surface_type == "DISPLACE"):
col.prop(surface, "disp_type", text="Displace Type")
col.prop(surface, "displace_type", text="Displace Type")
col.prop(surface, "depth_clamp")
if (surface.surface_type == "WAVE"):
col.prop(surface, "depth_clamp", text="Wave Clamp")
layout.separator()
layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT')
if len(canvas.ui_info) != 0:
layout.label(text=canvas.ui_info)
class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Dynamic Paint Initial Color"
@ -297,7 +306,7 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel):
layout.prop(surface, "init_texture")
layout.prop_search(surface, "init_layername", ob.data, "uv_textures", text="UV Layer:")
if (surface.init_color_type == "VERTEXCOLOR"):
if (surface.init_color_type == "VERTEX_COLOR"):
layout.prop_search(surface, "init_layername", ob.data, "vertex_colors", text="Color Layer: ")
class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel):
@ -388,35 +397,35 @@ class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(brush, "paint_source")
if brush.paint_source == "PSYS":
col.prop_search(brush, "psys", ob, "particle_systems", text="")
if brush.psys:
if brush.paint_source == "PARTICLE_SYSTEM":
col.prop_search(brush, "particle_system", ob, "particle_systems", text="")
if brush.particle_system:
col.label(text="Particle effect:")
sub = col.column()
sub.active = not brush.use_part_radius
sub.prop(brush, "solid_radius", text="Solid Radius")
col.prop(brush, "use_part_radius", text="Use Particle's Radius")
col.prop(brush, "use_particle_radius", text="Use Particle's Radius")
col.prop(brush, "smooth_radius", text="Smooth radius")
if brush.paint_source in {'DISTANCE', 'VOLDIST', 'POINT'}:
if brush.paint_source in {'DISTANCE', 'VOLUME_DISTANCE', 'POINT'}:
col.prop(brush, "paint_distance", text="Paint Distance")
split = layout.row().split(percentage=0.4)
sub = split.column()
if brush.paint_source == 'DISTANCE':
sub.prop(brush, "prox_project")
if brush.paint_source == "VOLDIST":
sub.prop(brush, "prox_inverse")
sub.prop(brush, "proximity_project")
if brush.paint_source == "VOLUME_DISTANCE":
sub.prop(brush, "proximity_inverse")
sub = split.column()
if brush.paint_source == 'DISTANCE':
column = sub.column()
column.active = brush.prox_project
column.prop(brush, "ray_dir")
sub.prop(brush, "prox_falloff")
if brush.prox_falloff == "RAMP":
column.active = brush.proximity_project
column.prop(brush, "ray_direction")
sub.prop(brush, "proximity_falloff")
if brush.proximity_falloff == "RAMP":
col = layout.row().column()
col.separator()
col.prop(brush, "prox_ramp_alpha", text="Only Use Alpha")
col.prop(brush, "proximity_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):
@ -434,8 +443,6 @@ class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, bpy.types.Panel):
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")
@ -447,9 +454,12 @@ class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, bpy.types.Panel):
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, "do_smudge")
col = split.column()
col.active = brush.do_smudge
col.prop(brush, "smudge_strength")
class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, bpy.types.Panel):
bl_label = "Dynamic Paint Wave"

@ -110,8 +110,8 @@ void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data);
/*
* Math functions used by callbacks
*/
float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2);
float nearest_point_in_tri_surface(const float *v0,const float *v1,const float *v2,const float *p, int *v, int *e, float *nearest );
float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2);
float nearest_point_in_tri_surface(const float *v0,const float *v1,const float *v2,const float *p, int *v, int *e, float *nearest);
/*
* BVHCache

@ -14,8 +14,6 @@
#ifndef BKE_DYNAMIC_PAINT_H_
#define BKE_DYNAMIC_PAINT_H_
#include "DNA_dynamicpaint_types.h"
struct bContext;
struct wmOperator;
@ -38,11 +36,7 @@ typedef struct PaintPoint {
float e_color[3];
float e_alpha;
float wetness;
short state; /* -1 = doesn't exist (On UV mapped image
* there can be points that doesn't exist on mesh surface)
* 0 = empty or dry
* 1 = wet paint
* 2 = new paint */
short state;
float color[3];
float alpha;
} PaintPoint;
@ -52,9 +46,7 @@ typedef struct PaintWavePoint {
float height;
float velocity;
short state; /* 0 = neutral
* 1 = obstacle
* 2 = reflect only */
short state;
} PaintWavePoint;
struct DerivedMesh *dynamicPaint_Modifier_do(struct DynamicPaintModifierData *pmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm);
@ -81,17 +73,17 @@ struct DynamicPaintSurface *get_activeSurface(struct DynamicPaintCanvasSettings
/* image sequence baking */
int dynamicPaint_createUVSurface(struct DynamicPaintSurface *surface);
int dynamicPaint_calculateFrame(struct DynamicPaintSurface *surface, struct Scene *scene, struct Object *cObject, int frame);
void dynamicPaint_outputImage(struct DynamicPaintSurface *surface, char* filename, short format, short type);
void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface, char* filename, short output_layer);
/* PaintPoint state */
#define DPAINT_PAINT_NONE -1
#define DPAINT_PAINT_DRY 0
#define DPAINT_PAINT_WET 1
#define DPAINT_PAINT_NEW 2
/* surface -> image file flags */
#define DPOUTPUT_JPEG 0
#define DPOUTPUT_PNG 1
#define DPOUTPUT_OPENEXR 2
#define DPOUTPUT_PAINT 0
#define DPOUTPUT_WET 1
#define DPOUTPUT_DISPLACE 2
#define DPOUTPUT_WAVES 3
/* PaintWavePoint state */
#define DPAINT_WAVE_NONE 0
#define DPAINT_WAVE_OBSTACLE 1
#define DPAINT_WAVE_REFLECT_ONLY 2
#endif /* BKE_DYNAMIC_PAINT_H_ */

@ -50,7 +50,7 @@
/* Math stuff for ray casting on mesh faces and for nearest surface */
float ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_dist), const float *v0, const float *v1, const float *v2)
float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_dist), const float *v0, const float *v1, const float *v2)
{
float dist;
@ -458,7 +458,7 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r
{
float dist;
if(data->sphere_radius == 0.0f)
dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2);
dist = bvhtree_ray_tri_intersection(ray, hit->dist, t0, t1, t2);
else
dist = sphereray_tri_intersection(ray, data->sphere_radius, hit->dist, t0, t1, t2);

File diff suppressed because it is too large Load Diff

@ -60,7 +60,7 @@ float area_poly_v3(int nr, float verts[][3], const float normal[3]);
float dist_to_line_v2(const float p[2], const float l1[2], const float l2[2]);
float dist_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2]);
void closest_to_line_segment_v2(float *closest, float p[2], float l1[2], float l2[2]);
void closest_to_line_segment_v2(float closest[2], const float p[2], const float l1[2], const float l2[2]);
float dist_to_line_segment_v3(const float p[3], const float l1[3], const float l2[3]);
float closest_to_line_v3(float r[3], const float p[3], const float l1[3], const float l2[3]);

@ -210,7 +210,7 @@ float dist_to_line_segment_v2(const float v1[2], const float v2[2], const float
}
/* point closest to v1 on line v2-v3 in 2D */
void closest_to_line_segment_v2(float *closest, float p[2], float l1[2], float l2[2])
void closest_to_line_segment_v2(float closest[2], const float p[2], const float l1[2], const float l2[2])
{
float lambda, cp[2];

@ -4110,7 +4110,6 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
pmd->canvas = newdataadr(fd, pmd->canvas);
pmd->canvas->pmd = pmd;
pmd->canvas->dm = NULL;
pmd->canvas->ui_info[0] = '\0';
pmd->canvas->flags &= ~MOD_DPAINT_BAKING; /* just in case */
if (pmd->canvas->surfaces.first) {

@ -56,22 +56,23 @@ static int surface_slot_add_exec(bContext *C, wmOperator *op)
{
DynamicPaintModifierData *pmd = 0;
Object *cObject = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
DynamicPaintCanvasSettings *canvas;
DynamicPaintSurface *surface;
/* Make sure we're dealing with a canvas */
pmd = (DynamicPaintModifierData *)modifiers_findByType(cObject, eModifierType_DynamicPaint);
if (!pmd) return OPERATOR_CANCELLED;
if (!pmd->canvas) return OPERATOR_CANCELLED;
if (!pmd || !pmd->canvas) return OPERATOR_CANCELLED;
surface = dynamicPaint_createNewSurface(pmd->canvas, CTX_data_scene(C));
canvas = pmd->canvas;
surface = dynamicPaint_createNewSurface(canvas, CTX_data_scene(C));
if (!surface) return OPERATOR_CANCELLED;
/* set preview for this surface only and set active */
pmd->canvas->active_sur = 0;
canvas->active_sur = 0;
for(surface=surface->prev; surface; surface=surface->prev) {
surface->flags &= ~MOD_DPAINT_PREVIEW;
pmd->canvas->active_sur++;
canvas->active_sur++;
}
return OPERATOR_FINISHED;
@ -97,27 +98,28 @@ static int surface_slot_remove_exec(bContext *C, wmOperator *op)
{
DynamicPaintModifierData *pmd = 0;
Object *cObject = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
DynamicPaintCanvasSettings *canvas;
DynamicPaintSurface *surface;
int id=0;
/* Make sure we're dealing with a canvas */
pmd = (DynamicPaintModifierData *)modifiers_findByType(cObject, eModifierType_DynamicPaint);
if (!pmd) return OPERATOR_CANCELLED;
if (!pmd->canvas) return OPERATOR_CANCELLED;
if (!pmd || !pmd->canvas) return OPERATOR_CANCELLED;
surface = pmd->canvas->surfaces.first;
canvas = pmd->canvas;
surface = canvas->surfaces.first;
/* find active surface and remove it */
for(; surface; surface=surface->next) {
if(id == pmd->canvas->active_sur) {
pmd->canvas->active_sur -= 1;
if(id == canvas->active_sur) {
canvas->active_sur -= 1;
dynamicPaint_freeSurface(surface);
break;
}
id++;
}
dynamicPaint_resetPreview(pmd->canvas);
dynamicPaint_resetPreview(canvas);
DAG_id_tag_update(&cObject->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, cObject);
@ -197,42 +199,39 @@ static int output_toggle_exec(bContext *C, wmOperator *op)
Object *ob = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
Scene *scene = CTX_data_scene(C);
DynamicPaintSurface *surface;
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint);
int index= RNA_int_get(op->ptr, "index");
if (!pmd) return OPERATOR_CANCELLED;
if (!pmd || !pmd->canvas) return OPERATOR_CANCELLED;
surface = get_activeSurface(pmd->canvas);
/* if type is already enabled, toggle it off */
if (pmd->canvas) {
DynamicPaintSurface *surface = get_activeSurface(pmd->canvas);
if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
int exists = dynamicPaint_outputLayerExists(surface, ob, index);
char *name;
if (index == 0)
name = surface->output_name;
else if (index == 1)
name = surface->output_name2;
if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
int exists = dynamicPaint_outputLayerExists(surface, ob, index);
char *name;
if (index == 0)
name = surface->output_name;
else if (index == 1)
name = surface->output_name2;
/* Vertex Color Layer */
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
if (!exists)
ED_mesh_color_add(C, scene, ob, ob->data, name, 1);
else
ED_mesh_color_remove_named(C, ob, ob->data, name);
}
/* Vertex Weight Layer */
else if (surface->type == MOD_DPAINT_SURFACE_T_WEIGHT) {
if (!exists)
ED_vgroup_add_name(ob, name);
else {
bDeformGroup *defgroup = defgroup_find_name(ob, name);
if (defgroup) ED_vgroup_delete(ob, defgroup);
}
}
/* Vertex Color Layer */
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
if (!exists)
ED_mesh_color_add(C, scene, ob, ob->data, name, 1);
else
ED_mesh_color_remove_named(C, ob, ob->data, name);
}
/* Vertex Weight Layer */
else if (surface->type == MOD_DPAINT_SURFACE_T_WEIGHT) {
if (!exists)
ED_vgroup_add_name(ob, name);
else {
bDeformGroup *defgroup = defgroup_find_name(ob, name);
if (defgroup) ED_vgroup_delete(ob, defgroup);
}
}
}
return OPERATOR_FINISHED;
@ -275,11 +274,9 @@ static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surf
int frames;
frames = surface->end_frame - surface->start_frame + 1;
if (frames <= 0) {sprintf(canvas->error, "No frames to bake.");printf("DynamicPaint bake failed: %s", canvas->error);return 0;}
if (frames <= 0) {BLI_strncpy(canvas->error, "No frames to bake.", sizeof(canvas->error)); return 0;}
/*
* Set frame to start point (also inits modifier data)
*/
/* Set frame to start point (also inits modifier data) */
frame = surface->start_frame;
scene->r.cfra = (int)frame;
ED_update_for_newframe(CTX_data_main(C), scene, win->screen, 1);
@ -287,9 +284,7 @@ static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surf
/* Init surface */
if (!dynamicPaint_createUVSurface(surface)) return 0;
/*
* Loop through selected frames
*/
/* Loop through selected frames */
for (frame=surface->start_frame; frame<=surface->end_frame; frame++)
{
float progress = (frame - surface->start_frame) / (float)frames * 100;
@ -300,7 +295,6 @@ static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surf
/* Update progress bar cursor */
WM_timecursor(win, (int)progress);
printf("DynamicPaint: Baking frame %i\n", frame);
/* calculate a frame */
scene->r.cfra = (int)frame;
@ -311,48 +305,25 @@ static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surf
* Save output images
*/
{
char filename[250];
char pad[4];
char dir_slash[2];
/* OpenEXR or PNG */
short format = (surface->image_fileformat & MOD_DPAINT_IMGFORMAT_OPENEXR) ? DPOUTPUT_OPENEXR : DPOUTPUT_PNG;
char filename[FILE_MAX];
/* make sure output path has ending slash */
BLI_add_slash(surface->image_output_path);
/* Add frame number padding */
if (frame<10) sprintf(pad,"000");
else if (frame<100) sprintf(pad,"00");
else if (frame<1000) sprintf(pad,"0");
else pad[0] = '\0';
/* make sure directory path is valid to append filename */
if (surface->image_output_path[strlen(surface->image_output_path)-1] != 47 &&
surface->image_output_path[strlen(surface->image_output_path)-1] != 92)
strcpy(dir_slash,"/");
else
dir_slash[0] = '\0';
/* color map */
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
if (surface->flags & MOD_DPAINT_OUT1) {
BLI_snprintf(filename, sizeof(filename), "%s%s%s%s%i", surface->image_output_path, dir_slash, surface->output_name, pad, (int)frame);
dynamicPaint_outputImage(surface, filename, format, DPOUTPUT_PAINT);
}
if (surface->flags & MOD_DPAINT_OUT2) {
BLI_snprintf(filename, sizeof(filename), "%s%s%s%s%i", surface->image_output_path, dir_slash, surface->output_name2, pad, (int)frame);
dynamicPaint_outputImage(surface, filename, format, DPOUTPUT_WET);
}
/* primary output layer */
if (surface->flags & MOD_DPAINT_OUT1) {
/* set filepath */
BLI_snprintf(filename, sizeof(filename), "%s%s", surface->image_output_path, surface->output_name);
BLI_path_frame(filename, frame, 4);
/* save image */
dynamicPaint_outputSurfaceImage(surface, filename, 0);
}
/* displacement map */
else if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE) {
BLI_snprintf(filename, sizeof(filename), "%s%s%s%s%i", surface->image_output_path, dir_slash, surface->output_name, pad, (int)frame);
dynamicPaint_outputImage(surface, filename, format, DPOUTPUT_DISPLACE);
}
/* waves */
else if (surface->type == MOD_DPAINT_SURFACE_T_WAVE) {
BLI_snprintf(filename, sizeof(filename), "%s%s%s%s%i", surface->image_output_path, dir_slash, surface->output_name, pad, (int)frame);
dynamicPaint_outputImage(surface, filename, format, DPOUTPUT_WAVES);
/* secondary output */
if (surface->flags & MOD_DPAINT_OUT2 && surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
/* set filepath */
BLI_snprintf(filename, sizeof(filename), "%s%s", surface->image_output_path, surface->output_name2);
BLI_path_frame(filename, frame, 4);
/* save image */
dynamicPaint_outputSurfaceImage(surface, filename, 1);
}
}
}
@ -370,6 +341,7 @@ int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
Object *ob = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
int status = 0;
double timer = PIL_check_seconds_timer();
char result_str[80];
DynamicPaintSurface *surface;
/*
@ -397,35 +369,31 @@ int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
/* Bake Dynamic Paint */
status = dynamicPaint_bakeImageSequence(C, surface, ob);
/* Clear bake */
pmd->canvas->flags &= ~MOD_DPAINT_BAKING;
canvas->flags &= ~MOD_DPAINT_BAKING;
WM_cursor_restore(CTX_wm_window(C));
dynamicPaint_freeSurfaceData(surface);
/* Bake was successful:
* Report for ended bake and how long it took */
if (status) {
/* Format time string */
char timestr[30];
char time_str[30];
double time = PIL_check_seconds_timer() - timer;
BLI_timestr(time, timestr);
BLI_timestr(time, time_str);
/* Show bake info */
BLI_snprintf(canvas->ui_info, sizeof(canvas->ui_info), "Bake Complete! (%s)", timestr);
printf("%s\n", canvas->ui_info);
BLI_snprintf(result_str, sizeof(result_str), "Bake Complete! (%s)", time_str);
BKE_report(op->reports, RPT_INFO, result_str);
}
else {
if (strlen(pmd->canvas->error)) { /* If an error occured */
BLI_snprintf(canvas->ui_info, sizeof(canvas->ui_info), "Bake Failed: %s", pmd->canvas->error);
BKE_report(op->reports, RPT_ERROR, canvas->ui_info);
if (strlen(canvas->error)) { /* If an error occured */
BLI_snprintf(result_str, sizeof(result_str), "Bake Failed: %s", canvas->error);
BKE_report(op->reports, RPT_ERROR, result_str);
}
else { /* User cancelled the bake */
sprintf(pmd->canvas->ui_info, "Baking Cancelled!");
BKE_report(op->reports, RPT_WARNING, canvas->ui_info);
BLI_strncpy(result_str, "Baking Cancelled!", sizeof(result_str));
BKE_report(op->reports, RPT_WARNING, result_str);
}
/* Print failed bake to console */
printf("Baking Cancelled!\n");
}
return status;

@ -2695,7 +2695,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
if ((md = modifiers_findByType(ob, eModifierType_DynamicPaint)))
{
/* check if target has an active dp modifier */
if(md && md->mode & (eModifierMode_Realtime | eModifierMode_Render))
if(md && (md->mode & eModifierMode_Realtime))
{
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
/* if canvas is ready to preview vertex colors */

@ -129,9 +129,7 @@ typedef struct DynamicPaintCanvasSettings {
short active_sur, flags;
int pad;
char ui_info[128]; // UI info text
char error[64]; // Bake error description
char error[64]; /* Bake error description */
} DynamicPaintCanvasSettings;

@ -316,7 +316,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
{MOD_DPAINT_INITIAL_NONE, "NONE", 0, "None", ""},
{MOD_DPAINT_INITIAL_COLOR, "COLOR", ICON_COLOR, "Color", ""},
{MOD_DPAINT_INITIAL_TEXTURE, "TEXTURE", ICON_TEXTURE, "UV Texture", ""},
{MOD_DPAINT_INITIAL_VERTEXCOLOR, "VERTEXCOLOR", ICON_GROUP_VCOL, "Vertex Color", ""},
{MOD_DPAINT_INITIAL_VERTEXCOLOR, "VERTEX_COLOR", ICON_GROUP_VCOL, "Vertex Color", ""},
{0, NULL, 0, NULL, NULL}};
/* Effect type
@ -336,7 +336,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
/* Displacemap type */
static EnumPropertyItem prop_dynamicpaint_disp_type[] = {
static EnumPropertyItem prop_dynamicpaint_displace_type[] = {
{MOD_DPAINT_DISP_DISPLACE, "DISPLACE", 0, "Displacement", ""},
{MOD_DPAINT_DISP_DEPTH, "DEPTH", 0, "Depth", ""},
{0, NULL, 0, NULL, NULL}};
@ -387,7 +387,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
/*
* Paint, wet and disp
* Paint, wet and displace
*/
prop= RNA_def_property(srna, "use_dissolve", PROP_BOOLEAN, PROP_NONE);
@ -419,26 +419,29 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "UV Layer", "UV layer name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DynamicPaint_uvlayer_set");
prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "start_frame");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1.0, 9999.0);
RNA_def_property_ui_range(prop, 1.0, 9999, 1, 0);
RNA_def_property_ui_text(prop, "Start Frame", "Simulation start frame");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames");
prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "end_frame");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1.0, 9999.0);
RNA_def_property_ui_range(prop, 1.0, 9999.0, 1, 0);
RNA_def_property_ui_text(prop, "End Frame", "Simulation end frame");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames");
prop= RNA_def_property(srna, "substeps", PROP_INT, PROP_NONE);
prop= RNA_def_property(srna, "frame_substeps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "substeps");
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_range(prop, 0.0, 10, 1, 0);
RNA_def_property_ui_text(prop, "Sub-Steps", "Do extra frames between scene frames to ensure smooth motion");
prop= RNA_def_property(srna, "use_anti_aliasing", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ANTIALIAS);
RNA_def_property_ui_text(prop, "Anti-aliasing", "Use 5x multisampling to smoothen paint edges");
@ -556,12 +559,12 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
prop= RNA_def_property(srna, "do_output1", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT1);
RNA_def_property_ui_text(prop, "Save layer", "");
RNA_def_property_ui_text(prop, "Save layer", "Output name");
/* output for secondary sufrace data */
prop= RNA_def_property(srna, "output_name2", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "output_name2");
RNA_def_property_ui_text(prop, "Output name", "");
RNA_def_property_ui_text(prop, "Output name", "Output name");
prop= RNA_def_property(srna, "do_output2", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT2);
@ -592,7 +595,8 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Max Displace", "Maximum level of depth intersection in object space. Use 0.0 to disable");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "disp_factor", PROP_FLOAT, PROP_NONE);
prop= RNA_def_property(srna, "displace_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "disp_factor");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, -50.0, 50.0);
RNA_def_property_ui_range(prop, -5.0, 5.0, 1, 2);
@ -604,12 +608,13 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_dynamicpaint_image_fileformat);
RNA_def_property_ui_text(prop, "File Format", "");
prop= RNA_def_property(srna, "disp_type", PROP_ENUM, PROP_NONE);
prop= RNA_def_property(srna, "displace_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "disp_type");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, prop_dynamicpaint_disp_type);
RNA_def_property_enum_items(prop, prop_dynamicpaint_displace_type);
RNA_def_property_ui_text(prop, "Data Type", "");
prop= RNA_def_property(srna, "incremental_disp", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use_incremental_displace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISP_INCREMENTAL);
RNA_def_property_ui_text(prop, "Incremental", "New displace is added cumulatively on top of existing");
@ -672,10 +677,6 @@ static void rna_def_dynamic_paint_canvas_settings(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "DynamicPaintSurface");
RNA_def_property_ui_text(prop, "Paint Surface List", "Paint surface list");
rna_def_canvas_surfaces(brna, prop);
prop= RNA_def_property(srna, "ui_info", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bake Info", "Info on bake status");
}
static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
@ -685,10 +686,10 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
/* paint collision type */
static EnumPropertyItem prop_dynamicpaint_collisiontype[] = {
{MOD_DPAINT_COL_PSYS, "PSYS", ICON_PARTICLES, "Particle System", ""},
{MOD_DPAINT_COL_PSYS, "PARTICLE_SYSTEM", ICON_PARTICLES, "Particle System", ""},
{MOD_DPAINT_COL_POINT, "POINT", ICON_META_EMPTY, "Object Center", ""},
{MOD_DPAINT_COL_DIST, "DISTANCE", ICON_META_EMPTY, "Proximity", ""},
{MOD_DPAINT_COL_VOLDIST, "VOLDIST", ICON_META_CUBE, "Mesh Volume + Proximity", ""},
{MOD_DPAINT_COL_VOLDIST, "VOLUME_DISTANCE", ICON_META_CUBE, "Mesh Volume + Proximity", ""},
{MOD_DPAINT_COL_VOLUME, "VOLUME", ICON_MESH_CUBE, "Mesh Volume", ""},
{0, NULL, 0, NULL, NULL}};
@ -707,7 +708,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
static EnumPropertyItem prop_dynamicpaint_brush_ray_dir[] = {
{MOD_DPAINT_RAY_CANVAS, "CANVAS", 0, "Canvas Normal", ""},
{MOD_DPAINT_RAY_BRUSH_AVG, "BRUSH", 0, "Brush Normal", ""},
{MOD_DPAINT_RAY_ZPLUS, "ZPLUS", 0, "Z-Axis", ""},
{MOD_DPAINT_RAY_ZPLUS, "Z_AXIS", 0, "Z-Axis", ""},
{0, NULL, 0, NULL, NULL}};
srna = RNA_def_struct(brna, "DynamicPaintBrushSettings", NULL);
@ -722,22 +723,25 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Paint Color", "Color of the paint");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
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, 5, 2);
RNA_def_property_ui_text(prop, "Paint Alpha", "Paint alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_MATERIAL);
RNA_def_property_ui_text(prop, "Use object material", "Use object material to define color and influence");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mat");
RNA_def_property_ui_text(prop, "Material", "Material to use. If not defined, material linked to the mesh is used");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "absolute_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ABS_ALPHA);
@ -748,10 +752,12 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
RNA_def_property_ui_text(prop, "Paint Wetness", "Paint wetness. Visible in wetmap. Some effects only affect wet paint");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "paint_erase", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ERASE);
RNA_def_property_ui_text(prop, "Erase Paint", "Erase / remove paint instead of adding it");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@ -785,14 +791,17 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "velocity_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_ALPHA);
RNA_def_property_ui_text(prop, "Multiply Alpha", "Multiply brush influence by velocity color ramp alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "velocity_depth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_DEPTH);
RNA_def_property_ui_text(prop, "Multiply Depth", "Multiply brush intersection depth (displace, waves) by velocity ramp alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "velocity_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_COLOR);
RNA_def_property_ui_text(prop, "Replace Color", "Replace brush color by velocity color ramp");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
/*
* Paint Area / Collision
@ -802,41 +811,48 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "collision");
RNA_def_property_enum_items(prop, prop_dynamicpaint_collisiontype);
RNA_def_property_ui_text(prop, "Paint Source", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "paint_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "paint_distance");
RNA_def_property_range(prop, 0.0, 500.0);
RNA_def_property_ui_range(prop, 0.0, 500.0, 10, 3);
RNA_def_property_ui_text(prop, "Proximity Distance", "Maximum distance from brush to mesh surface to affect paint");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "prox_ramp_alpha", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "proximity_ramp_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_RAMP_ALPHA);
RNA_def_property_ui_text(prop, "Only Use Alpha", "Only reads color ramp alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "prox_falloff", PROP_ENUM, PROP_NONE);
prop= RNA_def_property(srna, "proximity_falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "proximity_falloff");
RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff);
RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "prox_project", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "proximity_project", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PROX_PROJECT);
RNA_def_property_ui_text(prop, "Project", "Brush is projected to canvas from defined direction within brush proximity");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "ray_dir", PROP_ENUM, PROP_NONE);
prop= RNA_def_property(srna, "ray_direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ray_dir");
RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_ray_dir);
RNA_def_property_ui_text(prop, "Ray Dir", "Defines ray direction to use for projection. If brush object is located in that direction it's painted");
RNA_def_property_ui_text(prop, "Ray Direction", "Defines ray direction to use for projection. If brush object is located in that direction it's painted");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "prox_inverse", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "proximity_inverse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_INVERSE_PROX);
RNA_def_property_ui_text(prop, "Inner Proximity", "Proximity falloff is applied inside the volume");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
/*
* Particle
*/
prop= RNA_def_property(srna, "psys", PROP_POINTER, PROP_NONE);
prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "psys");
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_flag(prop, PROP_EDITABLE);
@ -844,21 +860,24 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_resetDependancy");
prop= RNA_def_property(srna, "use_part_radius", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use_particle_radius", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PART_RAD);
RNA_def_property_ui_text(prop, "Use Particle Radius", "Uses radius from particle settings");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "solid_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "particle_radius");
RNA_def_property_range(prop, 0.01, 10.0);
RNA_def_property_ui_range(prop, 0.01, 2.0, 5, 3);
RNA_def_property_ui_text(prop, "Solid Radius", "Radius that will be painted solid");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "smooth_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "particle_smooth");
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 0);
RNA_def_property_ui_text(prop, "Smooth Radius", "Smooth falloff added after solid radius");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
/*
@ -868,11 +887,13 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "paint_ramp");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Paint Color Ramp", "Color ramp used to define proximity falloff");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vel_ramp");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Velocity Color Ramp", "Color ramp used to define brush velocity effect");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
}
void RNA_def_dynamic_paint(BlenderRNA *brna)

@ -14,6 +14,7 @@
#include <stddef.h>
#include "DNA_dynamicpaint_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"

@ -124,7 +124,6 @@ int multitex_ext(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osa
int multitex_ext_safe(struct Tex *tex, float *texvec, struct TexResult *texres){return 0;}
int multitex_nodes(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres, short thread, short which_output, struct ShadeInput *shi, struct MTex *mtex) {return 0;}
/* material_ext.c */
struct Material *RE_init_sample_material(struct Material *orig_mat, struct Scene *scene) {return (struct Material *)NULL;}
void RE_free_sample_material(struct Material *mat) {}
void RE_sample_material_color(struct Material *mat, float color[3], float *alpha, const float volume_co[3], const float surface_co[3],