34 {0,
nullptr, 0,
nullptr,
nullptr},
43 {0,
nullptr, 0,
nullptr,
nullptr},
51 {0,
nullptr, 0,
nullptr,
nullptr},
55static const EnumPropertyItem part_hair_dist_items[] = {
58 {0,
nullptr, 0,
nullptr,
nullptr},
69 {0,
nullptr, 0,
nullptr,
nullptr},
73static const EnumPropertyItem part_hair_draw_as_items[] = {
77 {0,
nullptr, 0,
nullptr,
nullptr},
88 {0,
nullptr, 0,
nullptr,
nullptr},
92static const EnumPropertyItem part_hair_ren_as_items[] = {
97 {0,
nullptr, 0,
nullptr,
nullptr},
105 {0,
nullptr, 0,
nullptr,
nullptr},
109static const EnumPropertyItem part_fluid_type_items[] = {
120 {0,
nullptr, 0,
nullptr,
nullptr},
128# include <fmt/format.h>
163static void rna_ParticleHairKey_location_object_info(
PointerRNA *ptr,
168 Object *ob = id_cast<Object *>(ptr->owner_id);
192 for (md = ob->modifiers.first(); md; md = md->next) {
195 if (psmd && psmd->mesh_final && psmd->psys) {
197 for (i = 0, pa = psys->
particles; i < psys->totpart; i++, pa++) {
201 if ((hkey >= pa->hair) && (hkey < pa->hair + pa->totkey)) {
212static void rna_ParticleHairKey_location_object_get(
PointerRNA *ptr,
float *values)
215 Object *ob = id_cast<Object *>(ptr->owner_id);
219 rna_ParticleHairKey_location_object_info(ptr, &psmd, &pa);
225 const Span<float3> positions = hair_mesh->vert_positions();
226 copy_v3_v3(values, positions[pa->hair_index + (hkey - pa->hair)]);
246static int hair_key_index_get(
const Object *
object,
252 return hair_key - particle->hair;
261 const ParticleSystem *original_particle_system = original_modifier->psys;
264 if (
ARRAY_HAS_ITEM(hair_key, original_particle->hair, original_particle->totkey)) {
265 return hair_key - original_particle->hair;
277static void hair_key_location_object_set(
HairKey *hair_key,
281 const float src_co[3])
286 if (hair_mesh !=
nullptr) {
287 const int hair_key_index = hair_key_index_get(
object, hair_key,
modifier, particle);
288 if (hair_key_index == -1) {
292 copy_v3_v3(positions[particle->hair_index + (hair_key_index)], src_co);
298 object,
modifier->mesh_final,
modifier->psys->part->from, particle, hairmat);
307static void rna_ParticleHairKey_location_object_set(
PointerRNA *ptr,
const float *values)
310 Object *ob = id_cast<Object *>(ptr->owner_id);
314 rna_ParticleHairKey_location_object_info(ptr, &psmd, &pa);
321 hair_key_location_object_set(hkey, ob, psmd, pa, values);
324static void rna_ParticleHairKey_co_object(
HairKey *hairkey,
335 const Span<float3> positions = hair_mesh->vert_positions();
336 copy_v3_v3(n_co, positions[particle->hair_index + (hairkey - particle->hair)]);
341 object,
modifier->mesh_final,
modifier->psys->part->from, particle, hairmat);
351static void rna_ParticleHairKey_co_object_set(
ID *
id,
359 if (particle ==
nullptr) {
369 hair_key_location_object_set(hair_key,
object,
modifier, particle, co);
376static void rna_Particle_uv_on_emitter(
ParticleData *particle,
383 psmd, part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, nor, 0, 0, sd.orco, 0);
386 if (
modifier->mesh_final ==
nullptr) {
387 BKE_report(reports,
RPT_ERROR,
"uv_on_emitter() requires a modifier from an evaluated object");
392 int num = particle->num_dmcache;
393 int from =
modifier->psys->part->from;
395 if (
modifier->mesh_final->uv_map_names().is_empty()) {
403 if (particle->num <
modifier->mesh_final->totface_legacy) {
413 const MFace *mface =
static_cast<const MFace *
>(
418 if (mface && mtface) {
438 Object *ob_found =
nullptr;
443 if (psys.part == part) {
444 ob_found = ob_context;
450 if (ob_found ==
nullptr) {
453 ob =
static_cast<Object *
>(ob->id.next))
456 if (psys.part == part) {
471 if (ob_found && ob_found->totcol > 0) {
472 for (i = 1; i <= ob_found->totcol; i++) {
475 tmp.icon = ICON_MATERIAL_DATA;
477 tmp.name = ma->id.name + 2;
478 tmp.identifier = tmp.name;
481 tmp.name =
"Default Material";
482 tmp.identifier = tmp.name;
489 tmp.icon = ICON_MATERIAL_DATA;
490 tmp.name =
"Default Material";
491 tmp.identifier = tmp.name;
503 if (ptr->type == RNA_ParticleSystem) {
504 Object *ob = id_cast<Object *>(ptr->owner_id);
525 rna_Particle_redo(bmain, scene, ptr);
544 rna_Particle_reset(bmain, scene, ptr);
552 for (
Object *ob = bmain->objects.first(); ob; ob =
static_cast<Object *
>(ob->id.next)) {
554 if (psys.part == part) {
575 part->boids = MEM_new<BoidSettings>(
"Boid Settings");
587 else if (part->phystype ==
PART_PHYS_FLUID && part->fluid ==
nullptr) {
588 part->fluid = MEM_new<SPHFluidSettings>(
"SPH Fluid Settings");
602 Object *ob = id_cast<Object *>(ptr->owner_id);
613 for (psys = ob->particlesystem.first(); psys; psys = psys->next) {
614 for (pt = psys->targets.first(); pt; pt = pt->next) {
626 if (ptr->type == RNA_ParticleTarget) {
627 Object *ob = id_cast<Object *>(ptr->owner_id);
629 ParticleSystem *kpsys =
nullptr, *psys = rna_particle_system_for_target(ob, pt);
631 if (
ELEM(pt->ob, ob,
nullptr)) {
665 if (ptr->type == RNA_ParticleTarget) {
666 Object *ob = id_cast<Object *>(ptr->owner_id);
679 Object *ob = id_cast<Object *>(ptr->owner_id);
682 if (psys && !psys->clmd) {
684 psys->clmd->sim_parms->goalspring = 0.0f;
687 rna_Particle_redo(bmain, scene, ptr);
707 Object *ob = id_cast<Object *>(ptr->owner_id);
712 old_type = psys->part->
type;
721 if (old_type != psys->part->
type) {
729 float delta = settings->
end + settings->lifetime - settings->sta;
731 settings->path_start = settings->sta + settings->path_start * delta;
732 settings->path_end = settings->sta + settings->path_end * delta;
735 settings->path_start = (settings->path_start - settings->sta) / delta;
736 settings->path_end = (settings->path_end - settings->sta) / delta;
738 rna_Particle_redo(bmain, scene, ptr);
740static void rna_PartSettings_start_set(
PointerRNA *ptr,
float value)
745 if (value > settings->end) {
746 settings->end = value;
750 if (settings->type == PART_REACTOR && value < 1.0) {
759 settings->
sta = value;
762static void rna_PartSettings_end_set(
PointerRNA *ptr,
float value)
767 if (value < settings->sta) {
768 settings->sta = value;
771 settings->
end = value;
774static void rna_PartSetings_timestep_set(
PointerRNA *ptr,
float value)
781static float rna_PartSettings_timestep_get(
PointerRNA *ptr)
788static void rna_PartSetting_hairlength_set(
PointerRNA *ptr,
float value)
791 settings->
normfac = value / 4.0f;
794static float rna_PartSetting_hairlength_get(
PointerRNA *ptr)
797 return settings->
normfac * 4.0f;
800static void rna_PartSetting_linelentail_set(
PointerRNA *ptr,
float value)
806static float rna_PartSetting_linelentail_get(
PointerRNA *ptr)
811static void rna_PartSetting_pathstartend_range(
825static void rna_PartSetting_linelenhead_set(
PointerRNA *ptr,
float value)
831static float rna_PartSetting_linelenhead_get(
PointerRNA *ptr)
837static bool rna_PartSettings_is_fluid_get(
PointerRNA *ptr)
840 return ELEM(part->type,
853static void rna_ParticleSettings_use_clump_curve_update(
Main *bmain,
Scene *scene,
PointerRNA *ptr)
858 if (!part->clumpcurve) {
863 rna_Particle_redo_child(bmain, scene, ptr);
866static void rna_ParticleSettings_use_roughness_curve_update(
Main *bmain,
873 if (!part->roughcurve) {
878 rna_Particle_redo_child(bmain, scene, ptr);
881static void rna_ParticleSettings_use_twist_curve_update(
Main *bmain,
Scene *scene,
PointerRNA *ptr)
886 if (!part->twistcurve) {
891 rna_Particle_redo_child(bmain, scene, ptr);
894static void rna_ParticleSystem_name_set(
PointerRNA *ptr,
const char *value)
896 Object *ob = id_cast<Object *>(ptr->owner_id);
904 DATA_(
"ParticleSystem"),
915 for (; pt; pt = pt->next) {
922static void rna_ParticleSystem_active_particle_target_index_range(
927 *
max =
max_ii(0, psys->targets.count() - 1);
930static int rna_ParticleSystem_active_particle_target_index_get(
PointerRNA *ptr)
936 for (; pt; pt = pt->next, i++) {
945static void rna_ParticleSystem_active_particle_target_index_set(
PointerRNA *ptr,
int value)
951 for (; pt; pt = pt->next, i++) {
961static size_t rna_ParticleTarget_name_get_impl(
PointerRNA *ptr,
963 const size_t value_maxncpy)
974 Object *ob = id_cast<Object *>(ptr->owner_id);
982 value, value_maxncpy,
"%s: %s", pt->ob->id.name + 2, psys->
name);
994static void rna_ParticleTarget_name_get(
PointerRNA *ptr,
char *value)
997 const size_t value_buf_len = rna_ParticleTarget_name_get_impl(ptr, value_buf,
sizeof(value_buf));
998 memcpy(value, value_buf, value_buf_len + 1);
1001static int rna_ParticleTarget_name_length(
PointerRNA *ptr)
1004 return rna_ParticleTarget_name_get_impl(ptr, value_buf,
sizeof(value_buf));
1007static int particle_id_check(
const PointerRNA *ptr)
1009 const ID *
id = ptr->owner_id;
1014static std::optional<std::string> rna_SPHFluidSettings_path(
const PointerRNA *ptr)
1018 if (particle_id_check(ptr)) {
1021 if (part->fluid == fluid) {
1025 return std::nullopt;
1028static bool rna_ParticleSystem_multiple_caches_get(
PointerRNA *ptr)
1032 return (psys->ptcaches.first() != psys->ptcaches.last());
1034static bool rna_ParticleSystem_editable_get(
PointerRNA *ptr)
1040static bool rna_ParticleSystem_edited_get(
PointerRNA *ptr)
1045 return (psys->flag &
PSYS_EDITED || (psys->edit && psys->edit->edited));
1048 return (psys->pointcache->edit && psys->pointcache->edit->edited);
1056 for (; dw; dw = dw->next) {
1063static void rna_ParticleDupliWeight_active_index_range(
1068 *
max =
max_ii(0, part->instance_weights.count() - 1);
1071static int rna_ParticleDupliWeight_active_index_get(
PointerRNA *ptr)
1077 for (; dw; dw = dw->next, i++) {
1086static void rna_ParticleDupliWeight_active_index_set(
PointerRNA *ptr,
int value)
1092 for (; dw; dw = dw->next, i++) {
1102static size_t rna_ParticleDupliWeight_name_get_impl(
PointerRNA *ptr,
1104 const size_t value_maxncpy)
1118static void rna_ParticleDupliWeight_name_get(
PointerRNA *ptr,
char *value)
1121 const size_t value_buf_len = rna_ParticleDupliWeight_name_get_impl(
1122 ptr, value_buf,
sizeof(value_buf));
1123 memcpy(value, value_buf, value_buf_len + 1);
1126static int rna_ParticleDupliWeight_name_length(
PointerRNA *ptr)
1129 return rna_ParticleDupliWeight_name_get_impl(ptr, value_buf,
sizeof(value_buf));
1143 return part_fluid_type_items;
1153 if (part->type == PART_REACTOR) {
1157 return part_from_items;
1168 return part_hair_dist_items;
1183 return part_hair_draw_as_items;
1198 return part_hair_ren_as_items;
1217static void psys_vg_name_get__internal(
PointerRNA *ptr,
char *value,
int index)
1219 Object *ob = id_cast<Object *>(ptr->owner_id);
1223 if (psys->vgroup[
index] > 0) {
1228 strcpy(value, defGroup->name);
1237 Object *ob = id_cast<Object *>(ptr->owner_id);
1240 if (psys->vgroup[
index] > 0) {
1246 return strlen(defGroup->name);
1251static void psys_vg_name_set__internal(
PointerRNA *ptr,
const char *value,
int index)
1253 Object *ob = id_cast<Object *>(ptr->owner_id);
1256 if (value[0] ==
'\0') {
1257 psys->vgroup[
index] = 0;
1262 if (defgrp_index == -1) {
1266 psys->vgroup[
index] = defgrp_index + 1;
1270static std::optional<std::string> rna_ParticleSystem_path(
const PointerRNA *ptr)
1273 char name_esc[
sizeof(psys->
name) * 2];
1276 return fmt::format(
"particle_systems[\"{}\"]", name_esc);
1283 iter, ptr,
static_cast<void *
>(part->mtex),
sizeof(
MTex *),
MAX_MTEX, 0,
nullptr);
1295static void rna_ParticleSettings_active_texture_set(
PointerRNA *ptr,
1305static void rna_ParticleVGroup_name_get_0(
PointerRNA *ptr,
char *value)
1307 psys_vg_name_get__internal(ptr, value, 0);
1309static void rna_ParticleVGroup_name_get_1(
PointerRNA *ptr,
char *value)
1311 psys_vg_name_get__internal(ptr, value, 1);
1313static void rna_ParticleVGroup_name_get_2(
PointerRNA *ptr,
char *value)
1315 psys_vg_name_get__internal(ptr, value, 2);
1317static void rna_ParticleVGroup_name_get_3(
PointerRNA *ptr,
char *value)
1319 psys_vg_name_get__internal(ptr, value, 3);
1321static void rna_ParticleVGroup_name_get_4(
PointerRNA *ptr,
char *value)
1323 psys_vg_name_get__internal(ptr, value, 4);
1325static void rna_ParticleVGroup_name_get_5(
PointerRNA *ptr,
char *value)
1327 psys_vg_name_get__internal(ptr, value, 5);
1329static void rna_ParticleVGroup_name_get_6(
PointerRNA *ptr,
char *value)
1331 psys_vg_name_get__internal(ptr, value, 6);
1333static void rna_ParticleVGroup_name_get_7(
PointerRNA *ptr,
char *value)
1335 psys_vg_name_get__internal(ptr, value, 7);
1337static void rna_ParticleVGroup_name_get_8(
PointerRNA *ptr,
char *value)
1339 psys_vg_name_get__internal(ptr, value, 8);
1341static void rna_ParticleVGroup_name_get_9(
PointerRNA *ptr,
char *value)
1343 psys_vg_name_get__internal(ptr, value, 9);
1345static void rna_ParticleVGroup_name_get_10(
PointerRNA *ptr,
char *value)
1347 psys_vg_name_get__internal(ptr, value, 10);
1349static void rna_ParticleVGroup_name_get_11(
PointerRNA *ptr,
char *value)
1351 psys_vg_name_get__internal(ptr, value, 11);
1353static void rna_ParticleVGroup_name_get_12(
PointerRNA *ptr,
char *value)
1355 psys_vg_name_get__internal(ptr, value, 12);
1358static int rna_ParticleVGroup_name_len_0(
PointerRNA *ptr)
1360 return psys_vg_name_len__internal(ptr, 0);
1362static int rna_ParticleVGroup_name_len_1(
PointerRNA *ptr)
1364 return psys_vg_name_len__internal(ptr, 1);
1366static int rna_ParticleVGroup_name_len_2(
PointerRNA *ptr)
1368 return psys_vg_name_len__internal(ptr, 2);
1370static int rna_ParticleVGroup_name_len_3(
PointerRNA *ptr)
1372 return psys_vg_name_len__internal(ptr, 3);
1374static int rna_ParticleVGroup_name_len_4(
PointerRNA *ptr)
1376 return psys_vg_name_len__internal(ptr, 4);
1378static int rna_ParticleVGroup_name_len_5(
PointerRNA *ptr)
1380 return psys_vg_name_len__internal(ptr, 5);
1382static int rna_ParticleVGroup_name_len_6(
PointerRNA *ptr)
1384 return psys_vg_name_len__internal(ptr, 6);
1386static int rna_ParticleVGroup_name_len_7(
PointerRNA *ptr)
1388 return psys_vg_name_len__internal(ptr, 7);
1390static int rna_ParticleVGroup_name_len_8(
PointerRNA *ptr)
1392 return psys_vg_name_len__internal(ptr, 8);
1394static int rna_ParticleVGroup_name_len_9(
PointerRNA *ptr)
1396 return psys_vg_name_len__internal(ptr, 9);
1398static int rna_ParticleVGroup_name_len_10(
PointerRNA *ptr)
1400 return psys_vg_name_len__internal(ptr, 10);
1402static int rna_ParticleVGroup_name_len_11(
PointerRNA *ptr)
1404 return psys_vg_name_len__internal(ptr, 11);
1406static int rna_ParticleVGroup_name_len_12(
PointerRNA *ptr)
1408 return psys_vg_name_len__internal(ptr, 12);
1411static void rna_ParticleVGroup_name_set_0(
PointerRNA *ptr,
const char *value)
1413 psys_vg_name_set__internal(ptr, value, 0);
1415static void rna_ParticleVGroup_name_set_1(
PointerRNA *ptr,
const char *value)
1417 psys_vg_name_set__internal(ptr, value, 1);
1419static void rna_ParticleVGroup_name_set_2(
PointerRNA *ptr,
const char *value)
1421 psys_vg_name_set__internal(ptr, value, 2);
1423static void rna_ParticleVGroup_name_set_3(
PointerRNA *ptr,
const char *value)
1425 psys_vg_name_set__internal(ptr, value, 3);
1427static void rna_ParticleVGroup_name_set_4(
PointerRNA *ptr,
const char *value)
1429 psys_vg_name_set__internal(ptr, value, 4);
1431static void rna_ParticleVGroup_name_set_5(
PointerRNA *ptr,
const char *value)
1433 psys_vg_name_set__internal(ptr, value, 5);
1435static void rna_ParticleVGroup_name_set_6(
PointerRNA *ptr,
const char *value)
1437 psys_vg_name_set__internal(ptr, value, 6);
1439static void rna_ParticleVGroup_name_set_7(
PointerRNA *ptr,
const char *value)
1441 psys_vg_name_set__internal(ptr, value, 7);
1443static void rna_ParticleVGroup_name_set_8(
PointerRNA *ptr,
const char *value)
1445 psys_vg_name_set__internal(ptr, value, 8);
1447static void rna_ParticleVGroup_name_set_9(
PointerRNA *ptr,
const char *value)
1449 psys_vg_name_set__internal(ptr, value, 9);
1451static void rna_ParticleVGroup_name_set_10(
PointerRNA *ptr,
const char *value)
1453 psys_vg_name_set__internal(ptr, value, 10);
1455static void rna_ParticleVGroup_name_set_11(
PointerRNA *ptr,
const char *value)
1457 psys_vg_name_set__internal(ptr, value, 11);
1459static void rna_ParticleVGroup_name_set_12(
PointerRNA *ptr,
const char *value)
1461 psys_vg_name_set__internal(ptr, value, 12);
1492 prop,
"Location (Object Space)",
"Location of the hair key in object space");
1494 "rna_ParticleHairKey_location_object_get",
1495 "rna_ParticleHairKey_location_object_set",
1502 "Location of the hair key in its local coordinate system, "
1503 "relative to the emitting face");
1506 func =
RNA_def_function(srna,
"co_object",
"rna_ParticleHairKey_co_object");
1510 parm =
RNA_def_pointer(func,
"modifier",
"ParticleSystemModifier",
"",
"Particle modifier");
1512 parm =
RNA_def_pointer(func,
"particle",
"Particle",
"",
"hair particle");
1515 func,
"co", 3,
nullptr, -
FLT_MAX,
FLT_MAX,
"Co",
"Exported hairkey location", -1e4, 1e4);
1519 func =
RNA_def_function(srna,
"co_object_set",
"rna_ParticleHairKey_co_object_set");
1524 parm =
RNA_def_pointer(func,
"modifier",
"ParticleSystemModifier",
"",
"Particle modifier");
1526 parm =
RNA_def_pointer(func,
"particle",
"Particle",
"",
"hair particle");
1529 func,
"co", 3,
nullptr, -
FLT_MAX,
FLT_MAX,
"Co",
"Specified hairkey location", -1e4, 1e4);
1568 srna,
"Child Particle",
"Child particle interpolated from simulated or edited particles");
1592 {0,
nullptr, 0,
nullptr,
nullptr},
1689 func =
RNA_def_function(srna,
"uv_on_emitter",
"rna_Particle_uv_on_emitter");
1691 "Obtain UV coordinates for a particle on an evaluated mesh.");
1695 "ParticleSystemModifier",
1697 "Particle modifier from an evaluated object");
1712 "Particle Instance Object Weight",
1713 "Weight of a particle instance object in a collection");
1718 prop,
"rna_ParticleDupliWeight_name_get",
"rna_ParticleDupliWeight_name_length",
nullptr);
1726 prop,
"Count",
"The number of times this object is repeated with respect to other objects");
1740 "An artistic solver with strong surface tension effects (original)"},
1742 {0,
nullptr, 0,
nullptr,
nullptr},
1755 prop,
"SPH Solver",
"The code used to calculate internal forces on particles");
1780 prop,
"Viscoelastic Springs",
"Use viscoelastic springs instead of Hooke's springs");
1787 "Initial Rest Length",
1788 "Use the initial length as spring rest length instead of 2 * particle size");
1797 "How much the spring rest length can change after the elastic limit is crossed");
1806 "How much the spring has to be stretched/compressed in order to change its rest length");
1814 "Create springs for this number of frames since particles birth (0 is always)");
1847 "How strongly the fluid tries to keep from clustering (factor of stiffness)");
1865 "Artificial buoyancy force in negative gravity direction based on pressure "
1866 "differences inside the fluid");
1881 "Density is calculated as a factor of default density (depends on particle size)");
1887 prop,
"Factor Radius",
"Interaction radius is a factor of 4 * particle size");
1893 prop,
"Factor Stiff Viscosity",
"Stiff viscosity is a factor of normal viscosity");
1899 prop,
"Factor Rest Length",
"Spring rest length is a factor of 2 * particle size");
1909 {
TEXCO_GLOB,
"GLOBAL", 0,
"Global",
"Use global coordinates for the texture coordinates"},
1914 "Use linked object's coordinates for texture coordinates"},
1915 {
TEXCO_UV,
"UV", 0,
"UV",
"Use UV coordinates for texture coordinates"},
1920 "Use the original undeformed coordinates of the object"},
1924 "Strand / Particle",
1925 "Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"},
1926 {0,
nullptr, 0,
nullptr,
nullptr},
1930 {
MTEX_FLAT,
"FLAT", 0,
"Flat",
"Map X and Y coordinates directly"},
1931 {
MTEX_CUBE,
"CUBE", 0,
"Cube",
"Map using the normal vector"},
1932 {
MTEX_TUBE,
"TUBE", 0,
"Tube",
"Map with Z as central axis"},
1933 {
MTEX_SPHERE,
"SPHERE", 0,
"Sphere",
"Map with Z as central axis"},
1934 {0,
nullptr, 0,
nullptr,
nullptr},
1938 {0,
"NONE", 0,
"None",
""},
1939 {1,
"X", 0,
"X",
""},
1940 {2,
"Y", 0,
"Y",
""},
1941 {3,
"Z", 0,
"Z",
""},
1942 {0,
nullptr, 0,
nullptr,
nullptr},
1946 {0,
"NONE", 0,
"None",
""},
1947 {1,
"X", 0,
"X",
""},
1948 {2,
"Y", 0,
"Y",
""},
1949 {3,
"Z", 0,
"Z",
""},
1950 {0,
nullptr, 0,
nullptr,
nullptr},
1954 {0,
"NONE", 0,
"None",
""},
1955 {1,
"X", 0,
"X",
""},
1956 {2,
"Y", 0,
"Y",
""},
1957 {3,
"Z", 0,
"Z",
""},
1958 {0,
nullptr, 0,
nullptr,
nullptr},
1961 srna =
RNA_def_struct(brna,
"ParticleSettingsTextureSlot",
"TextureSlot");
1964 "Particle Settings Texture Slot",
1965 "Texture slot for textures in a Particle Settings data-block");
1972 "Texture Coordinates",
1973 "Texture coordinates used to map the texture onto the background");
1982 prop,
"Object",
"Object to use for mapping with Object texture coordinates");
1988 prop,
"UV Map",
"UV map to use for mapping with UV texture coordinates");
2091 prop,
"Emission Time Factor",
"Amount texture affects particle emission time");
2116 prop,
"Velocity Factor",
"Amount texture affects particle initial velocity");
2153 prop,
"Kink Amplitude Factor",
"Amount texture affects child kink amplitude");
2160 prop,
"Kink Frequency Factor",
"Amount texture affects child kink frequency");
2187 {0,
nullptr, 0,
nullptr,
nullptr},
2191 {0,
"NONE", 0,
"None",
""},
2201 {0,
nullptr, 0,
nullptr,
nullptr},
2205 {0,
"NONE", 0,
"None",
""},
2213 {0,
nullptr, 0,
nullptr,
nullptr},
2220 {0,
nullptr, 0,
nullptr,
nullptr},
2224 {0,
"NONE", 0,
"None",
""},
2227 {0,
nullptr, 0,
nullptr,
nullptr},
2236 {0,
nullptr, 0,
nullptr,
nullptr},
2246 {0,
nullptr, 0,
nullptr,
nullptr},
2254 {0,
nullptr, 0,
nullptr,
nullptr},
2259 srna,
"Particle Settings",
"Particle settings, reusable by multiple particle systems");
2264 "rna_ParticleSettings_mtex_begin",
2265 "rna_ParticleSettings_active_texture_get",
2266 "rna_ParticleSettings_active_texture_set",
2268 "ParticleSettingsTextureSlot",
2269 "ParticleSettingsTextureSlots",
2270 "rna_Particle_reset_dependency",
2318 "Even Distribution",
2319 "Use even distribution from faces based on face areas or edge lengths");
2326 prop,
"Die on Hit",
"Particles die when they collide with a deflector object");
2345 prop,
"Dynamic",
"Particle rotations are affected by collisions and effectors");
2373 prop,
"Invert Grid",
"Invert what is considered object and what is not");
2422 prop,
"Distribution",
"How to distribute particles on selected element");
2440 "Particle orientation axis (does not affect Explode modifier's results)");
2448 prop,
"Angular Velocity Axis",
"What axis is used to change particle rotation with time");
2519 "Use object's rotation for duplication (global x-axis is aligned "
2520 "particle rotation axis)");
2618 prop,
"Degrees",
"How many degrees path has to curve to make another render segment");
2624 prop,
"Pixel",
"How many pixels path has to cover to make another render segment");
2636 prop,
"Material Index",
"Index of material slot used for rendering particles");
2650 "Algorithm used to calculate physics, from the fastest to the "
2651 "most stable and accurate: Midpoint, Euler, Verlet, RK4");
2705 prop,
"Tweak",
"A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)");
2710 prop,
"rna_PartSettings_timestep_get",
"rna_PartSetings_timestep_set",
nullptr);
2714 prop,
"Timestep",
"The simulation timestep per frame (seconds per frame)");
2720 prop,
"Automatic Subframes",
"Automatically set the number of subframes");
2728 "Subframes to simulate for improved stability and finer granularity simulations "
2729 "(dt = timestep / (subframes + 1))");
2736 "Adaptive Subframe Threshold",
2737 "The relative distance a particle can move before requiring more subframes "
2738 "(target Courant number); 0.01 to 0.3 is the recommended range");
2791 prop,
"Effector Number",
"How many particles are effectors (0 is all particles)");
2800 prop,
"Normal",
"Let the surface normal give the particle a starting velocity");
2808 prop,
"Object Velocity",
"Let the object give the particle a starting velocity");
2823 prop,
"Particle",
"Let the target particle give the particle a starting velocity");
2831 prop,
"Tangent",
"Let the surface tangent give the particle a starting velocity");
2846 "Let the vector away from the target particle's location give the particle "
2847 "a starting velocity");
2858 "Let the emitter object orientation give the particle a starting velocity");
2866 prop,
"Angular Velocity",
"Angular velocity amount (in radians per second)");
2885 prop,
"Random Phase",
"Randomize rotation around the chosen orientation axis");
2890 prop,
"rna_PartSetting_hairlength_get",
"rna_PartSetting_hairlength_set",
nullptr);
2955 prop,
nullptr,
"child_percent");
2966 prop,
"Rendered Children",
"Number of children per parent for rendering");
2985 prop,
"Random Child Size",
"Random variation to the size of the child particles");
3079 prop,
"Extra Steps",
"Extra steps for resolution of special kink features");
3120 prop,
"Threshold",
"Amount of particles left untouched by random roughness");
3158 prop,
"Threshold",
"Amount of particles left untouched by child path length");
3166 prop,
"Parting Factor",
"Create parting in the children based on parent strands");
3174 "Minimum root to tip angle (tip distance/root distance for long hair)");
3182 "Maximum root to tip angle (tip distance/root distance for long hair)");
3195 prop,
"rna_PartSetting_linelentail_get",
"rna_PartSetting_linelentail_set",
nullptr);
3203 prop,
"rna_PartSetting_linelenhead_get",
"rna_PartSetting_linelenhead_set",
nullptr);
3241 "Use Modifier Stack",
3242 "Emit particles from mesh with modifiers applied "
3243 "(must use same subdivision surface level for viewport and render for correct results)");
3253 prop,
"Instance Collection",
"Show objects in this collection in place of particles");
3260 "Instance Collection Weights",
3261 "Weights for all of the objects in the instance collection");
3266 prop,
"rna_ParticleDupliWeight_active_get",
nullptr,
nullptr,
nullptr);
3271 "rna_ParticleDupliWeight_active_index_get",
3272 "rna_ParticleDupliWeight_active_index_set",
3273 "rna_ParticleDupliWeight_active_index_range");
3343 prop, 0,
"rna_Particle_redo");
3349 prop, 0,
"rna_Particle_redo");
3357 prop, 0,
"rna_Particle_redo");
3365 prop, 0,
"rna_Particle_redo");
3373 prop, 0,
"rna_Particle_redo");
3385 {0,
nullptr, 0,
nullptr,
nullptr},
3393 prop,
"rna_ParticleTarget_name_get",
"rna_ParticleTarget_name_length",
nullptr);
3405 "The object that has the target particle system (empty if same object)");
3412 prop,
"Target Particle System",
"The index of particle system on the target object");
3466 prop,
"rna_particle_settings_get",
"rna_particle_settings_set",
nullptr,
nullptr);
3481 prop,
"Child Particles",
"Child particles generated by the particle system");
3485 prop,
"Seed",
"Offset in the random number table, to get a different randomized result");
3492 "Offset in the random number table for child particles, to get a different "
3493 "randomized result");
3519 "Reactor Target Object",
3520 "For reactor systems, the object that has the target particle system "
3521 "(empty if same object)");
3528 "Reactor Target Particle System",
3529 "For reactor systems, index of particle system on the target object");
3546 prop,
"rna_ParticleSystem_active_particle_target_get",
nullptr,
nullptr,
nullptr);
3551 "rna_ParticleSystem_active_particle_target_index_get",
3552 "rna_ParticleSystem_active_particle_target_index_set",
3553 "rna_ParticleSystem_active_particle_target_index_range");
3568 "rna_ParticleVGroup_name_get_0",
3569 "rna_ParticleVGroup_name_len_0",
3570 "rna_ParticleVGroup_name_set_0");
3577 prop,
"Vertex Group Density Negate",
"Negate the effect of the density vertex group");
3582 "rna_ParticleVGroup_name_get_1",
3583 "rna_ParticleVGroup_name_len_1",
3584 "rna_ParticleVGroup_name_set_1");
3591 prop,
"Vertex Group Velocity Negate",
"Negate the effect of the velocity vertex group");
3596 "rna_ParticleVGroup_name_get_2",
3597 "rna_ParticleVGroup_name_len_2",
3598 "rna_ParticleVGroup_name_set_2");
3605 prop,
"Vertex Group Length Negate",
"Negate the effect of the length vertex group");
3610 "rna_ParticleVGroup_name_get_3",
3611 "rna_ParticleVGroup_name_len_3",
3612 "rna_ParticleVGroup_name_set_3");
3619 prop,
"Vertex Group Clump Negate",
"Negate the effect of the clump vertex group");
3624 "rna_ParticleVGroup_name_get_4",
3625 "rna_ParticleVGroup_name_len_4",
3626 "rna_ParticleVGroup_name_set_4");
3633 prop,
"Vertex Group Kink Negate",
"Negate the effect of the kink vertex group");
3638 "rna_ParticleVGroup_name_get_5",
3639 "rna_ParticleVGroup_name_len_5",
3640 "rna_ParticleVGroup_name_set_5");
3642 prop,
"Vertex Group Roughness 1",
"Vertex group to control roughness 1");
3648 "Vertex Group Roughness 1 Negate",
3649 "Negate the effect of the roughness 1 vertex group");
3654 "rna_ParticleVGroup_name_get_6",
3655 "rna_ParticleVGroup_name_len_6",
3656 "rna_ParticleVGroup_name_set_6");
3658 prop,
"Vertex Group Roughness 2",
"Vertex group to control roughness 2");
3664 "Vertex Group Roughness 2 Negate",
3665 "Negate the effect of the roughness 2 vertex group");
3670 "rna_ParticleVGroup_name_get_7",
3671 "rna_ParticleVGroup_name_len_7",
3672 "rna_ParticleVGroup_name_set_7");
3674 prop,
"Vertex Group Roughness End",
"Vertex group to control roughness end");
3680 "Vertex Group Roughness End Negate",
3681 "Negate the effect of the roughness end vertex group");
3686 "rna_ParticleVGroup_name_get_8",
3687 "rna_ParticleVGroup_name_len_8",
3688 "rna_ParticleVGroup_name_set_8");
3695 prop,
"Vertex Group Size Negate",
"Negate the effect of the size vertex group");
3700 "rna_ParticleVGroup_name_get_9",
3701 "rna_ParticleVGroup_name_len_9",
3702 "rna_ParticleVGroup_name_set_9");
3709 prop,
"Vertex Group Tangent Negate",
"Negate the effect of the tangent vertex group");
3714 "rna_ParticleVGroup_name_get_10",
3715 "rna_ParticleVGroup_name_len_10",
3716 "rna_ParticleVGroup_name_set_10");
3723 prop,
"Vertex Group Rotation Negate",
"Negate the effect of the rotation vertex group");
3728 "rna_ParticleVGroup_name_get_11",
3729 "rna_ParticleVGroup_name_len_11",
3730 "rna_ParticleVGroup_name_set_11");
3737 prop,
"Vertex Group Field Negate",
"Negate the effect of the field vertex group");
3742 "rna_ParticleVGroup_name_get_12",
3743 "rna_ParticleVGroup_name_len_12",
3744 "rna_ParticleVGroup_name_set_12");
3751 prop,
"Vertex Group Twist Negate",
"Negate the effect of the twist vertex group");
3772 prop,
"Parent",
"Use this object's coordinate system instead of global coordinate system");
3792 prop,
"Timestep",
"The current simulation time step size, as a fraction of a frame");
3807 func,
"co", 3,
nullptr, -
FLT_MAX,
FLT_MAX,
"Co",
"Exported hairkey location", -1e4, 1e4);
3812 func =
RNA_def_function(srna,
"uv_on_emitter",
"BKE_particle_uv_on_emitter");
3815 parm =
RNA_def_pointer(func,
"modifier",
"ParticleSystemModifier",
"",
"Particle modifier");
3827 func =
RNA_def_function(srna,
"mcol_on_emitter",
"BKE_particle_mcol_on_emitter");
3830 parm =
RNA_def_pointer(func,
"modifier",
"ParticleSystemModifier",
"",
"Particle modifier");
CustomData interface, see also DNA_customdata_types.h.
General operations, lookup, etc. for materials.
#define STRNCPY_UTF8(dst, src)
#define BLT_I18NCONTEXT_AMOUNT
#define BLT_I18NCONTEXT_ID_IMAGE
#define BLT_I18NCONTEXT_ID_PARTICLESETTINGS
#define BLT_I18NCONTEXT_ID_TEXTURE
#define BOIDSTATE_CURRENT
#define ARRAY_HAS_ITEM(arr_item, arr_start, arr_len)
array< Particle > particles
ccl_device_inline uint particle_index(KernelGlobals kg, const int particle)
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
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)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_fluid_settings(BlenderRNA *brna)
struct Tex * give_current_particle_texture(struct ParticleSettings *part)
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
const ListBaseT< bDeformGroup > * BKE_object_defgroup_list(const Object *ob)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
@ PART_HIDE_ADVANCED_HAIR
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void set_current_particle_texture(struct ParticleSettings *part, struct Tex *tex)
static void rna_def_particle_key(BlenderRNA *brna)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
PointerRNA RNA_id_pointer_create(ID *id)
Material * BKE_object_material_get(Object *ob, short act)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
char size_t BLI_strncpy_utf8_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
@ eModifierType_ParticleSystem
void RNA_define_lib_overridable(const bool make_overridable)
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)
MINLINE int max_ii(int a, int b)
@ PART_FLUID_SPRAYFOAMBUBBLE
void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *activeeditable, const char *name, const char *name_slots, const char *update, const char *update_index)
size_t BLI_snprintf_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
void BKE_particlesettings_twist_curve_init(struct ParticleSettings *part)
static const EnumPropertyItem part_draw_as_items[]
void boid_default_settings(struct BoidSettings *boids)
static const EnumPropertyItem part_ren_as_items[]
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)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
@ PROPOVERRIDE_NO_COMPARISON
void rna_def_animdata_common(StructRNA *srna)
static void rna_def_child_particle(BlenderRNA *brna)
void RNA_def_particle(BlenderRNA *brna)
static const EnumPropertyItem part_dist_items[]
void mul_m4_v3(const float M[4][4], float r[3])
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_uniquename(const ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
static void rna_def_particle_settings(BlenderRNA *brna)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
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 BKE_report(ReportList *reports, eReportType type, const char *message)
BMesh const char void * data
struct BoidRule * boid_new_rule(eBoidRuleType type)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
PointerRNA CTX_data_pointer_get(const bContext *C, const char *member)
ModifierData * BKE_modifier_new(int type)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
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)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
char char size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
@ PART_CHILD_USE_ROUGH_CURVE
@ PART_CHILD_USE_TWIST_CURVE
@ PART_CHILD_USE_CLUMP_NOISE
@ PART_CHILD_USE_CLUMP_CURVE
static void rna_def_particle(BlenderRNA *brna)
int BKE_object_defgroup_name_index(const Object *ob, StringRef name)
static void rna_def_particle_hair_key(BlenderRNA *brna)
static void rna_def_particle_target(BlenderRNA *brna)
void psys_mat_hair_to_object(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void psys_find_group_weights(struct ParticleSettings *part)
const void * CustomData_get_layer(const CustomData *data, eCustomDataType type)
ATTR_WARN_UNUSED_RESULT const size_t num
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
void psys_interpolate_uvs(const struct MTFace *tface, int quad, const float w[4], float r_uv[2])
MINLINE void zero_v3(float r[3])
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_particle_system(BlenderRNA *brna)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
@ CLOTH_SIMSETTINGS_FLAG_RESIST_SPRING_COMPRESS
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)
void BKE_particlesettings_rough_curve_init(struct ParticleSettings *part)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Main * CTX_data_main(const bContext *C)
void BKE_particlesettings_clump_curve_init(struct ParticleSettings *part)
struct BoidState * boid_new_state(struct BoidSettings *boids)
static void rna_def_particle_settings_mtex(BlenderRNA *brna)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
static const EnumPropertyItem part_type_items[]
ID_Type GS(const char *name)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void BKE_mesh_tessface_ensure(Mesh *mesh)
void psys_particle_on_emitter(struct ParticleSystemModifierData *psmd, int from, int index, int index_dmcache, float fuv[4], float foffset, float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3])
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
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)
bool psys_check_edited(struct ParticleSystem *psys)
void psys_changed_type(struct Object *ob, struct ParticleSystem *psys)
@ CLOTH_COLLSETTINGS_FLAG_SELF
void psys_check_group_weights(struct ParticleSettings *part)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
size_t BLI_snprintf_utf8_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
ModifierData * BKE_modifier_get_original(const Object *object, ModifierData *md)
@ SPH_CURRENT_REST_LENGTH
@ SPH_VISCOELASTIC_SPRINGS
static void rna_def_particle_dupliweight(BlenderRNA *brna)
void RNA_def_property_array(PropertyRNA *prop, int length)
void BKE_particlesettings_fluid_default_settings(struct ParticleSettings *part)
static const EnumPropertyItem part_reactor_from_items[]
void psys_check_boid_data(struct ParticleSystem *psys)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
const EnumPropertyItem rna_enum_axis_xyz_items[]
struct ParticleSystem * psys
eParticleSystem_Flag flag