32# include <fmt/format.h>
49 rna_cloth_update(bmain, scene,
ptr);
65static void rna_ClothSettings_bending_set(
PointerRNA *
ptr,
float value)
69 settings->bending = value;
72 if (value > settings->max_bend) {
73 settings->max_bend = value;
77static void rna_ClothSettings_max_bend_set(
PointerRNA *
ptr,
float value)
82 if (value < settings->bending) {
83 value = settings->bending;
86 settings->max_bend = value;
89static void rna_ClothSettings_tension_set(
PointerRNA *
ptr,
float value)
93 settings->tension = value;
96 if (value > settings->max_tension) {
97 settings->max_tension = value;
101static void rna_ClothSettings_max_tension_set(
PointerRNA *
ptr,
float value)
106 if (value < settings->tension) {
107 value = settings->tension;
110 settings->max_tension = value;
113static void rna_ClothSettings_compression_set(
PointerRNA *
ptr,
float value)
117 settings->compression = value;
120 if (value > settings->max_compression) {
121 settings->max_compression = value;
125static void rna_ClothSettings_max_compression_set(
PointerRNA *
ptr,
float value)
130 if (value < settings->compression) {
131 value = settings->compression;
134 settings->max_compression = value;
137static void rna_ClothSettings_shear_set(
PointerRNA *
ptr,
float value)
141 settings->shear = value;
144 if (value > settings->max_shear) {
145 settings->max_shear = value;
149static void rna_ClothSettings_max_shear_set(
PointerRNA *
ptr,
float value)
154 if (value < settings->shear) {
155 value = settings->shear;
158 settings->max_shear = value;
161static void rna_ClothSettings_max_sewing_set(
PointerRNA *
ptr,
float value)
170 settings->max_sewing = value;
173static void rna_ClothSettings_shrink_min_set(
PointerRNA *
ptr,
float value)
177 settings->shrink_min = value;
180 if (value > settings->shrink_max) {
181 settings->shrink_max = value;
185static void rna_ClothSettings_shrink_max_set(
PointerRNA *
ptr,
float value)
190 if (value < settings->shrink_min) {
191 value = settings->shrink_min;
194 settings->shrink_max = value;
197static void rna_ClothSettings_internal_tension_set(
PointerRNA *
ptr,
float value)
201 settings->internal_tension = value;
204 if (value > settings->max_internal_tension) {
205 settings->max_internal_tension = value;
209static void rna_ClothSettings_max_internal_tension_set(
PointerRNA *
ptr,
float value)
214 if (value < settings->internal_tension) {
215 value = settings->internal_tension;
218 settings->max_internal_tension = value;
221static void rna_ClothSettings_internal_compression_set(
PointerRNA *
ptr,
float value)
225 settings->internal_compression = value;
228 if (value > settings->max_internal_compression) {
229 settings->max_internal_compression = value;
233static void rna_ClothSettings_max_internal_compression_set(
PointerRNA *
ptr,
float value)
238 if (value < settings->internal_compression) {
239 value = settings->internal_compression;
242 settings->max_internal_compression = value;
245static void rna_ClothSettings_mass_vgroup_get(
PointerRNA *
ptr,
char *value)
251static int rna_ClothSettings_mass_vgroup_length(
PointerRNA *
ptr)
257static void rna_ClothSettings_mass_vgroup_set(
PointerRNA *
ptr,
const char *value)
263static void rna_ClothSettings_shrink_vgroup_get(
PointerRNA *
ptr,
char *value)
269static int rna_ClothSettings_shrink_vgroup_length(
PointerRNA *
ptr)
275static void rna_ClothSettings_shrink_vgroup_set(
PointerRNA *
ptr,
const char *value)
281static void rna_ClothSettings_struct_vgroup_get(
PointerRNA *
ptr,
char *value)
287static int rna_ClothSettings_struct_vgroup_length(
PointerRNA *
ptr)
293static void rna_ClothSettings_struct_vgroup_set(
PointerRNA *
ptr,
const char *value)
299static void rna_ClothSettings_shear_vgroup_get(
PointerRNA *
ptr,
char *value)
305static int rna_ClothSettings_shear_vgroup_length(
PointerRNA *
ptr)
311static void rna_ClothSettings_shear_vgroup_set(
PointerRNA *
ptr,
const char *value)
317static void rna_ClothSettings_bend_vgroup_get(
PointerRNA *
ptr,
char *value)
323static int rna_ClothSettings_bend_vgroup_length(
PointerRNA *
ptr)
329static void rna_ClothSettings_bend_vgroup_set(
PointerRNA *
ptr,
const char *value)
335static void rna_ClothSettings_internal_vgroup_get(
PointerRNA *
ptr,
char *value)
341static int rna_ClothSettings_internal_vgroup_length(
PointerRNA *
ptr)
347static void rna_ClothSettings_internal_vgroup_set(
PointerRNA *
ptr,
const char *value)
353static void rna_ClothSettings_pressure_vgroup_get(
PointerRNA *
ptr,
char *value)
359static int rna_ClothSettings_pressure_vgroup_length(
PointerRNA *
ptr)
365static void rna_ClothSettings_pressure_vgroup_set(
PointerRNA *
ptr,
const char *value)
371static void rna_CollSettings_selfcol_vgroup_get(
PointerRNA *
ptr,
char *value)
377static int rna_CollSettings_selfcol_vgroup_length(
PointerRNA *
ptr)
383static void rna_CollSettings_selfcol_vgroup_set(
PointerRNA *
ptr,
const char *value)
389static void rna_CollSettings_objcol_vgroup_get(
PointerRNA *
ptr,
char *value)
395static int rna_CollSettings_objcol_vgroup_length(
PointerRNA *
ptr)
401static void rna_CollSettings_objcol_vgroup_set(
PointerRNA *
ptr,
const char *value)
415static void rna_ClothSettings_rest_shape_key_set(
PointerRNA *
ptr,
426static void rna_ClothSettings_gravity_get(
PointerRNA *
ptr,
float *values)
435static void rna_ClothSettings_gravity_set(
PointerRNA *
ptr,
const float *values)
444static std::optional<std::string> rna_ClothSettings_path(
const PointerRNA *
ptr)
450 char name_esc[
sizeof(md->
name) * 2];
452 return fmt::format(
"modifiers[\"{}\"].settings", name_esc);
457static std::optional<std::string> rna_ClothCollisionSettings_path(
const PointerRNA *
ptr)
463 char name_esc[
sizeof(md->
name) * 2];
465 return fmt::format(
"modifiers[\"{}\"].collision_settings", name_esc);
470static int rna_ClothSettings_internal_editable(
const PointerRNA *
ptr,
const char **r_info)
475 *r_info =
"Only available with angular bending springs.";
495 "The provided data did not satisfy the prerequisites"},
500 "Iterative procedure did not converge"},
505 "The inputs are invalid, or the algorithm has been improperly called"},
506 {0,
nullptr, 0,
nullptr,
nullptr},
565 "Cloth model with linear bending springs (legacy)"},
566 {0,
nullptr, 0,
nullptr,
nullptr},
582 prop,
"Goal Minimum",
"Goal minimum, vertex group weights are scaled to match this range");
589 prop,
"Goal Maximum",
"Goal maximum, vertex group weights are scaled to match this range");
598 "Default Goal (vertex target position) value, when no Vertex Group used");
605 prop,
"Goal Stiffness",
"Goal (vertex target position) spring stiffness");
636 prop,
"Target Density Strength",
"Influence of target density on the simulation");
648 "rna_ClothSettings_mass_vgroup_get",
649 "rna_ClothSettings_mass_vgroup_length",
650 "rna_ClothSettings_mass_vgroup_set");
659 prop,
"rna_ClothSettings_gravity_get",
"rna_ClothSettings_gravity_set",
nullptr);
669 prop,
"Air Damping",
"Air has normally some thickness which slows falling things down");
685 "Quality of the simulation in steps per frame (higher is better quality but slower)");
697 "rna_ClothSettings_shrink_vgroup_get",
698 "rna_ClothSettings_shrink_vgroup_length",
699 "rna_ClothSettings_shrink_vgroup_set");
724 prop,
"Voxel Grid Cell Size",
"Size of the voxel grid cells for interaction effects");
732 prop,
"Tension Spring Damping",
"Amount of damping in stretching behavior");
739 prop,
"Compression Spring Damping",
"Amount of damping in compression behavior");
767 prop,
"Compression Stiffness",
"How much the material resists compression");
775 prop,
"Compression Stiffness Maximum",
"Maximum compression stiffness value");
801 "rna_ClothSettings_struct_vgroup_get",
802 "rna_ClothSettings_struct_vgroup_length",
803 "rna_ClothSettings_struct_vgroup_set");
806 "Structural Stiffness Vertex Group",
807 "Vertex group for fine control over structural stiffness");
812 "rna_ClothSettings_shear_vgroup_get",
813 "rna_ClothSettings_shear_vgroup_length",
814 "rna_ClothSettings_shear_vgroup_set");
817 prop,
"Shear Stiffness Vertex Group",
"Vertex group for fine control over shear stiffness");
838 prop,
"Bending Spring Damping",
"Amount of damping in bending behavior");
849 "rna_ClothSettings_bend_vgroup_get",
850 "rna_ClothSettings_bend_vgroup_length",
851 "rna_ClothSettings_bend_vgroup_set");
854 "Bending Stiffness Vertex Group",
855 "Vertex group for fine control over bending stiffness");
867 "rna_ClothSettings_rest_shape_key_get",
868 "rna_ClothSettings_rest_shape_key_set",
873 prop,
"Rest Shape Key",
"Shape key to use the rest spring lengths from");
879 prop,
"Dynamic Base Mesh",
"Make simulation respect deformations in the base mesh");
893 "Create Internal Springs",
894 "Simulate an internal volume structure by creating springs connecting "
895 "the opposite sides of the mesh");
903 "Check Internal Spring Normals",
904 "Require the points the internal springs connect to have opposite "
905 "normal directions");
915 "Internal Spring Max Length",
916 "The maximum length an internal spring can have during creation. If the distance between "
917 "internal points is greater than this, no internal spring will be created between these "
919 "A length of zero means that there is no length limit.");
928 "Internal Spring Max Diversion",
929 "How much the rays used to connect the internal points can diverge "
930 "from the vertex normal");
947 prop,
nullptr,
"rna_ClothSettings_max_internal_tension_set",
nullptr);
956 prop,
nullptr,
"rna_ClothSettings_internal_compression_set",
nullptr);
958 prop,
"Compression Stiffness",
"How much the material resists compression");
966 prop,
nullptr,
"rna_ClothSettings_max_internal_compression_set",
nullptr);
968 prop,
"Compression Stiffness Maximum",
"Maximum compression stiffness value");
974 "rna_ClothSettings_internal_vgroup_get",
975 "rna_ClothSettings_internal_vgroup_length",
976 "rna_ClothSettings_internal_vgroup_set");
979 "Internal Springs Vertex Group",
980 "Vertex group for fine control over the internal spring stiffness");
996 "Use the Target Volume parameter as the initial volume, instead "
997 "of calculating it from the mesh itself");
1007 "The uniform pressure that is constantly applied to the mesh, in units "
1008 "of Pressure Scale. Can be negative.");
1017 "The mesh volume where the inner/outer pressure will be the same. If "
1018 "set to zero the change in volume will not affect pressure.");
1026 "Ambient pressure (kPa) that balances out between the inside and "
1027 "outside of the object when it has the target volume");
1036 "Density (kg/l) of the fluid contained inside the object, used to create "
1037 "a hydrostatic pressure gradient simulating the weight of the internal fluid, "
1038 "or buoyancy from the surrounding fluid if negative");
1043 "rna_ClothSettings_pressure_vgroup_get",
1044 "rna_ClothSettings_pressure_vgroup_length",
1045 "rna_ClothSettings_pressure_vgroup_set");
1049 "Pressure Vertex Group",
1050 "Vertex Group for where to apply pressure. Zero weight means no "
1051 "pressure while a weight of one means full pressure. Faces with a vertex "
1052 "that has zero weight will be excluded from the volume calculation.");
1083 prop,
"Maximum Spring Extension",
"Maximum extension before spring gets cut");
1097 "Cloth Collision Settings",
1098 "Cloth simulation settings for self collision and collision with other objects");
1117 "Minimum distance between collision objects before collision response takes effect");
1123 prop,
"Friction",
"Friction force if a collision happened (higher = less movement)");
1139 "Collision Quality",
1140 "How many collision iterations should be done (higher is better quality but slower)");
1149 "Clamp collision impulses to avoid instability (0.0 to disable clamping)");
1164 "Self Minimum Distance",
1165 "Minimum distance between cloth faces before collision response takes effect");
1181 "rna_CollSettings_selfcol_vgroup_get",
1182 "rna_CollSettings_selfcol_vgroup_length",
1183 "rna_CollSettings_selfcol_vgroup_set");
1187 "Selfcollision Vertex Group",
1188 "Triangles with all vertices in this group are not used during self collisions");
1193 "rna_CollSettings_objcol_vgroup_get",
1194 "rna_CollSettings_objcol_vgroup_length",
1195 "rna_CollSettings_objcol_vgroup_set");
1199 "Collision Vertex Group",
1200 "Triangles with all vertices in this group are not used during object collisions");
1209 "Clamp collision impulses to avoid instability (0.0 to disable clamping)");
void cloth_free_modifier(ClothModifierData *clmd)
ModifierData * BKE_modifiers_findby_type(const Object *ob, ModifierType type)
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ CLOTH_COLLSETTINGS_FLAG_ENABLED
@ CLOTH_COLLSETTINGS_FLAG_SELF
@ CLOTH_SIMSETTINGS_FLAG_DYNAMIC_BASEMESH
@ CLOTH_SIMSETTINGS_FLAG_INTERNAL_SPRINGS_NORMAL
@ CLOTH_SIMSETTINGS_FLAG_PRESSURE_VOL
@ CLOTH_SIMSETTINGS_FLAG_SEW
@ CLOTH_SIMSETTINGS_FLAG_PRESSURE
@ CLOTH_SIMSETTINGS_FLAG_TEARING
@ CLOTH_SIMSETTINGS_FLAG_INTERNAL_SPRINGS
Object is a sort of wrapper for general info.
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
@ SIM_SOLVER_INVALID_INPUT
@ SIM_SOLVER_NUMERICAL_ISSUE
@ SIM_SOLVER_NO_CONVERGENCE
static void rna_def_cloth_collision_settings(BlenderRNA *brna)
void RNA_def_cloth(BlenderRNA *brna)
static void rna_def_cloth_sim_settings(BlenderRNA *brna)
static void rna_def_cloth_solver_result(BlenderRNA *brna)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_define_lib_overridable(const bool make_overridable)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_define_verify_sdna(bool verify)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_override_clear_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
int rna_object_vgroup_name_index_length(PointerRNA *ptr, int index)
int rna_object_shapekey_index_set(ID *id, PointerRNA value, int current)
void rna_object_vgroup_name_index_set(PointerRNA *ptr, const char *value, short *index)
PointerRNA rna_object_shapekey_index_get(ID *id, int value)
void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index)
void WM_main_add_notifier(uint type, void *reference)