forked from bartvdbraak/blender
Dynamic Paint:
* Bake calculation memory is now freed if surface is deactivated or baked. * Fixed possibly incorrect brush influence when using "Non-Closed" brush setting. * Added new rna property descriptions. * Added some comments and general code cleanup.
This commit is contained in:
parent
404dd15a12
commit
5b71334484
@ -400,7 +400,7 @@ class PHYSICS_PT_dp_advanced_brush(PhysicButtonsPanel, bpy.types.Panel):
|
|||||||
if (brush.paint_source != 'POINT'):
|
if (brush.paint_source != 'POINT'):
|
||||||
sub.prop(brush, "prox_facealigned")
|
sub.prop(brush, "prox_facealigned")
|
||||||
sub = split.column()
|
sub = split.column()
|
||||||
sub.prop(brush, "prox_falloff", text="Falloff")
|
sub.prop(brush, "prox_falloff")
|
||||||
if brush.paint_source == "VOLDIST":
|
if brush.paint_source == "VOLDIST":
|
||||||
col = layout.row().column()
|
col = layout.row().column()
|
||||||
col.prop(brush, "prox_inverse")
|
col.prop(brush, "prox_inverse")
|
||||||
|
@ -21,14 +21,11 @@ struct PaintBakeData;
|
|||||||
|
|
||||||
/* Actual surface point */
|
/* Actual surface point */
|
||||||
typedef struct PaintSurfaceData {
|
typedef struct PaintSurfaceData {
|
||||||
/* surface format data */
|
void *format_data; /* special data for each surface "format" */
|
||||||
void *format_data;
|
void *type_data; /* data used by specific surface type */
|
||||||
/* surface type data */
|
struct PaintAdjData *adj_data; /* adjacency data for current surface */
|
||||||
void *type_data;
|
|
||||||
/* point neighbor data */
|
|
||||||
struct PaintAdjData *adj_data;
|
|
||||||
|
|
||||||
struct PaintBakeData *bData;
|
struct PaintBakeData *bData; /* temporary per step data used for frame calculation */
|
||||||
unsigned int total_points;
|
unsigned int total_points;
|
||||||
|
|
||||||
} PaintSurfaceData;
|
} PaintSurfaceData;
|
||||||
|
@ -130,12 +130,12 @@ typedef struct Bounds3D {
|
|||||||
|
|
||||||
typedef struct VolumeGrid {
|
typedef struct VolumeGrid {
|
||||||
int x,y,z;
|
int x,y,z;
|
||||||
Bounds3D grid_bounds;
|
Bounds3D grid_bounds; /* whole grid bounds */
|
||||||
|
|
||||||
Bounds3D *bounds; /* (x*y*z) precalculated grid cell bounds */
|
Bounds3D *bounds; /* (x*y*z) precalculated grid cell bounds */
|
||||||
unsigned int *s_pos; /* (x*y*z) search indexses */
|
unsigned int *s_pos; /* (x*y*z) t_index begin id */
|
||||||
unsigned int *s_num; /* (x*y*z) number of points */
|
unsigned int *s_num; /* (x*y*z) number of t_index points */
|
||||||
unsigned int *t_index; /* actual point index,
|
unsigned int *t_index; /* actual surface point index,
|
||||||
access: (s_pos+s_num) */
|
access: (s_pos+s_num) */
|
||||||
} VolumeGrid;
|
} VolumeGrid;
|
||||||
|
|
||||||
@ -158,42 +158,42 @@ typedef struct PaintBakeNormal {
|
|||||||
typedef struct PaintBakeData {
|
typedef struct PaintBakeData {
|
||||||
/* point space data */
|
/* point space data */
|
||||||
PaintBakeNormal *bNormal;
|
PaintBakeNormal *bNormal;
|
||||||
unsigned int *s_pos; /* index to start reading point sample realCoord */
|
unsigned int *s_pos; /* index to start reading point sample realCoord */
|
||||||
unsigned int *s_num; /* num of samples for each point */
|
unsigned int *s_num; /* num of realCoord samples */
|
||||||
Vec3f *realCoord; /* current pixel center world-space coordinates * numOfSamples
|
Vec3f *realCoord; /* current pixel center world-space coordinates for each sample
|
||||||
* ordered as (s_pos+sample_num)*/
|
* ordered as (s_pos+s_num)*/
|
||||||
|
|
||||||
/* adjacency */
|
/* adjacency info */
|
||||||
BakeNeighPoint *bNeighs; /* current frame neighbour distances, if required */
|
BakeNeighPoint *bNeighs; /* current global neighbour distances and directions, if required */
|
||||||
double average_dist;
|
double average_dist;
|
||||||
/* space partitioning */
|
/* space partitioning */
|
||||||
VolumeGrid *grid; /* space partitioning grid to optimize brush checks */
|
VolumeGrid *grid; /* space partitioning grid to optimize brush checks */
|
||||||
|
|
||||||
/* velocity and movement */
|
/* velocity and movement */
|
||||||
Vec3f *velocity; /* speed vector in global space movement per frame, if required */
|
Vec3f *velocity; /* speed vector in global space movement per frame, if required */
|
||||||
Vec3f *prev_velocity;
|
Vec3f *prev_velocity;
|
||||||
float *brush_velocity; /* special temp data for post-p velocity based brushes like smudge
|
float *brush_velocity; /* special temp data for post-p velocity based brushes like smudge
|
||||||
* 3 float dir vec + 1 float str */
|
* 3 float dir vec + 1 float str */
|
||||||
MVert *prev_verts; /* copy of previous frame vertices. used to observe surface movement */
|
MVert *prev_verts; /* copy of previous frame vertices. used to observe surface movement */
|
||||||
float prev_obmat[4][4]; /* previous frame object matrix */
|
float prev_obmat[4][4]; /* previous frame object matrix */
|
||||||
int clear;
|
int clear; /* flag to check if surface was cleared/reset -> have to redo velocity etc. */
|
||||||
|
|
||||||
} PaintBakeData;
|
} PaintBakeData;
|
||||||
|
|
||||||
/* UV Image sequence format point */
|
/* UV Image sequence format point */
|
||||||
typedef struct PaintUVPoint {
|
typedef struct PaintUVPoint {
|
||||||
/* Pixel / mesh data */
|
/* Pixel / mesh data */
|
||||||
unsigned int face_index, pixel_index; /* face index on domain derived mesh */
|
unsigned int face_index, pixel_index; /* face index on domain derived mesh */
|
||||||
unsigned int v1, v2, v3; /* vertex indexes */
|
unsigned int v1, v2, v3; /* vertex indexes */
|
||||||
|
|
||||||
unsigned int neighbour_pixel; /* If this pixel isn't uv mapped to any face,
|
unsigned int neighbour_pixel; /* If this pixel isn't uv mapped to any face,
|
||||||
but it's neighbouring pixel is */
|
but it's neighbouring pixel is */
|
||||||
short quad;
|
short quad;
|
||||||
} PaintUVPoint;
|
} PaintUVPoint;
|
||||||
|
|
||||||
typedef struct ImgSeqFormatData {
|
typedef struct ImgSeqFormatData {
|
||||||
PaintUVPoint *uv_p;
|
PaintUVPoint *uv_p;
|
||||||
Vec3f *barycentricWeights; /* b-weights for all pixel samples */
|
Vec3f *barycentricWeights; /* b-weights for all pixel samples */
|
||||||
} ImgSeqFormatData;
|
} ImgSeqFormatData;
|
||||||
|
|
||||||
typedef struct EffVelPoint {
|
typedef struct EffVelPoint {
|
||||||
@ -207,7 +207,7 @@ typedef struct EffVelPoint {
|
|||||||
|
|
||||||
typedef struct PaintAdjData {
|
typedef struct PaintAdjData {
|
||||||
unsigned int *n_target; /* array of neighbouring point indexes,
|
unsigned int *n_target; /* array of neighbouring point indexes,
|
||||||
for single sample use (n_index+neigh_num) */
|
for single sample use (n_index+neigh_num) */
|
||||||
unsigned int *n_index; /* index to start reading n_target for each point */
|
unsigned int *n_index; /* index to start reading n_target for each point */
|
||||||
unsigned int *n_num; /* num of neighs for each point */
|
unsigned int *n_num; /* num of neighs for each point */
|
||||||
unsigned int *flags; /* vertex adjacency flags */
|
unsigned int *flags; /* vertex adjacency flags */
|
||||||
@ -247,7 +247,8 @@ static int dynamicPaint_surfaceNumOfPoints(DynamicPaintSurface *surface)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* checks whether surface's format/type has realtime preview */
|
/* checks whether surface's format/type has realtime preview */
|
||||||
int dynamicPaint_surfaceHasColorPreview(DynamicPaintSurface *surface) {
|
int dynamicPaint_surfaceHasColorPreview(DynamicPaintSurface *surface)
|
||||||
|
{
|
||||||
if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) return 0;
|
if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) return 0;
|
||||||
else if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
|
else if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
|
||||||
if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE ||
|
if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE ||
|
||||||
@ -300,7 +301,8 @@ static void dynamicPaint_setPreview(DynamicPaintSurface *t_surface)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* change surface data to defaults on new type */
|
/* change surface data to defaults on new type */
|
||||||
void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface) {
|
void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface)
|
||||||
|
{
|
||||||
if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) {
|
if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) {
|
||||||
surface->output_name[0]='\0';
|
surface->output_name[0]='\0';
|
||||||
surface->output_name2[0]='\0';
|
surface->output_name2[0]='\0';
|
||||||
@ -370,7 +372,8 @@ static int surfaceDublicateNameExists(void *arg, const char *name)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dynamicPaintSurface_setUniqueName(DynamicPaintSurface *surface, char *basename) {
|
void dynamicPaintSurface_setUniqueName(DynamicPaintSurface *surface, char *basename)
|
||||||
|
{
|
||||||
char name[64];
|
char name[64];
|
||||||
strncpy(name, basename, 62); /* in case basename is surface->name use a copy */
|
strncpy(name, basename, 62); /* in case basename is surface->name use a copy */
|
||||||
BLI_uniquename_cb(surfaceDublicateNameExists, surface, name, '.', surface->name, sizeof(surface->name));
|
BLI_uniquename_cb(surfaceDublicateNameExists, surface, name, '.', surface->name, sizeof(surface->name));
|
||||||
@ -792,6 +795,17 @@ static void free_bakeData(PaintSurfaceData *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* free surface data if it's not used anymore */
|
||||||
|
void surface_freeUnusedData(DynamicPaintSurface *surface)
|
||||||
|
{
|
||||||
|
if (!surface->data) return;
|
||||||
|
|
||||||
|
/* free bakedata if not active or surface is baked */
|
||||||
|
if (!(surface->flags & MOD_DPAINT_ACTIVE) ||
|
||||||
|
(surface->pointcache && surface->pointcache->flag & PTCACHE_BAKED))
|
||||||
|
free_bakeData(surface->data);
|
||||||
|
}
|
||||||
|
|
||||||
static void dynamicPaint_freeSurfaceData(DynamicPaintSurface *surface)
|
static void dynamicPaint_freeSurfaceData(DynamicPaintSurface *surface)
|
||||||
{
|
{
|
||||||
PaintSurfaceData *data = surface->data;
|
PaintSurfaceData *data = surface->data;
|
||||||
@ -983,9 +997,6 @@ int dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, stru
|
|||||||
pmd->brush->paint_distance = 0.1f;
|
pmd->brush->paint_distance = 0.1f;
|
||||||
pmd->brush->proximity_falloff = MOD_DPAINT_PRFALL_SMOOTH;
|
pmd->brush->proximity_falloff = MOD_DPAINT_PRFALL_SMOOTH;
|
||||||
|
|
||||||
pmd->brush->displace_distance = 0.5f;
|
|
||||||
pmd->brush->prox_displace_strength = 0.5f;
|
|
||||||
|
|
||||||
pmd->brush->particle_radius = 0.2f;
|
pmd->brush->particle_radius = 0.2f;
|
||||||
pmd->brush->particle_smooth = 0.05f;
|
pmd->brush->particle_smooth = 0.05f;
|
||||||
|
|
||||||
@ -1062,8 +1073,6 @@ void dynamicPaint_Modifier_copy(struct DynamicPaintModifierData *pmd, struct Dyn
|
|||||||
tpmd->brush->particle_smooth = pmd->brush->particle_smooth;
|
tpmd->brush->particle_smooth = pmd->brush->particle_smooth;
|
||||||
tpmd->brush->paint_distance = pmd->brush->paint_distance;
|
tpmd->brush->paint_distance = pmd->brush->paint_distance;
|
||||||
tpmd->brush->psys = pmd->brush->psys;
|
tpmd->brush->psys = pmd->brush->psys;
|
||||||
tpmd->brush->displace_distance = pmd->brush->displace_distance;
|
|
||||||
tpmd->brush->prox_displace_strength = pmd->brush->prox_displace_strength;
|
|
||||||
|
|
||||||
tpmd->brush->paint_ramp = pmd->brush->paint_ramp;
|
tpmd->brush->paint_ramp = pmd->brush->paint_ramp;
|
||||||
|
|
||||||
@ -1093,13 +1102,15 @@ static void dynamicPaint_allocateSurfaceType(DynamicPaintSurface *surface)
|
|||||||
if (sData->type_data == NULL) printError(surface->canvas, "Not enough free memory!");
|
if (sData->type_data == NULL) printError(surface->canvas, "Not enough free memory!");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int surface_usesAdjDistance(DynamicPaintSurface *surface) {
|
static int surface_usesAdjDistance(DynamicPaintSurface *surface)
|
||||||
|
{
|
||||||
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT && surface->effect) return 1;
|
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT && surface->effect) return 1;
|
||||||
if (surface->type == MOD_DPAINT_SURFACE_T_WAVE) return 1;
|
if (surface->type == MOD_DPAINT_SURFACE_T_WAVE) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int surface_usesAdjData(DynamicPaintSurface *surface) {
|
static int surface_usesAdjData(DynamicPaintSurface *surface)
|
||||||
|
{
|
||||||
if (surface_usesAdjDistance(surface)) return 1;
|
if (surface_usesAdjDistance(surface)) return 1;
|
||||||
if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX &&
|
if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX &&
|
||||||
surface->flags & MOD_DPAINT_ANTIALIAS) return 1;
|
surface->flags & MOD_DPAINT_ANTIALIAS) return 1;
|
||||||
@ -1108,7 +1119,8 @@ static int surface_usesAdjData(DynamicPaintSurface *surface) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* initialize surface adjacency data */
|
/* initialize surface adjacency data */
|
||||||
static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, int force_init) {
|
static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, int force_init)
|
||||||
|
{
|
||||||
PaintSurfaceData *sData = surface->data;
|
PaintSurfaceData *sData = surface->data;
|
||||||
PaintAdjData *ed;
|
PaintAdjData *ed;
|
||||||
int *temp_data;
|
int *temp_data;
|
||||||
@ -1213,7 +1225,8 @@ static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, int for
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* clears surface data back to zero */
|
/* clears surface data back to zero */
|
||||||
void dynamicPaint_clearSurface(DynamicPaintSurface *surface) {
|
void dynamicPaint_clearSurface(DynamicPaintSurface *surface)
|
||||||
|
{
|
||||||
PaintSurfaceData *sData = surface->data;
|
PaintSurfaceData *sData = surface->data;
|
||||||
if (sData && sData->type_data) {
|
if (sData && sData->type_data) {
|
||||||
unsigned int data_size;
|
unsigned int data_size;
|
||||||
@ -1572,6 +1585,9 @@ static void dynamicPaint_frameUpdate(DynamicPaintModifierData *pmd, Scene *scene
|
|||||||
for (; surface; surface=surface->next) {
|
for (; surface; surface=surface->next) {
|
||||||
int current_frame = (int)scene->r.cfra;
|
int current_frame = (int)scene->r.cfra;
|
||||||
|
|
||||||
|
/* free bake data if not required anymore */
|
||||||
|
surface_freeUnusedData(surface);
|
||||||
|
|
||||||
/* image sequences are handled by bake operator */
|
/* image sequences are handled by bake operator */
|
||||||
if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) continue;
|
if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) continue;
|
||||||
if (!(surface->flags & MOD_DPAINT_ACTIVE)) continue;
|
if (!(surface->flags & MOD_DPAINT_ACTIVE)) continue;
|
||||||
@ -3183,6 +3199,8 @@ static void dynamicPaint_updatePointData(DynamicPaintSurface *surface, unsigned
|
|||||||
|
|
||||||
static int meshBrush_boundsIntersect(Bounds3D *b1, Bounds3D *b2, DynamicPaintBrushSettings *brush)
|
static int meshBrush_boundsIntersect(Bounds3D *b1, Bounds3D *b2, DynamicPaintBrushSettings *brush)
|
||||||
{
|
{
|
||||||
|
if (brush->flags & MOD_DPAINT_ACCEPT_NONCLOSED)
|
||||||
|
return 1;
|
||||||
if (brush->collision == MOD_DPAINT_COL_VOLUME)
|
if (brush->collision == MOD_DPAINT_COL_VOLUME)
|
||||||
return boundsIntersect(b1, b2);
|
return boundsIntersect(b1, b2);
|
||||||
else if (brush->collision == MOD_DPAINT_COL_DIST || brush->collision == MOD_DPAINT_COL_VOLDIST)
|
else if (brush->collision == MOD_DPAINT_COL_DIST || brush->collision == MOD_DPAINT_COL_VOLDIST)
|
||||||
@ -4636,7 +4654,8 @@ void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
|
|||||||
#define VALUE_DISSOLVE(VALUE, SPEED, SCALE, LOG) (VALUE) = (LOG) ? (VALUE) * 1.0f - 1.0f/((SPEED)/(SCALE)) : (VALUE) - 1.0f/(SPEED)*(SCALE)
|
#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 */
|
/* Do dissolve and fading effects */
|
||||||
static void dynamicPaint_surfacePreStep(DynamicPaintSurface *surface, float timescale) {
|
static void dynamicPaint_surfacePreStep(DynamicPaintSurface *surface, float timescale)
|
||||||
|
{
|
||||||
PaintSurfaceData *sData = surface->data;
|
PaintSurfaceData *sData = surface->data;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
@ -5445,7 +5464,8 @@ void DPAINT_OT_surface_slot_remove(wmOperatorType *ot)
|
|||||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int type_toggle_exec(bContext *C, wmOperator *op) {
|
static int type_toggle_exec(bContext *C, wmOperator *op)
|
||||||
|
{
|
||||||
|
|
||||||
Object *cObject = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
|
Object *cObject = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
@ -5496,7 +5516,8 @@ void DPAINT_OT_type_toggle(wmOperatorType *ot)
|
|||||||
ot->prop= prop;
|
ot->prop= prop;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int output_toggle_exec(bContext *C, wmOperator *op) {
|
static int output_toggle_exec(bContext *C, wmOperator *op)
|
||||||
|
{
|
||||||
|
|
||||||
Object *ob = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
|
Object *ob = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
@ -5560,5 +5581,4 @@ void DPAINT_OT_output_toggle(wmOperatorType *ot)
|
|||||||
/* properties */
|
/* properties */
|
||||||
prop= RNA_def_int(ot->srna, "index", 0, 0, 1, "Index", "", 0, 1);
|
prop= RNA_def_int(ot->srna, "index", 0, 0, 1, "Index", "", 0, 1);
|
||||||
ot->prop= prop;
|
ot->prop= prop;
|
||||||
}
|
}
|
||||||
|
|
@ -174,7 +174,6 @@ typedef struct DynamicPaintBrushSettings {
|
|||||||
|
|
||||||
float particle_radius, particle_smooth;
|
float particle_radius, particle_smooth;
|
||||||
float paint_distance;
|
float paint_distance;
|
||||||
float displace_distance, prox_displace_strength;
|
|
||||||
|
|
||||||
/* color ramps */
|
/* color ramps */
|
||||||
struct ColorBand *paint_ramp; /* Proximity paint falloff */
|
struct ColorBand *paint_ramp; /* Proximity paint falloff */
|
||||||
|
@ -257,12 +257,8 @@ static EnumPropertyItem *rna_DynamicPaint_surface_type_itemf(bContext *C, Pointe
|
|||||||
static void rna_def_canvas_surfaces(BlenderRNA *brna, PropertyRNA *cprop)
|
static void rna_def_canvas_surfaces(BlenderRNA *brna, PropertyRNA *cprop)
|
||||||
{
|
{
|
||||||
StructRNA *srna;
|
StructRNA *srna;
|
||||||
|
|
||||||
PropertyRNA *prop;
|
PropertyRNA *prop;
|
||||||
|
|
||||||
// FunctionRNA *func;
|
|
||||||
// PropertyRNA *parm;
|
|
||||||
|
|
||||||
RNA_def_property_srna(cprop, "DynamicPaintSurfaces");
|
RNA_def_property_srna(cprop, "DynamicPaintSurfaces");
|
||||||
srna= RNA_def_struct(brna, "DynamicPaintSurfaces", NULL);
|
srna= RNA_def_struct(brna, "DynamicPaintSurfaces", NULL);
|
||||||
RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings");
|
RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings");
|
||||||
@ -334,7 +330,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
|
|||||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||||
RNA_def_property_enum_sdna(prop, NULL, "format");
|
RNA_def_property_enum_sdna(prop, NULL, "format");
|
||||||
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_format);
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_format);
|
||||||
RNA_def_property_ui_text(prop, "Format", "");
|
RNA_def_property_ui_text(prop, "Format", "Surface Format");
|
||||||
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_changeFormat");
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_changeFormat");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "surface_type", PROP_ENUM, PROP_NONE);
|
prop= RNA_def_property(srna, "surface_type", PROP_ENUM, PROP_NONE);
|
||||||
@ -342,17 +338,17 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
|
|||||||
RNA_def_property_enum_sdna(prop, NULL, "type");
|
RNA_def_property_enum_sdna(prop, NULL, "type");
|
||||||
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_type);
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_type);
|
||||||
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_DynamicPaint_surface_type_itemf");
|
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_DynamicPaint_surface_type_itemf");
|
||||||
RNA_def_property_ui_text(prop, "Surface Type", "");
|
RNA_def_property_ui_text(prop, "Surface Type", "Surface Type");
|
||||||
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changeType");
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changeType");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE);
|
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_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ACTIVE);
|
||||||
RNA_def_property_ui_text(prop, "Is Active", "");
|
RNA_def_property_ui_text(prop, "Is Active", "Toggles whether surface is processed or ignored.");
|
||||||
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "show_preview", PROP_BOOLEAN, PROP_NONE);
|
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_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PREVIEW);
|
||||||
RNA_def_property_ui_text(prop, "Show Preview", "");
|
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");
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changePreview");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||||
@ -397,7 +393,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
|
|||||||
RNA_def_property_int_sdna(prop, NULL, "image_resolution");
|
RNA_def_property_int_sdna(prop, NULL, "image_resolution");
|
||||||
RNA_def_property_range(prop, 16.0, 4096.0);
|
RNA_def_property_range(prop, 16.0, 4096.0);
|
||||||
RNA_def_property_ui_range(prop, 16.0, 4096.0, 1, 0);
|
RNA_def_property_ui_range(prop, 16.0, 4096.0, 1, 0);
|
||||||
RNA_def_property_ui_text(prop, "Resolution", "Texture resolution");
|
RNA_def_property_ui_text(prop, "Resolution", "Output image resolution");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
|
prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
|
||||||
RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
|
RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
|
||||||
@ -512,7 +508,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop= RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH);
|
prop= RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH);
|
||||||
RNA_def_property_string_sdna(prop, NULL, "image_output_path");
|
RNA_def_property_string_sdna(prop, NULL, "image_output_path");
|
||||||
RNA_def_property_ui_text(prop, "Output Path", "Directory/name to the textures");
|
RNA_def_property_ui_text(prop, "Output Path", "Directory to save the textures");
|
||||||
|
|
||||||
/* output for primary surface data */
|
/* output for primary surface data */
|
||||||
prop= RNA_def_property(srna, "output_name", PROP_STRING, PROP_NONE);
|
prop= RNA_def_property(srna, "output_name", PROP_STRING, PROP_NONE);
|
||||||
@ -579,7 +575,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
|
|||||||
RNA_def_property_float_sdna(prop, NULL, "wave_speed");
|
RNA_def_property_float_sdna(prop, NULL, "wave_speed");
|
||||||
RNA_def_property_range(prop, 0.01, 3.0);
|
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_range(prop, 0.01, 1.5, 1, 2);
|
||||||
RNA_def_property_ui_text(prop, "Speed", "Wave speed.");
|
RNA_def_property_ui_text(prop, "Speed", "Wave propogation speed.");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE);
|
prop= RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE);
|
||||||
RNA_def_property_float_sdna(prop, NULL, "wave_timescale");
|
RNA_def_property_float_sdna(prop, NULL, "wave_timescale");
|
||||||
@ -700,7 +696,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop= RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE);
|
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_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 alpha.");
|
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);
|
prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
|
||||||
RNA_def_property_pointer_sdna(prop, NULL, "mat");
|
RNA_def_property_pointer_sdna(prop, NULL, "mat");
|
||||||
@ -715,7 +711,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
|
|||||||
RNA_def_property_float_sdna(prop, NULL, "wetness");
|
RNA_def_property_float_sdna(prop, NULL, "wetness");
|
||||||
RNA_def_property_range(prop, 0.0, 1.0);
|
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_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 wet map. Some effects only affect wet paint.");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "paint_erase", PROP_BOOLEAN, PROP_NONE);
|
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_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ERASE);
|
||||||
@ -731,23 +727,23 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
|
|||||||
RNA_def_property_float_sdna(prop, NULL, "wave_factor");
|
RNA_def_property_float_sdna(prop, NULL, "wave_factor");
|
||||||
RNA_def_property_range(prop, -2.0, 2.0);
|
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_range(prop, -1.0, 1.0, 5, 2);
|
||||||
RNA_def_property_ui_text(prop, "Factor", "Multiplier for wave strenght of this brush.");
|
RNA_def_property_ui_text(prop, "Factor", "Multiplier for wave influence of this brush.");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "do_smudge", PROP_BOOLEAN, PROP_NONE);
|
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_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DO_SMUDGE);
|
||||||
RNA_def_property_ui_text(prop, "Do Smudge", "");
|
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);
|
prop= RNA_def_property(srna, "smudge_strength", PROP_FLOAT, PROP_NONE);
|
||||||
RNA_def_property_float_sdna(prop, NULL, "smudge_strength");
|
RNA_def_property_float_sdna(prop, NULL, "smudge_strength");
|
||||||
RNA_def_property_range(prop, 0.0, 1.0);
|
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_range(prop, 0.0, 1.0, 5, 2);
|
||||||
RNA_def_property_ui_text(prop, "Smudge Strength", "");
|
RNA_def_property_ui_text(prop, "Smudge Strength", "Smudge effect strength");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "max_velocity", PROP_FLOAT, PROP_NONE);
|
prop= RNA_def_property(srna, "max_velocity", PROP_FLOAT, PROP_NONE);
|
||||||
RNA_def_property_float_sdna(prop, NULL, "max_velocity");
|
RNA_def_property_float_sdna(prop, NULL, "max_velocity");
|
||||||
RNA_def_property_range(prop, 0.0001, 10.0);
|
RNA_def_property_range(prop, 0.0001, 10.0);
|
||||||
RNA_def_property_ui_range(prop, 0.1, 2.0, 5, 2);
|
RNA_def_property_ui_range(prop, 0.1, 2.0, 5, 2);
|
||||||
RNA_def_property_ui_text(prop, "Max Velocity", "");
|
RNA_def_property_ui_text(prop, "Max Velocity", "Velocity considered as maximum influence. (Blender units per frame)");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "velocity_alpha", PROP_BOOLEAN, PROP_NONE);
|
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_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_ALPHA);
|
||||||
@ -755,7 +751,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop= RNA_def_property(srna, "velocity_depth", PROP_BOOLEAN, PROP_NONE);
|
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_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 color 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);
|
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_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_COLOR);
|
||||||
@ -772,7 +768,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop= RNA_def_property(srna, "accept_nonclosed", PROP_BOOLEAN, PROP_NONE);
|
prop= RNA_def_property(srna, "accept_nonclosed", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ACCEPT_NONCLOSED);
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ACCEPT_NONCLOSED);
|
||||||
RNA_def_property_ui_text(prop, "Non-Closed", "Allows painting with non-closed meshes. Brush influence is defined by ray dir.");
|
RNA_def_property_ui_text(prop, "Non-Closed", "Allows painting with non-closed meshes. Brush influence is defined by custom ray direction.");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "ray_dir", PROP_ENUM, PROP_NONE);
|
prop= RNA_def_property(srna, "ray_dir", PROP_ENUM, PROP_NONE);
|
||||||
RNA_def_property_enum_sdna(prop, NULL, "ray_dir");
|
RNA_def_property_enum_sdna(prop, NULL, "ray_dir");
|
||||||
@ -783,37 +779,25 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
|
|||||||
RNA_def_property_float_sdna(prop, NULL, "paint_distance");
|
RNA_def_property_float_sdna(prop, NULL, "paint_distance");
|
||||||
RNA_def_property_range(prop, 0.0, 500.0);
|
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_range(prop, 0.0, 500.0, 10, 3);
|
||||||
RNA_def_property_ui_text(prop, "Proximity Distance", "Maximum distance 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);
|
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_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, "displace_distance", PROP_FLOAT, PROP_NONE);
|
|
||||||
RNA_def_property_float_sdna(prop, NULL, "displace_distance");
|
|
||||||
RNA_def_property_range(prop, 0.0, 10.0);
|
|
||||||
RNA_def_property_ui_range(prop, 0.0, 10.0, 5, 3);
|
|
||||||
RNA_def_property_ui_text(prop, "Displace Distance", "Maximum distance to mesh surface to displace.");
|
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "prox_displace_strength", PROP_FLOAT, PROP_NONE);
|
|
||||||
RNA_def_property_float_sdna(prop, NULL, "prox_displace_strength");
|
|
||||||
RNA_def_property_range(prop, 0.0, 1.0);
|
|
||||||
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 3);
|
|
||||||
RNA_def_property_ui_text(prop, "Strength", "How much of maximum intersection will be used in edges.");
|
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "prox_falloff", PROP_ENUM, PROP_NONE);
|
prop= RNA_def_property(srna, "prox_falloff", PROP_ENUM, PROP_NONE);
|
||||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||||
RNA_def_property_enum_sdna(prop, NULL, "proximity_falloff");
|
RNA_def_property_enum_sdna(prop, NULL, "proximity_falloff");
|
||||||
RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff);
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff);
|
||||||
RNA_def_property_ui_text(prop, "Paint Falloff", "");
|
RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "prox_facealigned", PROP_BOOLEAN, PROP_NONE);
|
prop= RNA_def_property(srna, "prox_facealigned", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PROX_FACEALIGNED);
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PROX_FACEALIGNED);
|
||||||
RNA_def_property_ui_text(prop, "Face Aligned", "Check proximity in face normal direction only.");
|
RNA_def_property_ui_text(prop, "Face Aligned", "Check proximity in canvas face normal direction only.");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "prox_inverse", PROP_BOOLEAN, PROP_NONE);
|
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_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_INVERSE_PROX);
|
||||||
RNA_def_property_ui_text(prop, "Inner", "Invert proximity to reduce effect inside the volume.");
|
RNA_def_property_ui_text(prop, "Inner", "Proximity falloff is applied inside the volume.");
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -841,7 +825,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
|
|||||||
RNA_def_property_float_sdna(prop, NULL, "particle_smooth");
|
RNA_def_property_float_sdna(prop, NULL, "particle_smooth");
|
||||||
RNA_def_property_range(prop, 0.0, 10.0);
|
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_range(prop, 0.0, 1.0, 5, 0);
|
||||||
RNA_def_property_ui_text(prop, "Smooth Radius", "Smooth falloff added after solid paint area.");
|
RNA_def_property_ui_text(prop, "Smooth Radius", "Smooth falloff added after solid radius.");
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -855,7 +839,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
|
|||||||
prop= RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE);
|
prop= RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE);
|
||||||
RNA_def_property_pointer_sdna(prop, NULL, "vel_ramp");
|
RNA_def_property_pointer_sdna(prop, NULL, "vel_ramp");
|
||||||
RNA_def_property_struct_type(prop, "ColorRamp");
|
RNA_def_property_struct_type(prop, "ColorRamp");
|
||||||
RNA_def_property_ui_text(prop, "Velocity Color Ramp", "");
|
RNA_def_property_ui_text(prop, "Velocity Color Ramp", "Color ramp used to define brush velocity effect");
|
||||||
}
|
}
|
||||||
|
|
||||||
void RNA_def_dynamic_paint(BlenderRNA *brna)
|
void RNA_def_dynamic_paint(BlenderRNA *brna)
|
||||||
|
Loading…
Reference in New Issue
Block a user