Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py10
-rw-r--r--source/blender/blenkernel/BKE_customdata.h2
-rw-r--r--source/blender/blenkernel/BKE_dynamicpaint.h17
-rw-r--r--source/blender/blenkernel/intern/customdata.c19
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c583
-rw-r--r--source/blender/blenlib/BLI_kdtree.h7
-rw-r--r--source/blender/blenlib/intern/BLI_kdtree.c7
-rw-r--r--source/blender/editors/physics/dynamicpaint_ops.c243
-rw-r--r--source/blender/makesdna/DNA_dynamicpaint_types.h7
-rw-r--r--source/blender/makesrna/intern/rna_dynamicpaint.c110
-rw-r--r--source/blender/makesrna/intern/rna_space.c2
-rw-r--r--source/blender/modifiers/intern/MOD_dynamicpaint.c2
-rw-r--r--source/blender/modifiers/intern/MOD_util.c21
-rw-r--r--source/blender/modifiers/intern/MOD_util.h1
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c2
-rw-r--r--source/blender/modifiers/intern/MOD_wave.c2
-rw-r--r--source/blenderplayer/bad_level_call_stubs/stubs.c5
17 files changed, 517 insertions, 523 deletions
diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
index 21f220b27f6..4c59ed85639 100644
--- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
+++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
@@ -183,8 +183,13 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel):
# per type settings
if (surface.surface_type == "DISPLACE"):
- layout.prop(surface, "disp_clamp")
layout.prop(surface, "incremental_disp")
+ if (surface.surface_format == "VERTEX"):
+ split = layout.split()
+ col = split.column()
+ col.prop(surface, "depth_clamp")
+ col = split.column()
+ col.prop(surface, "disp_factor")
if (surface.surface_type == "WAVE"):
layout.prop(surface, "wave_open_borders")
@@ -284,6 +289,9 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel):
col.prop(surface, "output_name", text="Filename: ")
if (surface.surface_type == "DISPLACE"):
col.prop(surface, "disp_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')
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index c30100ea55a..23e79fbd73a 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -280,6 +280,8 @@ const char *CustomData_layertype_name(int type);
/* make sure the name of layer at index is unique */
void CustomData_set_layer_unique_name(struct CustomData *data, int index);
+void CustomData_validate_layer_name(const struct CustomData *data, int type, char *name, char *outname);
+
/* for file reading compatibility, returns false if the layer was freed,
only after this test passes, layer->data should be assigned */
int CustomData_verify_versions(struct CustomData *data, int index);
diff --git a/source/blender/blenkernel/BKE_dynamicpaint.h b/source/blender/blenkernel/BKE_dynamicpaint.h
index 26ad3c294eb..fe45c6580fe 100644
--- a/source/blender/blenkernel/BKE_dynamicpaint.h
+++ b/source/blender/blenkernel/BKE_dynamicpaint.h
@@ -70,6 +70,7 @@ int dynamicPaint_resetSurface(struct DynamicPaintSurface *surface);
void dynamicPaint_freeSurface(struct DynamicPaintSurface *surface);
void dynamicPaint_freeCanvas(struct DynamicPaintModifierData *pmd);
void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd);
+void dynamicPaint_freeSurfaceData(struct DynamicPaintSurface *surface);
void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface);
int dynamicPaint_surfaceHasColorPreview(struct DynamicPaintSurface *surface);
@@ -79,6 +80,20 @@ void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, char
void dynamicPaint_resetPreview(struct DynamicPaintCanvasSettings *canvas);
struct DynamicPaintSurface *get_activeSurface(struct DynamicPaintCanvasSettings *canvas);
-int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op);
+/* 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);
+
+
+/* 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
#endif /* BKE_DYNAMIC_PAINT_H_ */
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 30da2e01011..b0c52421dd9 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -2353,6 +2353,25 @@ void CustomData_set_layer_unique_name(CustomData *data, int index)
BLI_uniquename_cb(customdata_unique_check, &data_arg, typeInfo->defaultname, '.', nlayer->name, sizeof(nlayer->name));
}
+void CustomData_validate_layer_name(const CustomData *data, int type, char *name, char *outname)
+{
+ int index = -1;
+
+ /* if a layer name was given, try to find that layer */
+ if(name[0])
+ index = CustomData_get_named_layer_index(data, type, name);
+
+ if(index < 0) {
+ /* either no layer was specified, or the layer we want has been
+ * deleted, so assign the active layer to name
+ */
+ index = CustomData_get_active_layer_index(data, type);
+ strcpy(outname, data->layers[index].name);
+ }
+ else
+ strcpy(outname, name);
+}
+
int CustomData_verify_versions(struct CustomData *data, int index)
{
const LayerTypeInfo *typeInfo;
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 42462ab7955..fc2302f0fbe 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -22,9 +22,6 @@
#include "BLI_kdtree.h"
#include "BLI_utildefines.h"
-/* Platform independend time */
-#include "PIL_time.h"
-
#include "DNA_anim_types.h"
#include "DNA_dynamicpaint_types.h"
#include "DNA_group_types.h" /*GroupObject*/
@@ -54,7 +51,6 @@
#include "BKE_object.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
-#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_texture.h"
@@ -62,17 +58,10 @@
#include "RNA_define.h"
#include "RNA_enum_types.h"
-#include "../editors/include/ED_screen.h"
-#include "WM_api.h"
-
/* for image output */
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "BKE_image.h"
-#include "intern/IMB_filetype.h"
-#ifdef WITH_OPENEXR
-#include "intern/openexr/openexr_api.h"
-#endif
/* uv validate */
#include "intern/MOD_util.h"
@@ -90,30 +79,38 @@
#include <omp.h>
#endif
-#define DPOUTPUT_JPEG 0
-#define DPOUTPUT_PNG 1
-#define DPOUTPUT_OPENEXR 2
-
-struct Object;
-struct Scene;
-struct DerivedMesh;
-
/* precalculated gaussian factors for 5x super sampling */
-float gaussianFactors[5] = { 0.996849f,
+static float gaussianFactors[5] = { 0.996849f,
0.596145f,
0.596145f,
0.596145f,
0.524141f};
-float gaussianTotal = 3.309425f;
+static float gaussianTotal = 3.309425f;
-/*
-* UV Image neighbouring pixel table x and y list
-*/
-int neighX[8] = {1,1,0,-1,-1,-1, 0, 1};
-int neighY[8] = {0,1,1, 1, 0,-1,-1,-1};
+/* UV Image neighbouring pixel table x and y list */
+static int neighX[8] = {1,1,0,-1,-1,-1, 0, 1};
+static int neighY[8] = {0,1,1, 1, 0,-1,-1,-1};
+
+/* subframe_updateObject() flags */
+#define UPDATE_PARENTS (1<<0)
+#define UPDATE_MESH (1<<1)
+#define UPDATE_EVERYTHING (UPDATE_PARENTS|UPDATE_MESH)
+/* surface_getBrushFlags() return vals */
+#define BRUSH_USES_VELOCITY (1<<0)
+/* brush mesh raycast status */
+#define HIT_VOLUME 1
+#define HIT_PROXIMITY 2
+/* paint effect default movement per frame in global units */
+#define EFF_MOVEMENT_PER_FRAME 0.05f
+/* initial wave time factor */
+#define WAVE_TIME_FAC 0.1
+/* vector macros */
+#define VECADDVAL(v,val) {*(v)+=(val); *(v+1)+=(val); *(v+2)+=(val);}
+#define VECMULVAL(v,val) {*(v)*=(val); *(v+1)*=(val); *(v+2)*=(val);}
+/* dissolve macro */
+#define VALUE_DISSOLVE(VALUE, SPEED, SCALE, LOG) (VALUE) = (LOG) ? (VALUE) * 1.0f - 1.0f/((SPEED)/(SCALE)) : (VALUE) - 1.0f/(SPEED)*(SCALE)
static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *surface, float timescale, float subframe);
-static int dynamicPaint_calculateFrame(DynamicPaintSurface *surface, Scene *scene, Object *cObject, int frame);
/***************************** Internal Structs ***************************/
@@ -127,7 +124,7 @@ typedef struct Bounds3D {
} Bounds3D;
typedef struct VolumeGrid {
- int x,y,z;
+ int dim[3];
Bounds3D grid_bounds; /* whole grid bounds */
Bounds3D *bounds; /* (x*y*z) precalculated grid cell bounds */
@@ -373,13 +370,13 @@ void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface)
surface->output_name[0]='\0';
surface->output_name2[0]='\0';
surface->flags |= MOD_DPAINT_ANTIALIAS;
- surface->disp_clamp = 1.0f;
+ surface->depth_clamp = 1.0f;
}
else {
sprintf(surface->output_name, "dp_");
strcpy(surface->output_name2,surface->output_name);
surface->flags &= ~MOD_DPAINT_ANTIALIAS;
- surface->disp_clamp = 0.0f;
+ surface->depth_clamp = 0.0f;
}
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
@@ -456,13 +453,8 @@ static void object_cacheIgnoreClear(Object *ob, int state)
BLI_freelistN(&pidlist);
}
-#define UPDATE_PARENTS (1<<0)
-#define UPDATE_MESH (1<<1)
-#define UPDATE_EVERYTHING (UPDATE_PARENTS|UPDATE_MESH)
-
static void subframe_updateObject(Scene *scene, Object *ob, int flags, float frame)
{
- int oflags;
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint);
/* if other is dynamic paint canvas, dont update */
@@ -473,17 +465,13 @@ static void subframe_updateObject(Scene *scene, Object *ob, int flags, float fra
if ((flags & UPDATE_PARENTS) && ob->parent) subframe_updateObject(scene, ob->parent, 0, frame);
if ((flags & UPDATE_PARENTS) && ob->track) subframe_updateObject(scene, ob->track, 0, frame);
- /* for curve */
+ /* for curve following objects, parented curve has to be updated too */
if(ob->type==OB_CURVE) {
Curve *cu= ob->data;
BKE_animsys_evaluate_animdata(scene, &cu->id, cu->adt, frame, ADT_RECALC_ANIM);
}
-
- /* backup object flags */
- oflags = ob->recalc;
ob->recalc |= OB_RECALC_ALL;
- ob->recalc |= OB_RECALC_DATA;
BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, frame, ADT_RECALC_ANIM);
if (flags & UPDATE_MESH) {
/* ignore cache clear during subframe updates
@@ -494,9 +482,6 @@ static void subframe_updateObject(Scene *scene, Object *ob, int flags, float fra
}
else
where_is_object_time(scene, ob, frame);
-
- /* restore object flags */
- ob->recalc = oflags;
}
static void scene_setSubframe(Scene *scene, float subframe)
@@ -645,72 +630,65 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface)
/* allocate separate bounds for each thread */
grid_bounds = MEM_callocN(sizeof(Bounds3D)*num_of_threads, "Grid Bounds");
-
bData->grid = MEM_callocN(sizeof(VolumeGrid), "Surface Grid");
grid = bData->grid;
if (grid && grid_bounds) {
- int index, error = 0;
+ int i, error = 0;
float dim_factor, volume, dim[3];
- float tx,ty,tz;
+ float td[3];
float min_dim;
/* calculate canvas dimensions */
#ifdef _OPENMP
#pragma omp parallel for schedule(static)
#endif
- for (index = 0; index < sData->total_points; index++) {
-#ifdef _OPENMP
+ for (i=0; i<sData->total_points; i++) {
+ #ifdef _OPENMP
int id = omp_get_thread_num();
- boundInsert(&grid_bounds[id], (bData->realCoord[bData->s_pos[index]].v));
-#else
- boundInsert(&grid_bounds[0], (bData->realCoord[bData->s_pos[index]].v));
-#endif
+ boundInsert(&grid_bounds[id], (bData->realCoord[bData->s_pos[i]].v));
+ #else
+ boundInsert(&grid_bounds[0], (bData->realCoord[bData->s_pos[i]].v));
+ #endif
}
/* get final dimensions */
- for (index = 0; index<num_of_threads; index++) {
- boundInsert(&grid->grid_bounds, grid_bounds[index].min);
- boundInsert(&grid->grid_bounds, grid_bounds[index].max);
+ for (i=0; i<num_of_threads; i++) {
+ boundInsert(&grid->grid_bounds, grid_bounds[i].min);
+ boundInsert(&grid->grid_bounds, grid_bounds[i].max);
}
- dim[0] = grid->grid_bounds.max[0]-grid->grid_bounds.min[0];
- dim[1] = grid->grid_bounds.max[1]-grid->grid_bounds.min[1];
- dim[2] = grid->grid_bounds.max[2]-grid->grid_bounds.min[2];
-
- tx = dim[0];
- ty = dim[1];
- tz = dim[2];
- min_dim = MAX3(tx,ty,tz) / 1000.f;
+ /* get dimensions */
+ sub_v3_v3v3(dim, grid->grid_bounds.max, grid->grid_bounds.min);
+ copy_v3_v3(td, dim);
+ min_dim = MAX3(td[0],td[1],td[2]) / 1000.f;
/* deactivate zero axises */
- if (tx<min_dim) {tx=1.0f; axis-=1;}
- if (ty<min_dim) {ty=1.0f; axis-=1;}
- if (tz<min_dim) {tz=1.0f; axis-=1;}
+ for (i=0; i<3; i++) {
+ if (td[i]<min_dim) {td[i]=1.0f; axis-=1;}
+ }
- if (axis == 0 || MAX3(tx,ty,tz) < 0.0001f)
+ if (axis == 0 || MAX3(td[0],td[1],td[2]) < 0.0001f) {
+ MEM_freeN(grid_bounds);
+ MEM_freeN(bData->grid);
+ bData->grid = NULL;
return;
+ }
/* now calculate grid volume/area/width depending on num of active axis */
- volume = tx*ty*tz;
+ volume = td[0]*td[1]*td[2];
/* determine final grid size by trying to fit average 10.000 points per grid cell */
dim_factor = pow(volume / ((double)sData->total_points / 10000.f), 1.0f/axis);
/* define final grid size using dim_factor, use min 3 for active axises */
- grid->x = (int)floor(tx / dim_factor);
- CLAMP(grid->x, (dim[0]>=min_dim) ? 3 : 1, 100);
- grid->y = (int)floor(ty / dim_factor);
- CLAMP(grid->y, (dim[1]>=min_dim) ? 3 : 1, 100);
- grid->z = (int)floor(tz / dim_factor);
- CLAMP(grid->z, (dim[2]>=min_dim) ? 3 : 1, 100);
-
- grid_cells = grid->x*grid->y*grid->z;
-
- //printf("final grid size %i,%i,%i\n", grid->x, grid->y, grid->z);
+ for (i=0; i<3; i++) {
+ grid->dim[i] = (int)floor(td[i] / dim_factor);
+ CLAMP(grid->dim[i], (dim[i]>=min_dim) ? 3 : 1, 100);
+ }
+ grid_cells = grid->dim[0]*grid->dim[1]*grid->dim[2];
/* allocate memory for grids */
-
grid->bounds = MEM_callocN(sizeof(Bounds3D) * grid_cells, "Surface Grid Bounds");
grid->s_pos = MEM_callocN(sizeof(int) * grid_cells, "Surface Grid Position");
grid->s_num = MEM_callocN(sizeof(int) * grid_cells*num_of_threads, "Surface Grid Points");
@@ -718,6 +696,7 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface)
grid->t_index = MEM_callocN(sizeof(int) * sData->total_points, "Surface Grid Target Ids");
temp_t_index = MEM_callocN(sizeof(int) * sData->total_points, "Temp Surface Grid Target Ids");
+ /* in case of an allocation failture abort here */
if (!grid->bounds || !grid->s_pos || !grid->s_num || !grid->t_index || !temp_s_num || !temp_t_index)
error = 1;
@@ -726,43 +705,41 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface)
#ifdef _OPENMP
#pragma omp parallel for schedule(static)
#endif
- for (index = 0; index < sData->total_points; index++) {
- int x,y,z;
- x = floor((bData->realCoord[bData->s_pos[index]].v[0] - grid->grid_bounds.min[0])/dim[0]*grid->x);
- CLAMP(x, 0, grid->x-1);
- y = floor((bData->realCoord[bData->s_pos[index]].v[1] - grid->grid_bounds.min[1])/dim[1]*grid->y);
- CLAMP(y, 0, grid->y-1);
- z = floor((bData->realCoord[bData->s_pos[index]].v[2] - grid->grid_bounds.min[2])/dim[2]*grid->z);
- CLAMP(z, 0, grid->z-1);
-
- temp_t_index[index] = x + y * grid->x + z * grid->x*grid->y;
-#ifdef _OPENMP
- grid->s_num[temp_t_index[index]+omp_get_thread_num()*grid_cells]++;
-#else
- grid->s_num[temp_t_index[index]]++;
-#endif
+ for (i=0; i<sData->total_points; i++) {
+ int co[3], j;
+ for (j=0; j<3; j++) {
+ co[j] = floor((bData->realCoord[bData->s_pos[i]].v[j] - grid->grid_bounds.min[j])/dim[j]*grid->dim[j]);
+ CLAMP(co[j], 0, grid->dim[j]-1);
+ }
+
+ temp_t_index[i] = co[0] + co[1] * grid->dim[0] + co[2] * grid->dim[0]*grid->dim[1];
+ #ifdef _OPENMP
+ grid->s_num[temp_t_index[i]+omp_get_thread_num()*grid_cells]++;
+ #else
+ grid->s_num[temp_t_index[i]]++;
+ #endif
}
/* for first cell only calc s_num */
- for (index = 1; index<num_of_threads; index++) {
- grid->s_num[0] += grid->s_num[index*grid_cells];
+ for (i=1; i<num_of_threads; i++) {
+ grid->s_num[0] += grid->s_num[i*grid_cells];
}
/* calculate grid indexes */
- for (index = 1; index < grid_cells; index++) {
+ for (i=1; i<grid_cells; i++) {
int id;
- for (id = 1; id<num_of_threads; id++) {
- grid->s_num[index] += grid->s_num[index+id*grid_cells];
+ for (id=1; id<num_of_threads; id++) {
+ grid->s_num[i] += grid->s_num[i+id*grid_cells];
}
- grid->s_pos[index] = grid->s_pos[index-1] + grid->s_num[index-1];
+ grid->s_pos[i] = grid->s_pos[i-1] + grid->s_num[i-1];
}
/* save point indexes to final array */
- for (index = 0; index < sData->total_points; index++) {
- int pos = grid->s_pos[temp_t_index[index]] + temp_s_num[temp_t_index[index]];
- grid->t_index[pos] = index;
+ for (i=0; i<sData->total_points; i++) {
+ int pos = grid->s_pos[temp_t_index[i]] + temp_s_num[temp_t_index[i]];
+ grid->t_index[pos] = i;
- temp_s_num[temp_t_index[index]]++;
+ temp_s_num[temp_t_index[i]]++;
}
/* calculate cell bounds */
@@ -771,22 +748,18 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface)
#ifdef _OPENMP
#pragma omp parallel for schedule(static)
#endif
- for (x=0; x<grid->x; x++) {
+ for (x=0; x<grid->dim[0]; x++) {
int y;
- for (y=0; y<grid->y; y++) {
+ for (y=0; y<grid->dim[1]; y++) {
int z;
- for (z=0; z<grid->z; z++) {
- int b_index = x + y * grid->x + z * grid->x*grid->y;
-
+ for (z=0; z<grid->dim[2]; z++) {
+ int j, b_index = x + y * grid->dim[0] + z * grid->dim[0]*grid->dim[1];
/* set bounds */
- grid->bounds[b_index].min[0] = grid->grid_bounds.min[0] + dim[0]/grid->x*x;
- grid->bounds[b_index].min[1] = grid->grid_bounds.min[1] + dim[1]/grid->y*y;
- grid->bounds[b_index].min[2] = grid->grid_bounds.min[2] + dim[2]/grid->z*z;
-
- grid->bounds[b_index].max[0] = grid->grid_bounds.min[0] + dim[0]/grid->x*(x+1);
- grid->bounds[b_index].max[1] = grid->grid_bounds.min[1] + dim[1]/grid->y*(y+1);
- grid->bounds[b_index].max[2] = grid->grid_bounds.min[2] + dim[2]/grid->z*(z+1);
-
+ for (j=0; j<3; j++) {
+ int s = (j==0) ? x : ((j==1) ? y : z);
+ grid->bounds[b_index].min[j] = grid->grid_bounds.min[j] + dim[j]/grid->dim[j]*s;
+ grid->bounds[b_index].max[j] = grid->grid_bounds.min[j] + dim[j]/grid->dim[j]*(s+1);
+ }
grid->bounds[b_index].valid = 1;
}
}
@@ -800,8 +773,10 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface)
/* free per thread s_num values */
grid->s_num = MEM_reallocN(grid->s_num, sizeof(int) * grid_cells);
- if (error || !grid->s_num)
+ if (error || !grid->s_num) {
+ printError(surface->canvas, "Not enough free memory.");
freeGrid(sData);
+ }
}
if (grid_bounds) MEM_freeN(grid_bounds);
@@ -871,7 +846,7 @@ void surface_freeUnusedData(DynamicPaintSurface *surface)
free_bakeData(surface->data);
}
-static void dynamicPaint_freeSurfaceData(DynamicPaintSurface *surface)
+void dynamicPaint_freeSurfaceData(DynamicPaintSurface *surface)
{
PaintSurfaceData *data = surface->data;
if (!data) return;
@@ -898,8 +873,6 @@ static void dynamicPaint_freeSurfaceData(DynamicPaintSurface *surface)
void dynamicPaint_freeSurface(DynamicPaintSurface *surface)
{
- if (!surface) return;
-
/* point cache */
BKE_ptcache_free_list(&(surface->ptcaches));
surface->pointcache = NULL;
@@ -951,6 +924,7 @@ void dynamicPaint_Modifier_free(struct DynamicPaintModifierData *pmd)
/*
* Creates a new surface and adds it to the list
+* If scene is null, frame range of 1-250
* A pointer to this surface is returned
*/
struct DynamicPaintSurface *dynamicPaint_createNewSurface(DynamicPaintCanvasSettings *canvas, Scene *scene)
@@ -975,7 +949,8 @@ struct DynamicPaintSurface *dynamicPaint_createNewSurface(DynamicPaintCanvasSett
surface->diss_speed = 300;
surface->dry_speed = 300;
- surface->disp_clamp = 0.0f;
+ surface->depth_clamp = 0.0f;
+ surface->disp_factor = 1.0f;
surface->disp_type = MOD_DPAINT_DISP_DISPLACE;
surface->image_fileformat = MOD_DPAINT_IMGFORMAT_PNG;
@@ -1022,10 +997,8 @@ struct DynamicPaintSurface *dynamicPaint_createNewSurface(DynamicPaintCanvasSett
*/
int dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene)
{
- if(pmd)
- {
- if(type == MOD_DYNAMICPAINT_TYPE_CANVAS)
- {
+ if(pmd) {
+ if(type == MOD_DYNAMICPAINT_TYPE_CANVAS) {
if(pmd->canvas)
dynamicPaint_freeCanvas(pmd);
@@ -1042,8 +1015,7 @@ int dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, stru
pmd->canvas->ui_info[0] = '\0';
}
- else if(type == MOD_DYNAMICPAINT_TYPE_BRUSH)
- {
+ else if(type == MOD_DYNAMICPAINT_TYPE_BRUSH) {
if(pmd->brush)
dynamicPaint_freeBrush(pmd);
@@ -1168,19 +1140,20 @@ static void dynamicPaint_allocateSurfaceType(DynamicPaintSurface *surface)
{
PaintSurfaceData *sData = surface->data;
- if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
- sData->type_data = MEM_callocN(sizeof(PaintPoint)*sData->total_points, "DynamicPaintSurface Data");
- }
- else if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE) {
- sData->type_data = MEM_callocN(sizeof(float)*sData->total_points, "DynamicPaintSurface DepthData");
- }
- else if (surface->type == MOD_DPAINT_SURFACE_T_WEIGHT) {
- sData->type_data = MEM_callocN(sizeof(float)*sData->total_points, "DynamicPaintSurface WeightData");
+ switch (surface->type) {
+ case MOD_DPAINT_SURFACE_T_PAINT:
+ sData->type_data = MEM_callocN(sizeof(PaintPoint)*sData->total_points, "DynamicPaintSurface Data");
+ break;
+ case MOD_DPAINT_SURFACE_T_DISPLACE:
+ sData->type_data = MEM_callocN(sizeof(float)*sData->total_points, "DynamicPaintSurface DepthData");
+ break;
+ case MOD_DPAINT_SURFACE_T_WEIGHT:
+ sData->type_data = MEM_callocN(sizeof(float)*sData->total_points, "DynamicPaintSurface WeightData");
+ break;
+ case MOD_DPAINT_SURFACE_T_WAVE:
+ sData->type_data = MEM_callocN(sizeof(PaintWavePoint)*sData->total_points, "DynamicPaintSurface WaveData");
+ break;
}
- else if (surface->type == MOD_DPAINT_SURFACE_T_WAVE) {
- sData->type_data = MEM_callocN(sizeof(PaintWavePoint)*sData->total_points, "DynamicPaintSurface WaveData");
- }
- else return;
if (sData->type_data == NULL) printError(surface->canvas, "Not enough free memory!");
}
@@ -1230,10 +1203,10 @@ static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, int for
ed->flags = MEM_callocN(sizeof(int)*sData->total_points, "Surface Adj Flags");
ed->total_targets = neigh_points;
- /* in case of error, free allocated memory */
+ /* in case of allocation error, free memory */
if (!ed->n_index || !ed->n_num || !ed->n_target || !temp_data) {
dynamicPaint_freeAdjData(sData);
- MEM_freeN(temp_data);
+ if (temp_data) MEM_freeN(temp_data);
printError(surface->canvas, "Not enough free memory.");
return;
}
@@ -1341,7 +1314,7 @@ void dynamicPaint_setInitialColor(DynamicPaintSurface *surface)
if (!tex) return;
/* get uv layer */
- validate_layer_name(&dm->faceData, CD_MTFACE, surface->init_layername, uvname);
+ CustomData_validate_layer_name(&dm->faceData, CD_MTFACE, surface->init_layername, uvname);
tface = CustomData_get_layer_named(&dm->faceData, CD_MTFACE, uvname);
if (!tface) return;
@@ -1544,13 +1517,13 @@ static void dynamicPaint_applySurfaceDisplace(DynamicPaintSurface *surface, Deri
#pragma omp parallel for schedule(static)
#endif
for (i=0; i<sData->total_points; i++) {
- float normal[3];
+ float normal[3], val=value[i]*surface->disp_factor;
normal_short_to_float_v3(normal, mvert[i].no);
normalize_v3(normal);
- mvert[i].co[0] -= normal[0]*value[i];
- mvert[i].co[1] -= normal[1]*value[i];
- mvert[i].co[2] -= normal[2]*value[i];
+ mvert[i].co[0] -= normal[0]*val;
+ mvert[i].co[1] -= normal[1]*val;
+ mvert[i].co[2] -= normal[2]*val;
}
}
else return;
@@ -2126,7 +2099,7 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
/*
* Create a surface for uv image sequence format
*/
-static int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
+int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
{
/* Antialias jitter point relative coords */
float jitter5sample[10] = {0.0f, 0.0f,
@@ -2162,7 +2135,7 @@ static int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
mface = dm->getFaceArray(dm);
/* get uv layer */
- validate_layer_name(&dm->faceData, CD_MTFACE, surface->uvlayer_name, uvname);
+ CustomData_validate_layer_name(&dm->faceData, CD_MTFACE, surface->uvlayer_name, uvname);
tface = CustomData_get_layer_named(&dm->faceData, CD_MTFACE, uvname);
/* Check for validity */
@@ -2188,10 +2161,8 @@ static int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
final_index = (int *) MEM_callocN(w*h*sizeof(int), "Temp UV Final Indexes");
if (!final_index) error=1;
- if (!error) {
- tempWeights = (struct Vec3f *) MEM_mallocN(w*h*aa_samples*sizeof(struct Vec3f), "Temp bWeights");
- if (!tempWeights) error=1;
- }
+ tempWeights = (struct Vec3f *) MEM_mallocN(w*h*aa_samples*sizeof(struct Vec3f), "Temp bWeights");
+ if (!tempWeights) error=1;
/*
* Generate a temporary bounding box array for UV faces to optimize
@@ -2592,18 +2563,13 @@ static int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
return (error == 0);
}
-#define DPOUTPUT_PAINT 0
-#define DPOUTPUT_WET 1
-#define DPOUTPUT_DISPLACE 2
-#define DPOUTPUT_WAVES 3
-
/*
* Outputs an image file from uv surface data.
*/
void dynamicPaint_outputImage(DynamicPaintSurface *surface, char* filename, short format, short type)
{
int index;
- ImBuf* mhImgB = NULL;
+ ImBuf* ibuf = NULL;
PaintSurfaceData *sData = surface->data;
ImgSeqFormatData *f_data = (ImgSeqFormatData*)sData->format_data;
char output_file[250];
@@ -2619,8 +2585,8 @@ void dynamicPaint_outputImage(DynamicPaintSurface *surface, char* filename, shor
BLI_make_existing_file(output_file);
/* Init image buffer */
- mhImgB = IMB_allocImBuf(surface->image_resolution, surface->image_resolution, 32, IB_rectfloat);
- if (mhImgB == NULL) {printError(surface->canvas, "Image save failed: Not enough free memory.");return;}
+ ibuf = IMB_allocImBuf(surface->image_resolution, surface->image_resolution, 32, IB_rectfloat);
+ if (ibuf == NULL) {printError(surface->canvas, "Image save failed: Not enough free memory.");return;}
#ifdef _OPENMP
#pragma omp parallel for schedule(static)
@@ -2634,76 +2600,77 @@ void dynamicPaint_outputImage(DynamicPaintSurface *surface, char* filename, shor
PaintPoint *point = &((PaintPoint*)sData->type_data)[index];
float value = (point->wetness > 1.0f) ? 1.0f : point->wetness;
- mhImgB->rect_float[pos]=value;
- mhImgB->rect_float[pos+1]=value;
- mhImgB->rect_float[pos+2]=value;
- mhImgB->rect_float[pos+3]=1.0f;
+ ibuf->rect_float[pos]=value;
+ ibuf->rect_float[pos+1]=value;
+ ibuf->rect_float[pos+2]=value;
+ ibuf->rect_float[pos+3]=1.0f;
}
else if (type == DPOUTPUT_PAINT) {
PaintPoint *point = &((PaintPoint*)sData->type_data)[index];
- mhImgB->rect_float[pos] = point->color[0];
- mhImgB->rect_float[pos+1] = point->color[1];
- mhImgB->rect_float[pos+2] = point->color[2];
+ ibuf->rect_float[pos] = point->color[0];
+ ibuf->rect_float[pos+1] = point->color[1];
+ ibuf->rect_float[pos+2] = point->color[2];
/* mix wet layer */
- if (point->e_alpha) mixColors(&mhImgB->rect_float[pos], point->alpha, point->e_color, point->e_alpha);
+ if (point->e_alpha) mixColors(&ibuf->rect_float[pos], point->alpha, point->e_color, point->e_alpha);
/* use highest alpha */
- mhImgB->rect_float[pos+3] = (point->e_alpha > point->alpha) ? point->e_alpha : point->alpha;
+ ibuf->rect_float[pos+3] = (point->e_alpha > point->alpha) ? point->e_alpha : point->alpha;
/* Multiply color by alpha if enabled */
if (surface->flags & MOD_DPAINT_MULALPHA) {
- mhImgB->rect_float[pos] *= mhImgB->rect_float[pos+3];
- mhImgB->rect_float[pos+1] *= mhImgB->rect_float[pos+3];
- mhImgB->rect_float[pos+2] *= mhImgB->rect_float[pos+3];
+ ibuf->rect_float[pos] *= ibuf->rect_float[pos+3];
+ ibuf->rect_float[pos+1] *= ibuf->rect_float[pos+3];
+ ibuf->rect_float[pos+2] *= ibuf->rect_float[pos+3];
}
}
else if (type == DPOUTPUT_DISPLACE) {
float depth = ((float*)sData->type_data)[index];
+ if (surface->depth_clamp)
+ depth /= surface->depth_clamp;
if (surface->disp_type == MOD_DPAINT_DISP_DISPLACE) {
- if (surface->disp_clamp)
- depth /= surface->disp_clamp*2.0f;
- depth = (0.5f - depth);
- CLAMP(depth, 0.0f, 1.0f);
+ depth = (0.5f - depth/2.0f);
}
- mhImgB->rect_float[pos]=depth;
- mhImgB->rect_float[pos+1]=depth;
- mhImgB->rect_float[pos+2]=depth;
- mhImgB->rect_float[pos+3]=1.0f;
+ CLAMP(depth, 0.0f, 1.0f);
+
+ ibuf->rect_float[pos]=depth;
+ ibuf->rect_float[pos+1]=depth;
+ ibuf->rect_float[pos+2]=depth;
+ ibuf->rect_float[pos+3]=1.0f;
}
else if (type == DPOUTPUT_WAVES) {
PaintWavePoint *wPoint = &((PaintWavePoint*)sData->type_data)[index];
- float depth = wPoint->height/2.0f+0.5f;
-
- mhImgB->rect_float[pos]=depth;
- mhImgB->rect_float[pos+1]=depth;
- mhImgB->rect_float[pos+2]=depth;
- mhImgB->rect_float[pos+3]=1.0f;
+ float depth = wPoint->height;
+ if (surface->depth_clamp)
+ depth /= surface->depth_clamp;
+ depth = (0.5f + depth/2.0f);
+ CLAMP(depth, 0.0f, 1.0f);
+
+ ibuf->rect_float[pos]=depth;
+ ibuf->rect_float[pos+1]=depth;
+ ibuf->rect_float[pos+2]=depth;
+ ibuf->rect_float[pos+3]=1.0f;
}
}
- /* Save image buffer */
+ /* Set output format*/
if (format == DPOUTPUT_JPEG) { /* JPEG */
- mhImgB->ftype= JPG|95;
- IMB_rect_from_float(mhImgB);
- imb_savejpeg(mhImgB, output_file, IB_rectfloat);
+ ibuf->ftype= JPG|95;
}
#ifdef WITH_OPENEXR
else if (format == DPOUTPUT_OPENEXR) { /* OpenEXR 32-bit float */
- mhImgB->ftype = OPENEXR | OPENEXR_COMPRESS;
- IMB_rect_from_float(mhImgB);
- imb_save_openexr(mhImgB, output_file, IB_rectfloat);
+ ibuf->ftype = OPENEXR | OPENEXR_COMPRESS;
}
#endif
else { /* DPOUTPUT_PNG */
- mhImgB->ftype= PNG|95;
- IMB_rect_from_float(mhImgB);
- imb_savepng(mhImgB, output_file, IB_rectfloat);
+ ibuf->ftype= PNG|95;
}
- IMB_freeImBuf(mhImgB);
+ /* Save image */
+ IMB_saveiff(ibuf, output_file, IB_rectfloat);
+ IMB_freeImBuf(ibuf);
}
@@ -3304,8 +3271,8 @@ static void dynamicPaint_updatePointData(DynamicPaintSurface *surface, unsigned
if (surface->flags & MOD_DPAINT_DISP_INCREMENTAL)
depth = value[index] + depth;
- if (surface->disp_clamp) {
- CLAMP(depth, 0.0f-surface->disp_clamp, surface->disp_clamp);
+ if (surface->depth_clamp) {
+ CLAMP(depth, 0.0f-surface->depth_clamp, surface->depth_clamp);
}
if (brush->flags & MOD_DPAINT_ERASE) {
@@ -3455,12 +3422,6 @@ static void dynamicPaint_brushObjectCalculateVelocity(Scene *scene, Object *ob,
mul_v3_fl(brushVel->v, 1.0f/timescale);
}
-#define VECADDVAL(v,val) {*(v)+=(val); *(v+1)+=(val); *(v+2)+=(val);}
-#define VECMULVAL(v,val) {*(v)*=(val); *(v+1)*=(val); *(v+2)*=(val);}
-
-#define HIT_VOLUME 1
-#define HIT_PROXIMITY 2
-
/*
* Paint a brush object mesh to the surface
*/
@@ -3523,7 +3484,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface, DynamicPaintBrus
if (bvhtree_from_mesh_faces(&treeData, dm, 0.0f, 4, 8))
{
int c_index;
- int total_cells = grid->x*grid->y*grid->z;
+ int total_cells = grid->dim[0]*grid->dim[1]*grid->dim[2];
/* loop through space partitioning grid */
for (c_index=0; c_index<total_cells; c_index++) {
@@ -3900,7 +3861,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, ParticleSys
if (boundsIntersectDist(&grid->grid_bounds, &part_bb, range))
{
int c_index;
- int total_cells = grid->x*grid->y*grid->z;
+ int total_cells = grid->dim[0]*grid->dim[1]*grid->dim[2];
int num_of_threads = 1;
/* nearest particles search array for each thread */
@@ -3915,11 +3876,11 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, ParticleSys
num_of_threads = omp_get_max_threads();
#endif
- nearest_th = MEM_callocN((num_of_threads)*sizeof(KDTreeNode*), "nearest_for_threads");
+ nearest_th = MEM_callocN((num_of_threads)*sizeof(KDTreeNearest), "nearest_for_threads");
if (brush->flags & MOD_DPAINT_PART_RAD)
for (c_index=0; c_index<num_of_threads; c_index++) {
- nearest_th[c_index] = MEM_callocN((nearest_limit)*sizeof(KDTreeNode), "dp_psys_treefoundstack");
+ nearest_th[c_index] = MEM_callocN((nearest_limit)*sizeof(KDTreeNearest), "dp_psys_treefoundstack");
}
/* loop through space partitioning grid */
@@ -4392,9 +4353,6 @@ static void dynamicPaint_doSmudge(DynamicPaintSurface *surface, DynamicPaintBrus
}
}
-/* paint effect default movement per frame in global units */
-#define EFF_MOVEMENT_PER_FRAME 0.05f
-
/*
* Prepare data required by effects for current frame.
* Returns number of steps required
@@ -4497,11 +4455,10 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
PaintSurfaceData *sData = surface->data;
BakeNeighPoint *bNeighs = sData->bData->bNeighs;
int index;
+ timescale /= steps;
if (!sData->adj_data) return;
- timescale /= steps;
-
/*
* Spread Effect
*/
@@ -4683,8 +4640,6 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
}
}
-#define WAVE_TIME_FAC 0.1
-
void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
{
PaintSurfaceData *sData = surface->data;
@@ -4719,7 +4674,7 @@ void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
/* apply simulation values for final timescale */
dt = WAVE_TIME_FAC*timescale*surface->wave_timescale;
min_dist = wave_speed*dt*1.5f;
- damp_factor = pow((1.0f-surface->wave_damping), 1.0f*timescale);
+ damp_factor = pow((1.0f-surface->wave_damping), timescale*surface->wave_timescale);
for (ss=0; ss<steps; ss++) {
@@ -4793,8 +4748,6 @@ void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
MEM_freeN(prevPoint);
}
-#define VALUE_DISSOLVE(VALUE, SPEED, SCALE, LOG) (VALUE) = (LOG) ? (VALUE) * 1.0f - 1.0f/((SPEED)/(SCALE)) : (VALUE) - 1.0f/(SPEED)*(SCALE)
-
/* Do dissolve and fading effects */
static void dynamicPaint_surfacePreStep(DynamicPaintSurface *surface, float timescale)
{
@@ -5273,7 +5226,7 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
/*
* Calculate a single frame and included subframes for surface
*/
-static int dynamicPaint_calculateFrame(DynamicPaintSurface *surface, Scene *scene, Object *cObject, int frame)
+int dynamicPaint_calculateFrame(DynamicPaintSurface *surface, Scene *scene, Object *cObject, int frame)
{
float timescale = 1.0f;
@@ -5296,190 +5249,4 @@ static int dynamicPaint_calculateFrame(DynamicPaintSurface *surface, Scene *scen
}
return dynamicPaint_doStep(scene, cObject, surface, timescale, 0.0f);
-}
-
-/***************************** Image Sequence Baking ******************************/
-
-/*
-* Do actual bake operation. Loops through to-be-baked frames.
-* Returns 0 on failture.
-*/
-static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surface, Object *cObject)
-{
- DynamicPaintCanvasSettings *canvas = surface->canvas;
- Scene *scene= CTX_data_scene(C);
- wmWindow *win = CTX_wm_window(C);
- int frame = 1;
- int frames;
-
- frames = surface->end_frame - surface->start_frame + 1;
- if (frames <= 0) {return printError(canvas, "No frames to bake.");}
-
- /*
- * 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);
-
- /* Init surface */
- if (!dynamicPaint_createUVSurface(surface)) return 0;
-
- /*
- * Loop through selected frames
- */
- for (frame=surface->start_frame; frame<=surface->end_frame; frame++)
- {
- float progress = (frame - surface->start_frame) / (float)frames * 100;
- surface->current_frame = frame;
-
- /* If user requested stop (esc), quit baking */
- if (blender_test_break()) return 0;
-
- /* Update progress bar cursor */
- WM_timecursor(win, (int)progress);
- printf("DynamicPaint: Baking frame %i\n", frame);
-
- /* calculate a frame */
- scene->r.cfra = (int)frame;
- ED_update_for_newframe(CTX_data_main(C), scene, win->screen, 1);
- if (!dynamicPaint_calculateFrame(surface, scene, cObject, frame)) return 0;
-
- /*
- * 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;
-
- /* 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) {
- sprintf(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) {
- sprintf(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);
- }
- }
-
- /* displacement map */
- else if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE) {
- sprintf(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) {
- sprintf(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);
- }
- }
- }
- return 1;
-}
-
-
-/*
-* Bake Dynamic Paint image sequence surface
-*/
-int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
-{
- DynamicPaintModifierData *pmd = NULL;
- Object *ob = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
- int status = 0;
- double timer = PIL_check_seconds_timer();
- DynamicPaintSurface *surface;
-
- /*
- * Get modifier data
- */
- pmd = (DynamicPaintModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint);
- if (!pmd) {
- BKE_report(op->reports, RPT_ERROR, "Bake Failed: No Dynamic Paint modifier found.");
- return 0;
- }
-
- /* Make sure we're dealing with a canvas */
- if (!pmd->canvas) {
- BKE_report(op->reports, RPT_ERROR, "Bake Failed: Invalid Canvas.");
- return 0;
- }
- surface = get_activeSurface(pmd->canvas);
-
- /* Set state to baking and init surface */
- pmd->canvas->error[0] = '\0';
- pmd->canvas->flags |= MOD_DPAINT_BAKING;
- G.afbreek= 0; /* reset blender_test_break*/
-
- /* Bake Dynamic Paint */
- status = dynamicPaint_bakeImageSequence(C, surface, ob);
- /* Clear bake */
- pmd->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];
- double time = PIL_check_seconds_timer() - timer;
- int tmp_val;
- timestr[0] = '\0';
-
- /* days (just in case someone actually has a very slow pc) */
- tmp_val = (int)floor(time / 86400.0f);
- if (tmp_val > 0) sprintf(timestr, "%i Day(s) - ", tmp_val);
- /* hours */
- time -= 86400.0f * tmp_val;
- tmp_val = (int)floor(time / 3600.0f);
- if (tmp_val > 0) sprintf(timestr, "%s%i h ", timestr, tmp_val);
- /* minutes */
- time -= 3600.0f * tmp_val;
- tmp_val = (int)floor(time / 60.0f);
- if (tmp_val > 0) sprintf(timestr, "%s%i min ", timestr, tmp_val);
- /* seconds */
- time -= 60.0f * tmp_val;
- tmp_val = (int)ceil(time);
- sprintf(timestr, "%s%i s", timestr, tmp_val);
-
- /* Show bake info */
- sprintf(pmd->canvas->ui_info, "Bake Complete! (Time: %s)", timestr);
- printf("%s\n", pmd->canvas->ui_info);
- }
- else {
- if (strlen(pmd->canvas->error)) { /* If an error occured */
- sprintf(pmd->canvas->ui_info, "Bake Failed: %s", pmd->canvas->error);
- BKE_report(op->reports, RPT_ERROR, pmd->canvas->ui_info);
- }
- else { /* User cancelled the bake */
- sprintf(pmd->canvas->ui_info, "Baking Cancelled!");
- BKE_report(op->reports, RPT_WARNING, pmd->canvas->ui_info);
- }
-
- /* Print failed bake to console */
- printf("Baking Cancelled!\n");
- }
-
- return status;
-}
+} \ No newline at end of file
diff --git a/source/blender/blenlib/BLI_kdtree.h b/source/blender/blenlib/BLI_kdtree.h
index 12c5b4b2a5e..532295449e5 100644
--- a/source/blender/blenlib/BLI_kdtree.h
+++ b/source/blender/blenlib/BLI_kdtree.h
@@ -47,13 +47,6 @@ typedef struct KDTreeNearest {
float co[3];
} KDTreeNearest;
-typedef struct KDTreeNode {
- struct KDTreeNode *left, *right;
- float co[3], nor[3];
- int index;
- short d;
-} KDTreeNode;
-
/* Creates or free a kdtree */
KDTree* BLI_kdtree_new(int maxsize);
void BLI_kdtree_free(KDTree *tree);
diff --git a/source/blender/blenlib/intern/BLI_kdtree.c b/source/blender/blenlib/intern/BLI_kdtree.c
index c906d507eb8..79afd9c7a60 100644
--- a/source/blender/blenlib/intern/BLI_kdtree.c
+++ b/source/blender/blenlib/intern/BLI_kdtree.c
@@ -43,6 +43,13 @@
#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
#endif
+typedef struct KDTreeNode {
+ struct KDTreeNode *left, *right;
+ float co[3], nor[3];
+ int index;
+ short d;
+} KDTreeNode;
+
struct KDTree {
KDTreeNode *nodes;
int totnode;
diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c
index 8a4007745de..a868cb55ca5 100644
--- a/source/blender/editors/physics/dynamicpaint_ops.c
+++ b/source/blender/editors/physics/dynamicpaint_ops.c
@@ -18,16 +18,25 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "BLI_blenlib.h"
+
#include "DNA_dynamicpaint_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
+#include "BKE_blender.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_depsgraph.h"
#include "BKE_dynamicpaint.h"
+#include "BKE_global.h"
#include "BKE_modifier.h"
+#include "BKE_report.h"
#include "ED_mesh.h"
#include "ED_screen.h"
@@ -36,30 +45,12 @@
#include "RNA_define.h"
#include "RNA_enum_types.h"
+/* Platform independend time */
+#include "PIL_time.h"
+
#include "WM_types.h"
#include "WM_api.h"
-static int dynamicpaint_bake_exec(bContext *C, wmOperator *op)
-{
- /* Bake dynamic paint */
- if(!dynamicPaint_initBake(C, op)) {
- return OPERATOR_CANCELLED;}
-
- return OPERATOR_FINISHED;
-}
-
-void DPAINT_OT_bake(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Dynamic Paint Bake";
- ot->description= "Bake dynamic paint image sequence surface";
- ot->idname= "DPAINT_OT_bake";
-
- /* api callbacks */
- ot->exec= dynamicpaint_bake_exec;
- ot->poll= ED_operator_object_active_editable;
-}
-
static int surface_slot_add_exec(bContext *C, wmOperator *op)
{
DynamicPaintModifierData *pmd = 0;
@@ -253,7 +244,7 @@ void DPAINT_OT_output_toggle(wmOperatorType *ot)
/* identifiers */
ot->name= "Toggle Output Layer";
ot->idname= "DPAINT_OT_output_toggle";
- ot->description = "Adds or removes Dynamic Paint output data layer.";
+ ot->description = "Adds or removes Dynamic Paint output data layer";
/* api callbacks */
ot->exec= output_toggle_exec;
@@ -266,3 +257,211 @@ void DPAINT_OT_output_toggle(wmOperatorType *ot)
prop= RNA_def_int(ot->srna, "index", 0, 0, 1, "Index", "", 0, 1);
ot->prop= prop;
}
+
+
+/***************************** Image Sequence Baking ******************************/
+
+/*
+* Do actual bake operation. Loop through to-be-baked frames.
+* Returns 0 on failture.
+*/
+static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surface, Object *cObject)
+{
+ DynamicPaintCanvasSettings *canvas = surface->canvas;
+ Scene *scene= CTX_data_scene(C);
+ wmWindow *win = CTX_wm_window(C);
+ int frame = 1;
+ 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;}
+
+ /*
+ * 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);
+
+ /* Init surface */
+ if (!dynamicPaint_createUVSurface(surface)) return 0;
+
+ /*
+ * Loop through selected frames
+ */
+ for (frame=surface->start_frame; frame<=surface->end_frame; frame++)
+ {
+ float progress = (frame - surface->start_frame) / (float)frames * 100;
+ surface->current_frame = frame;
+
+ /* If user requested stop (esc), quit baking */
+ if (blender_test_break()) return 0;
+
+ /* Update progress bar cursor */
+ WM_timecursor(win, (int)progress);
+ printf("DynamicPaint: Baking frame %i\n", frame);
+
+ /* calculate a frame */
+ scene->r.cfra = (int)frame;
+ ED_update_for_newframe(CTX_data_main(C), scene, win->screen, 1);
+ if (!dynamicPaint_calculateFrame(surface, scene, cObject, frame)) return 0;
+
+ /*
+ * 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;
+
+ /* 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) {
+ sprintf(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) {
+ sprintf(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);
+ }
+ }
+
+ /* displacement map */
+ else if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE) {
+ sprintf(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) {
+ sprintf(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);
+ }
+ }
+ }
+ return 1;
+}
+
+
+/*
+* Bake Dynamic Paint image sequence surface
+*/
+int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
+{
+ DynamicPaintModifierData *pmd = NULL;
+ Object *ob = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ int status = 0;
+ double timer = PIL_check_seconds_timer();
+ DynamicPaintSurface *surface;
+
+ /*
+ * Get modifier data
+ */
+ pmd = (DynamicPaintModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint);
+ if (!pmd) {
+ BKE_report(op->reports, RPT_ERROR, "Bake Failed: No Dynamic Paint modifier found.");
+ return 0;
+ }
+
+ /* Make sure we're dealing with a canvas */
+ if (!pmd->canvas) {
+ BKE_report(op->reports, RPT_ERROR, "Bake Failed: Invalid Canvas.");
+ return 0;
+ }
+ surface = get_activeSurface(pmd->canvas);
+
+ /* Set state to baking and init surface */
+ pmd->canvas->error[0] = '\0';
+ pmd->canvas->flags |= MOD_DPAINT_BAKING;
+ G.afbreek= 0; /* reset blender_test_break*/
+
+ /* Bake Dynamic Paint */
+ status = dynamicPaint_bakeImageSequence(C, surface, ob);
+ /* Clear bake */
+ pmd->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];
+ double time = PIL_check_seconds_timer() - timer;
+ int tmp_val;
+ timestr[0] = '\0';
+
+ /* days (just in case someone actually has a very slow pc) */
+ tmp_val = (int)floor(time / 86400.0f);
+ if (tmp_val > 0) sprintf(timestr, "%i Day(s) - ", tmp_val);
+ /* hours */
+ time -= 86400.0f * tmp_val;
+ tmp_val = (int)floor(time / 3600.0f);
+ if (tmp_val > 0) sprintf(timestr, "%s%i h ", timestr, tmp_val);
+ /* minutes */
+ time -= 3600.0f * tmp_val;
+ tmp_val = (int)floor(time / 60.0f);
+ if (tmp_val > 0) sprintf(timestr, "%s%i min ", timestr, tmp_val);
+ /* seconds */
+ time -= 60.0f * tmp_val;
+ tmp_val = (int)ceil(time);
+ sprintf(timestr, "%s%i s", timestr, tmp_val);
+
+ /* Show bake info */
+ sprintf(pmd->canvas->ui_info, "Bake Complete! (Time: %s)", timestr);
+ printf("%s\n", pmd->canvas->ui_info);
+ }
+ else {
+ if (strlen(pmd->canvas->error)) { /* If an error occured */
+ sprintf(pmd->canvas->ui_info, "Bake Failed: %s", pmd->canvas->error);
+ BKE_report(op->reports, RPT_ERROR, pmd->canvas->ui_info);
+ }
+ else { /* User cancelled the bake */
+ sprintf(pmd->canvas->ui_info, "Baking Cancelled!");
+ BKE_report(op->reports, RPT_WARNING, pmd->canvas->ui_info);
+ }
+
+ /* Print failed bake to console */
+ printf("Baking Cancelled!\n");
+ }
+
+ return status;
+}
+
+static int dynamicpaint_bake_exec(bContext *C, wmOperator *op)
+{
+ /* Bake dynamic paint */
+ if(!dynamicPaint_initBake(C, op)) {
+ return OPERATOR_CANCELLED;}
+
+ return OPERATOR_FINISHED;
+}
+
+void DPAINT_OT_bake(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Dynamic Paint Bake";
+ ot->description= "Bake dynamic paint image sequence surface";
+ ot->idname= "DPAINT_OT_bake";
+
+ /* api callbacks */
+ ot->exec= dynamicpaint_bake_exec;
+ ot->poll= ED_operator_object_active_editable;
+} \ No newline at end of file
diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h
index 2a71831e074..5fe9b657bde 100644
--- a/source/blender/makesdna/DNA_dynamicpaint_types.h
+++ b/source/blender/makesdna/DNA_dynamicpaint_types.h
@@ -91,8 +91,7 @@ typedef struct DynamicPaintSurface {
int flags, effect;
int image_resolution, substeps;
- int start_frame, end_frame;
- int pad;
+ int start_frame, end_frame, pad;
/* initial color */
float init_color[4];
@@ -100,7 +99,7 @@ typedef struct DynamicPaintSurface {
char init_layername[40];
int dry_speed, diss_speed;
- float disp_clamp;
+ float depth_clamp, disp_factor;
float spread_speed, color_spread_speed, shrink_speed;
float drip_vel, drip_acc;
@@ -108,6 +107,8 @@ typedef struct DynamicPaintSurface {
/* wave settings */
float wave_damping, wave_speed, wave_timescale, wave_spring;
+ int pad_;
+
char uvlayer_name[32];
char image_output_path[240];
char output_name[40];
diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c
index 0c213eed249..730b4047798 100644
--- a/source/blender/makesrna/intern/rna_dynamicpaint.c
+++ b/source/blender/makesrna/intern/rna_dynamicpaint.c
@@ -346,7 +346,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
/* Surface */
srna= RNA_def_struct(brna, "DynamicPaintSurface", NULL);
RNA_def_struct_sdna(srna, "DynamicPaintSurface");
- RNA_def_struct_ui_text(srna, "Paint Surface", "A canvas surface layer.");
+ RNA_def_struct_ui_text(srna, "Paint Surface", "A canvas surface layer");
RNA_def_struct_path_func(srna, "rna_DynamicPaintSurface_path");
prop= RNA_def_property(srna, "surface_format", PROP_ENUM, PROP_NONE);
@@ -366,12 +366,12 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
prop= RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ACTIVE);
- RNA_def_property_ui_text(prop, "Is Active", "Toggles whether surface is processed or ignored.");
+ RNA_def_property_ui_text(prop, "Is Active", "Toggle whether surface is processed or ignored");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "show_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PREVIEW);
- RNA_def_property_ui_text(prop, "Show Preview", "Display surface preview in 3D views.");
+ RNA_def_property_ui_text(prop, "Show Preview", "Display surface preview in 3D-views");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changePreview");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
@@ -392,18 +392,18 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_dissolve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE);
- RNA_def_property_ui_text(prop, "Dissolve", "Enable to make changes disappear over time.");
+ RNA_def_property_ui_text(prop, "Dissolve", "Enable to make surface changes disappear over time");
prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "diss_speed");
RNA_def_property_range(prop, 1.0, 10000.0);
RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, 0);
- RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed");
+ RNA_def_property_ui_text(prop, "Dissolve Speed", "Approximately in how many frames should dissolve happen");
prop= RNA_def_property(srna, "dry_speed", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1.0, 10000.0);
RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, 0);
- RNA_def_property_ui_text(prop, "Dry Speed", "Dry Speed");
+ RNA_def_property_ui_text(prop, "Dry Speed", "Approximately in how many frames should drying happen");
/*
* Simulation settings
@@ -436,12 +436,12 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
prop= RNA_def_property(srna, "substeps", PROP_INT, PROP_NONE);
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.");
+ 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);
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", "Uses 5x multisampling to smoothen paint edges.");
+ RNA_def_property_ui_text(prop, "Anti-aliasing", "Use 5x multisampling to smoothen paint edges");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
/*
@@ -456,7 +456,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
prop= RNA_def_property(srna, "init_color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
- RNA_def_property_ui_text(prop, "Color", "Initial color of the surface.");
+ RNA_def_property_ui_text(prop, "Color", "Initial color of the surface");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
prop= RNA_def_property(srna, "init_texture", PROP_POINTER, PROP_NONE);
@@ -478,47 +478,47 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_dry_log", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DRY_LOG);
- RNA_def_property_ui_text(prop, "Slow", "Use logarithmic drying. Makes high values to fade faster than low values.");
+ RNA_def_property_ui_text(prop, "Slow", "Use logarithmic drying. Makes high values to fade faster than low values");
prop= RNA_def_property(srna, "use_dissolve_log", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE_LOG);
- RNA_def_property_ui_text(prop, "Slow", "Use logarithmic dissolve. Makes high values to fade faster than low values.");
+ RNA_def_property_ui_text(prop, "Slow", "Use logarithmic dissolve. Makes high values to fade faster than low values");
prop= RNA_def_property(srna, "use_spread", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SPREAD);
- RNA_def_property_ui_text(prop, "Use Spread", "Processes spread effect. Spreads wet paint around surface.");
+ RNA_def_property_ui_text(prop, "Use Spread", "Processes spread effect. Spreads wet paint around surface");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
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.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.");
+ RNA_def_property_ui_text(prop, "Spread Speed", "How fast spread effect moves on the canvas surface");
prop= RNA_def_property(srna, "color_spread_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "color_spread_speed");
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_range(prop, 0.0, 2.0, 1, 2);
- RNA_def_property_ui_text(prop, "Color Spread", "How fast colors get mixed within wet paint.");
+ RNA_def_property_ui_text(prop, "Color Spread", "How fast colors get mixed within wet paint");
prop= RNA_def_property(srna, "use_drip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_DRIP);
- RNA_def_property_ui_text(prop, "Use Drip", "Processes drip effect. Drips wet paint to gravity direction.");
+ RNA_def_property_ui_text(prop, "Use Drip", "Processes drip effect. Drips wet paint to gravity direction");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
prop= RNA_def_property(srna, "use_shrink", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SHRINK);
- RNA_def_property_ui_text(prop, "Use Shrink", "Processes shrink effect. Shrinks paint areas.");
+ RNA_def_property_ui_text(prop, "Use Shrink", "Processes shrink effect. Shrinks paint areas");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
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.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.");
+ 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);
RNA_def_property_struct_type(prop, "EffectorWeights");
@@ -529,13 +529,13 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "drip_vel");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Velocity", "Defines how much surface velocity affects dripping.");
+ RNA_def_property_ui_text(prop, "Velocity", "Defines how much surface velocity affects dripping");
prop= RNA_def_property(srna, "drip_acceleration", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "drip_acc");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Acceleration", "Defines how much surface acceleration affects dripping.");
+ RNA_def_property_ui_text(prop, "Acceleration", "Defines how much surface acceleration affects dripping");
/*
* Output settings
@@ -543,7 +543,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_MULALPHA);
- RNA_def_property_ui_text(prop, "Premultiply alpha", "Multiplies color by alpha. (Recommended for Blender input.)");
+ RNA_def_property_ui_text(prop, "Premultiply alpha", "Multiplies color by alpha. (Recommended for Blender input)");
prop= RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "image_output_path");
@@ -585,11 +585,19 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
parm= RNA_def_boolean(func, "exists", 0, "", "");
RNA_def_function_return(func, parm);
- prop= RNA_def_property(srna, "disp_clamp", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "depth_clamp", PROP_FLOAT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.00, 50.0);
RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2);
- RNA_def_property_ui_text(prop, "Clamp Displace", "Maximum level of displace intersection in mesh space. Use 0.0 to disable.");
+ 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);
+ 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);
+ RNA_def_property_ui_text(prop, "Displace Factor", "Strength of displace when applied to the mesh");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "image_fileformat", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -604,33 +612,33 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
prop= RNA_def_property(srna, "incremental_disp", 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.");
+ RNA_def_property_ui_text(prop, "Incremental", "New displace is added cumulatively on top of existing");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
/* wave simulator settings */
prop= RNA_def_property(srna, "wave_damping", PROP_FLOAT, PROP_NONE);
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, "Damping", "Wave damping factor.");
+ RNA_def_property_ui_text(prop, "Damping", "Wave damping factor");
prop= RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 3.0);
RNA_def_property_ui_range(prop, 0.01, 1.5, 1, 2);
- RNA_def_property_ui_text(prop, "Speed", "Wave propogation speed.");
+ RNA_def_property_ui_text(prop, "Speed", "Wave propogation speed");
prop= RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 3.0);
RNA_def_property_ui_range(prop, 0.01, 1.5, 1, 2);
- RNA_def_property_ui_text(prop, "Timescale", "Wave time scaling factor.");
+ RNA_def_property_ui_text(prop, "Timescale", "Wave time scaling factor");
prop= RNA_def_property(srna, "wave_spring", PROP_FLOAT, PROP_NONE);
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.");
+ RNA_def_property_ui_text(prop, "Spring", "Spring force that pulls water level back to zero");
prop= RNA_def_property(srna, "wave_open_borders", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_WAVE_OPEN_BORDERS);
- RNA_def_property_ui_text(prop, "Open Borders", "Passes waves through mesh edges.");
+ RNA_def_property_ui_text(prop, "Open Borders", "Passes waves through mesh edges");
/* cache */
@@ -724,37 +732,37 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "paint_color", PROP_FLOAT, PROP_COLOR_GAMMA);
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_ui_text(prop, "Paint Color", "Color of the paint");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
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_ui_text(prop, "Paint Alpha", "Paint alpha");
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_ui_text(prop, "Use object material", "Use object material to define color and influence");
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_ui_text(prop, "Material", "Material to use. If not defined, material linked to the mesh is used");
RNA_def_property_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "absolute_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ABS_ALPHA);
- RNA_def_property_ui_text(prop, "Absolute Alpha", "Only increase alpha value if paint alpha is higher than existing.");
+ RNA_def_property_ui_text(prop, "Absolute Alpha", "Only increase alpha value if paint alpha is higher than existing");
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, 2);
- RNA_def_property_ui_text(prop, "Paint Wetness", "Paint wetness. Visible in wet map. Some effects only affect wet paint.");
+ RNA_def_property_ui_text(prop, "Paint Wetness", "Paint wetness. Visible in wetmap. Some effects only affect wet paint");
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_ui_text(prop, "Erase Paint", "Erase / remove paint instead of adding it");
prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -764,16 +772,16 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -2.0, 2.0);
RNA_def_property_ui_range(prop, -1.0, 1.0, 5, 2);
- RNA_def_property_ui_text(prop, "Factor", "Multiplier for wave influence of this brush.");
+ RNA_def_property_ui_text(prop, "Factor", "Multiplier for wave influence of this brush");
prop= RNA_def_property(srna, "wave_clamp", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.00, 50.0);
RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2);
- RNA_def_property_ui_text(prop, "Clamp Waves", "Maximum level of surface intersection used to influence waves. Use 0.0 to disable.");
+ RNA_def_property_ui_text(prop, "Clamp Waves", "Maximum level of surface intersection used to influence waves. Use 0.0 to disable");
prop= RNA_def_property(srna, "do_smudge", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DO_SMUDGE);
- RNA_def_property_ui_text(prop, "Do Smudge", "Makes this brush to smudge existing paint as it moves.");
+ RNA_def_property_ui_text(prop, "Do Smudge", "Makes this brush to smudge existing paint as it moves");
prop= RNA_def_property(srna, "smudge_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0);
@@ -787,15 +795,15 @@ 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_ui_text(prop, "Multiply Alpha", "Multiply brush influence by velocity color ramp alpha");
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_ui_text(prop, "Multiply Depth", "Multiply brush intersection depth (displace, waves) by velocity ramp alpha");
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_ui_text(prop, "Replace Color", "Replace brush color by velocity color ramp");
/*
* Paint Area / Collision
@@ -810,11 +818,11 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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_ui_text(prop, "Proximity Distance", "Maximum distance from brush to mesh surface to affect paint");
prop= RNA_def_property(srna, "prox_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_ui_text(prop, "Only Use Alpha", "Only reads color ramp alpha");
prop= RNA_def_property(srna, "prox_falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -824,16 +832,16 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "prox_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_ui_text(prop, "Project", "Brush is projected to canvas from defined direction within brush proximity");
prop= RNA_def_property(srna, "ray_dir", 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 Dir", "Defines ray direction to use for projection. If brush object is located in that direction it's painted");
prop= RNA_def_property(srna, "prox_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_ui_text(prop, "Inner Proximity", "Proximity falloff is applied inside the volume");
/*
@@ -843,25 +851,25 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "psys");
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Particle Systems", "The particle system to paint with.");
+ RNA_def_property_ui_text(prop, "Particle Systems", "The particle system to paint with");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_resetDependancy");
prop= RNA_def_property(srna, "use_part_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_ui_text(prop, "Use Particle Radius", "Uses radius from particle settings");
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_ui_text(prop, "Solid Radius", "Radius that will be painted solid");
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_ui_text(prop, "Smooth Radius", "Smooth falloff added after solid radius");
/*
@@ -870,7 +878,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "paint_ramp", PROP_POINTER, PROP_NONE);
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_ui_text(prop, "Paint Color Ramp", "Color ramp used to define proximity falloff");
prop= RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vel_ramp");
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 94bd7446aa1..b1de44da0ac 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2216,7 +2216,7 @@ static void rna_def_space_time(BlenderRNA *brna)
prop= RNA_def_property(srna, "cache_dynamicpaint", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DYNAMICPAINT);
- RNA_def_property_ui_text(prop, "Dynamic PAint", "Show the active object's Dynamic Paint cache");
+ RNA_def_property_ui_text(prop, "Dynamic Paint", "Show the active object's Dynamic Paint cache");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
}
diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c
index 1e011146c82..0c40aea3bd9 100644
--- a/source/blender/modifiers/intern/MOD_dynamicpaint.c
+++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c
@@ -49,7 +49,7 @@ static void copyData(ModifierData *md, ModifierData *target)
static void freeData(ModifierData *md)
{
DynamicPaintModifierData *pmd = (DynamicPaintModifierData*) md;
- dynamicPaint_Modifier_free (pmd);
+ dynamicPaint_Modifier_free(pmd);
}
static CustomDataMask requiredDataMask(Object *ob, ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c
index c901a64f4d0..45720126535 100644
--- a/source/blender/modifiers/intern/MOD_util.c
+++ b/source/blender/modifiers/intern/MOD_util.c
@@ -107,7 +107,7 @@ void get_texture_coords(MappingInfoModifierData *dmd, Object *ob,
char uvname[32];
MTFace *tf;
- validate_layer_name(&dm->faceData, CD_MTFACE, dmd->uvlayer_name, uvname);
+ CustomData_validate_layer_name(&dm->faceData, CD_MTFACE, dmd->uvlayer_name, uvname);
tf = CustomData_get_layer_named(&dm->faceData, CD_MTFACE, uvname);
/* verts are given the UV from the first face that uses them */
@@ -178,25 +178,6 @@ void modifier_vgroup_cache(ModifierData *md, float (*vertexCos)[3])
/* lattice/mesh modifier too */
}
-void validate_layer_name(const CustomData *data, int type, char *name, char *outname)
-{
- int index = -1;
-
- /* if a layer name was given, try to find that layer */
- if(name[0])
- index = CustomData_get_named_layer_index(data, type, name);
-
- if(index < 0) {
- /* either no layer was specified, or the layer we want has been
- * deleted, so assign the active layer to name
- */
- index = CustomData_get_active_layer_index(data, type);
- strcpy(outname, data->layers[index].name);
- }
- else
- strcpy(outname, name);
-}
-
/* returns a cdderivedmesh if dm == NULL or is another type of derivedmesh */
DerivedMesh *get_cddm(Object *ob, struct EditMesh *em, DerivedMesh *dm, float (*vertexCos)[3])
{
diff --git a/source/blender/modifiers/intern/MOD_util.h b/source/blender/modifiers/intern/MOD_util.h
index 5e6f377acf1..55de151f3e0 100644
--- a/source/blender/modifiers/intern/MOD_util.h
+++ b/source/blender/modifiers/intern/MOD_util.h
@@ -49,7 +49,6 @@ struct TexResult;
void get_texture_value(struct Tex *texture, float *tex_co, struct TexResult *texres);
void get_texture_coords(struct MappingInfoModifierData *dmd, struct Object *ob, struct DerivedMesh *dm, float (*co)[3], float (*texco)[3], int numVerts);
void modifier_vgroup_cache(struct ModifierData *md, float (*vertexCos)[3]);
-void validate_layer_name(const struct CustomData *data, int type, char *name, char *outname);
struct DerivedMesh *get_cddm(struct Object *ob, struct EditMesh *em, struct DerivedMesh *dm, float (*vertexCos)[3]);
struct DerivedMesh *get_dm(struct Object *ob, struct EditMesh *em, struct DerivedMesh *dm, float (*vertexCos)[3], int orco);
void modifier_get_vgroup(struct Object *ob, struct DerivedMesh *dm, const char *name, struct MDeformVert **dvert, int *defgrp_index);
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index 0c343332736..7e858f41626 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -175,7 +175,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
if(!CustomData_has_layer(&dm->faceData, CD_MTFACE)) return dm;
/* make sure we're using an existing layer */
- validate_layer_name(&dm->faceData, CD_MTFACE, umd->uvlayer_name, uvname);
+ CustomData_validate_layer_name(&dm->faceData, CD_MTFACE, umd->uvlayer_name, uvname);
/* calculate a projection matrix and normal for each projector */
for(i = 0; i < num_projectors; ++i) {
diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c
index 820c7e16f53..a064ce809df 100644
--- a/source/blender/modifiers/intern/MOD_wave.c
+++ b/source/blender/modifiers/intern/MOD_wave.c
@@ -198,7 +198,7 @@ static void wavemod_get_texture_coords(WaveModifierData *wmd, Object *ob,
char uvname[32];
MTFace *tf;
- validate_layer_name(&dm->faceData, CD_MTFACE, wmd->uvlayer_name, uvname);
+ CustomData_validate_layer_name(&dm->faceData, CD_MTFACE, wmd->uvlayer_name, uvname);
tf = CustomData_get_layer_named(&dm->faceData, CD_MTFACE, uvname);
/* verts are given the UV from the first face that uses them */
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 4a55af6b47d..2414fe2ef1c 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -154,8 +154,6 @@ void cache_pointdensity(struct Render *re, struct Tex *tex){}
/* rna */
float *give_cursor(struct Scene *scene, struct View3D *v3d){return (float *) NULL;}
-void WM_timecursor(struct wmWindow *win, int nr){}
-void WM_cursor_restore(struct wmWindow *win){}
void WM_menutype_free(void){}
void WM_menutype_freelink(struct MenuType* mt){}
int WM_menutype_add(struct MenuType *mt) {return 0;}
@@ -182,13 +180,11 @@ void ED_armature_edit_bone_remove(struct bArmature *arm, struct EditBone *exBone
void object_test_constraints (struct Object *owner){}
void ED_object_parent(struct Object *ob, struct Object *par, int type, const char *substr){}
void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con){}
-int ED_operator_object_active_editable(struct bContext *C){return 0;}
void ED_node_composit_default(struct Scene *sce){}
void *ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *custumdata, int type){return 0;} /* XXX this one looks weird */
void *ED_region_draw_cb_customdata(void *handle){return 0;} /* XXX This one looks wrong also */
void ED_region_draw_cb_exit(struct ARegionType *art, void *handle){}
void ED_area_headerprint(struct ScrArea *sa, char *str){}
-void ED_update_for_newframe(struct Main *bmain, struct Scene *scene, struct bScreen *screen, int mute){}
struct EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, struct EditBone *ebo){return (struct EditBone *) NULL;}
struct EditBone *ED_armature_edit_bone_add(struct bArmature *arm, char *name){return (struct EditBone*) NULL;}
@@ -291,7 +287,6 @@ void ED_mesh_edges_add(struct Mesh *mesh, struct ReportList *reports, int count)
void ED_mesh_faces_add(struct Mesh *mesh, struct ReportList *reports, int count){}
void ED_mesh_material_link(struct Mesh *mesh, struct Material *ma){}
int ED_mesh_color_add(struct bContext *C, struct Scene *scene, struct Object *ob, struct Mesh *me){return 0;}
-int ED_mesh_color_remove_named(struct bContext *C, struct Object *ob, struct Mesh *me, const char *name){return 0;}
int ED_mesh_uv_texture_add(struct bContext *C, struct Mesh *me){return 0;}
void ED_object_constraint_dependency_update(struct Scene *scene, struct Object *ob){}
void ED_object_constraint_update(struct Object *ob){}