33 {0,
nullptr, 0,
nullptr,
nullptr},
40# include <fmt/format.h>
54static std::optional<std::string> rna_DynamicPaintCanvasSettings_path(
const PointerRNA *ptr)
59 char name_esc[
sizeof(md->name) * 2];
62 return fmt::format(
"modifiers[\"{}\"].canvas_settings", name_esc);
65static std::optional<std::string> rna_DynamicPaintBrushSettings_path(
const PointerRNA *ptr)
69 char name_esc[
sizeof(md->name) * 2];
72 return fmt::format(
"modifiers[\"{}\"].brush_settings", name_esc);
75static std::optional<std::string> rna_DynamicPaintSurface_path(
const PointerRNA *ptr)
79 char name_esc[
sizeof(md->name) * 2];
80 char name_esc_surface[
sizeof(surface->name) * 2];
83 BLI_str_escape(name_esc_surface, surface->name,
sizeof(name_esc_surface));
85 "modifiers[\"{}\"].canvas_settings.canvas_surfaces[\"{}\"]", name_esc, name_esc_surface);
97static void rna_DynamicPaintSurfaces_updateFrames(
Main * ,
107 rna_DynamicPaint_redoModifier(bmain, scene, ptr);
110static void rna_DynamicPaintSurface_initialcolortype(
Main *bmain,
Scene *scene,
PointerRNA *ptr)
116 rna_DynamicPaint_redoModifier(bmain, scene, ptr);
119static void rna_DynamicPaintSurface_uniqueName(
Main * ,
131 rna_DynamicPaintSurface_reset(bmain, scene, ptr);
134static void rna_DynamicPaintSurfaces_changeFormat(
Main *bmain,
Scene *scene,
PointerRNA *ptr)
146 rna_DynamicPaintSurface_reset(bmain, scene, ptr);
154static void rna_DynamicPaintSurface_reset_dependency(
Main *bmain,
Scene *scene,
PointerRNA *ptr)
156 rna_DynamicPaintSurface_reset(bmain, scene, ptr);
157 rna_DynamicPaint_reset_dependency(bmain, scene, ptr);
166 for (; surface; surface = surface->next) {
167 if (
id ==
canvas->active_sur) {
180 iter, ptr,(
void *)
canvas->surfaces,
sizeof(PaintSurface),
canvas->totsur, 0, 0);
185static int rna_Surface_active_point_index_get(
PointerRNA *ptr)
188 return canvas->active_sur;
191static void rna_Surface_active_point_index_set(
PointerRNA *ptr,
int value)
194 canvas->active_sur = value;
197static void rna_Surface_active_point_range(
207static void rna_DynamicPaint_uvlayer_set(
PointerRNA *ptr,
const char *value)
213 for (; surface; surface = surface->next) {
214 if (
id ==
canvas->active_sur) {
216 ptr, value, surface->uvlayer_name,
sizeof(surface->uvlayer_name));
224static bool rna_DynamicPaint_is_cache_user_get(
PointerRNA *ptr)
250 tmp.identifier =
"PAINT";
252 tmp.icon = ICON_TPAINT_HLT;
258 tmp.identifier =
"DISPLACE";
259 tmp.name =
"Displace";
260 tmp.icon = ICON_MOD_DISPLACE;
267 tmp.identifier =
"WEIGHT";
269 tmp.icon = ICON_MOD_VERTEX_WEIGHT;
276 tmp.identifier =
"WAVE";
278 tmp.icon = ICON_MOD_WAVE;
308 "rna_Surface_active_point_index_get",
309 "rna_Surface_active_point_index_set",
310 "rna_Surface_active_point_range");
332 {0,
nullptr, 0,
nullptr,
nullptr},
338 {0,
nullptr, 0,
nullptr,
nullptr},
347 {0,
nullptr, 0,
nullptr,
nullptr},
353 {1,
"SPREAD", 0,
"Spread",
""},
354 {2,
"DRIP", 0,
"Drip",
""},
355 {3,
"SHRINK", 0,
"Shrink",
""},
356 {0,
nullptr, 0,
nullptr,
nullptr},
363 {0,
nullptr, 0,
nullptr,
nullptr},
370 {0,
nullptr, 0,
nullptr,
nullptr},
409 prop,
"Brush Collection",
"Only use brush objects from this collection");
427 prop,
"Dissolve Time",
"Approximately in how many frames should dissolve happen");
437 prop,
"Dry Time",
"Approximately in how many frames should drying happen");
474 prop,
"Sub-Steps",
"Do extra frames between scene frames to ensure smooth motion");
482 " multisampling to smooth paint edges");
490 prop,
"Influence Scale",
"Adjust influence brush objects have on this surface");
498 prop,
"Radius Scale",
"Adjust radius of proximity brushes or particles for this surface");
511 "rna_DynamicPaintSurface_initialcolortype");
542 prop,
"Slow",
"Use logarithmic drying (makes high values to dry faster than low values)");
547 prop,
"Slow",
"Use logarithmic dissolve (makes high values to fade faster than low values)");
553 prop,
"Use Spread",
"Process spread effect (spread wet paint around surface)");
561 prop,
"Spread Speed",
"How fast spread effect moves on the canvas surface");
568 prop,
"Color Dry",
"The wetness level when colors start to shift to the background");
580 prop,
"Use Drip",
"Process drip effect (drip wet paint to gravity direction)");
594 prop,
"Shrink Speed",
"How fast shrink effect moves on the canvas surface");
621 prop,
"Premultiply Alpha",
"Multiply color by alpha (recommended for Blender input)");
647 func =
RNA_def_function(srna,
"output_exists",
"rna_DynamicPaint_is_output_exists");
651 parm =
RNA_def_int(func,
"index", 0, 0, 1,
"Index",
"", 0, 1);
664 "Maximum level of depth intersection in object space (use 0.0 to disable)");
673 prop,
"Displace Factor",
"Strength of displace when applied to the mesh");
691 prop,
"Incremental",
"New displace is added cumulatively on top of existing");
720 "Limit maximum steepness of wave slope between simulation points "
721 "(use higher values for smoother waves at expense of reduced detail)");
746 srna =
RNA_def_struct(brna,
"DynamicPaintCanvasSettings",
nullptr);
756 "rna_DynamicPaint_surfaces_begin",
757 "rna_iterator_listbase_next",
758 "rna_iterator_listbase_end",
759 "rna_iterator_listbase_get",
781 {0,
nullptr, 0,
nullptr,
nullptr},
788 {0,
nullptr, 0,
nullptr,
nullptr},
796 {0,
nullptr, 0,
nullptr,
nullptr},
803 {0,
nullptr, 0,
nullptr,
nullptr},
806 srna =
RNA_def_struct(brna,
"DynamicPaintBrushSettings",
nullptr);
830 prop,
"Absolute Alpha",
"Only increase alpha value if paint alpha is higher than existing");
839 "Paint wetness, visible in wetmap (some effects only affect wet paint)");
864 "Maximum level of surface intersection used to influence waves (use 0.0 to disable)");
869 prop,
"Do Smudge",
"Make this brush to smudge existing paint as it moves");
881 prop,
"Max Velocity",
"Velocity considered as maximum influence (Blender units per frame)");
886 prop,
"Multiply Alpha",
"Multiply brush influence by velocity color ramp alpha");
894 "Multiply brush intersection depth (displace, waves) by velocity ramp alpha");
917 prop,
"Proximity Distance",
"Maximum distance from brush to mesh surface to affect paint");
938 "Brush is projected to canvas from defined direction within brush proximity");
947 "Ray direction to use for projection (if brush object is located in that direction "
954 prop,
"Inner Proximity",
"Proximity falloff is applied inside the volume");
998 prop,
"Paint Color Ramp",
"Color ramp used to define proximity falloff");
1005 prop,
"Velocity Color Ramp",
"Color ramp used to define brush velocity effect");
#define BLI_STR_UTF8_MULTIPLICATION_SIGN
#define BLT_I18NCONTEXT_ID_BRUSH
#define BLT_I18NCONTEXT_ID_SIMULATION
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
bool dynamicPaint_resetSurface(const struct Scene *scene, struct DynamicPaintSurface *surface)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
@ MOD_DPAINT_IMGFORMAT_PNG
@ MOD_DPAINT_IMGFORMAT_OPENEXR
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void dynamicPaint_clearSurface(const struct Scene *scene, struct DynamicPaintSurface *surface)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
bool dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int output)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
@ MOD_DPAINT_INITIAL_VERTEXCOLOR
@ MOD_DPAINT_INITIAL_NONE
@ MOD_DPAINT_INITIAL_COLOR
@ MOD_DPAINT_INITIAL_TEXTURE
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
@ MOD_DPAINT_PRFALL_SMOOTH
@ MOD_DPAINT_PRFALL_CONSTANT
static void rna_def_canvas_surfaces(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
@ MOD_DPAINT_PROX_PROJECT
@ MOD_DPAINT_INVERSE_PROX
@ MOD_DPAINT_VELOCITY_ALPHA
@ MOD_DPAINT_NEGATE_VOLUME
@ MOD_DPAINT_VELOCITY_COLOR
@ MOD_DPAINT_VELOCITY_DEPTH
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void DEG_id_tag_update(ID *id, unsigned int flags)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void rna_object_uvlayer_name_set(PointerRNA *ptr, const char *value, char *result, int result_maxncpy)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
char char size_t BLI_str_escape(char *__restrict dst, StringRef src, size_t dst_maxncpy) ATTR_NONNULL(1)
@ MOD_DYNAMICPAINT_TYPE_CANVAS
@ MOD_DYNAMICPAINT_TYPE_BRUSH
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
@ MOD_DPAINT_SURFACE_F_VERTEX
@ MOD_DPAINT_SURFACE_F_IMAGESEQ
@ MOD_DPAINT_RAY_BRUSH_AVG
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
@ MOD_DPAINT_WAVEB_CHANGE
@ MOD_DPAINT_WAVEB_REFLECT
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
static void rna_def_dynamic_paint_canvas_settings(BlenderRNA *brna)
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
@ MOD_DPAINT_DISP_DISPLACE
const EnumPropertyItem rna_enum_prop_dynamicpaint_type_items[]
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
@ MOD_DPAINT_DISP_INCREMENTAL
@ MOD_DPAINT_WAVE_OPEN_BORDERS
@ MOD_DPAINT_DISSOLVE_LOG
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
void DEG_relations_tag_update(Main *bmain)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
static void rna_def_canvas_surface(BlenderRNA *brna)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_dynamic_paint(BlenderRNA *brna)
@ MOD_DPAINT_SURFACE_T_PAINT
@ MOD_DPAINT_SURFACE_T_WAVE
@ MOD_DPAINT_SURFACE_T_WEIGHT
@ MOD_DPAINT_SURFACE_T_DISPLACE
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
@ MOD_DPAINT_EFFECT_DO_DRIP
@ MOD_DPAINT_EFFECT_DO_SHRINK
@ MOD_DPAINT_EFFECT_DO_SPREAD
void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface)