47 {0,
nullptr, 0,
nullptr,
nullptr},
56 {0,
nullptr, 0,
nullptr,
nullptr},
64 {0,
nullptr, 0,
nullptr,
nullptr},
71 {0,
nullptr, 0,
nullptr,
nullptr},
82 {0,
nullptr, 0,
nullptr,
nullptr},
90 {0,
nullptr, 0,
nullptr,
nullptr},
101 {0,
nullptr, 0,
nullptr,
nullptr},
110 {0,
nullptr, 0,
nullptr,
nullptr},
118 {0,
nullptr, 0,
nullptr,
nullptr},
133 {0,
nullptr, 0,
nullptr,
nullptr},
139# include <fmt/format.h>
159static void rna_ParticleHairKey_location_object_info(
PointerRNA *
ptr,
208static void rna_ParticleHairKey_location_object_get(
PointerRNA *
ptr,
float *values)
215 rna_ParticleHairKey_location_object_info(
ptr, &psmd, &pa);
242static int hair_key_index_get(
const Object *
object,
248 return hair_key - particle->
hair;
260 return hair_key - original_particle->
hair;
272static void hair_key_location_object_set(
HairKey *hair_key,
276 const float src_co[3])
281 if (hair_mesh !=
nullptr) {
282 const int hair_key_index = hair_key_index_get(
object, hair_key, modifier, particle);
283 if (hair_key_index == -1) {
293 object, modifier->mesh_final, modifier->psys->part->from, particle, hairmat);
302static void rna_ParticleHairKey_location_object_set(
PointerRNA *
ptr,
const float *values)
309 rna_ParticleHairKey_location_object_info(
ptr, &psmd, &pa);
316 hair_key_location_object_set(hkey, ob, psmd, pa, values);
319static void rna_ParticleHairKey_co_object(
HairKey *hairkey,
336 object, modifier->mesh_final, modifier->psys->part->from, particle, hairmat);
346static void rna_ParticleHairKey_co_object_set(
ID *
id,
354 if (particle ==
nullptr) {
364 hair_key_location_object_set(hair_key,
object, modifier, particle, co);
371static void rna_Particle_uv_on_emitter(
ParticleData *particle,
378 psmd, part->from, pa->
num, pa->
num_dmcache, pa->
fuv, pa->
foffset, co,
nor, 0, 0, sd.orco, 0);
381 if (modifier->mesh_final ==
nullptr) {
382 BKE_report(reports,
RPT_ERROR,
"uv_on_emitter() requires a modifier from an evaluated object");
388 int from = modifier->psys->part->from;
397 if (particle->
num < modifier->mesh_final->totface_legacy) {
407 const MFace *mface =
static_cast<const MFace *
>(
412 if (mface && mtface) {
423static void rna_ParticleSystem_co_hair(
433 if (particlesystem ==
nullptr) {
437 part = particlesystem->
part;
442 if (part ==
nullptr || pars ==
nullptr) {
455 if (particle_no < totpart && particlesystem->pathcache) {
456 cache = particlesystem->
pathcache[particle_no];
459 else if (particle_no < totpart + totchild && particlesystem->childcache) {
460 cache = particlesystem->
childcache[particle_no - totpart];
474 if (step >= 0 && step <= max_k) {
477 mul_m4_v3(object->object_to_world().ptr(), n_co);
490 Object *ob_found =
nullptr;
494 if (psys->
part == part) {
495 ob_found = ob_context;
501 if (ob_found ==
nullptr) {
504 ob && (ob_found ==
nullptr);
505 ob =
static_cast<Object *
>(ob->id.next))
508 if (psys->
part == part) {
522 if (ob_found && ob_found->totcol > 0) {
523 for (i = 1; i <= ob_found->totcol; i++) {
526 tmp.
icon = ICON_MATERIAL_DATA;
532 tmp.
name =
"Default Material";
540 tmp.
icon = ICON_MATERIAL_DATA;
541 tmp.
name =
"Default Material";
553static int rna_ParticleSystem_tessfaceidx_on_emitter(
ParticleSystem *particlesystem,
567 totface = modifier->mesh_final->totface_legacy;
568 totvert = modifier->mesh_final->verts_num;
571 if (!particlesystem || !totface) {
575 part = particlesystem->
part;
586 if (particle_no >= totpart + totchild) {
591 if (particle_no < totpart) {
593 particle->num_dmcache;
597 *r_fuv = &particle->
fuv;
603 const MFace *mface =
static_cast<const MFace *
>(
606 *r_fuv = &particle->
fuv;
611 for (
int i = 0; i < totface; i++, mface++) {
612 if (
ELEM(num, mface->
v1, mface->
v2, mface->
v3, mface->
v4)) {
641 *r_fuv = &parent->
fuv;
647 const MFace *mface =
static_cast<const MFace *
>(
650 *r_fuv = &parent->
fuv;
655 for (
int i = 0; i < totface; i++, mface++) {
656 if (
ELEM(num, mface->
v1, mface->
v2, mface->
v3, mface->
v4)) {
668static void rna_ParticleSystem_uv_on_emitter(
ParticleSystem *particlesystem,
676 if (modifier->mesh_final ==
nullptr) {
690 const int num = rna_ParticleSystem_tessfaceidx_on_emitter(
691 particlesystem, modifier, particle, particle_no, &fuv);
698 const MFace *mfaces =
static_cast<const MFace *
>(
700 const MFace *mface = &mfaces[num];
702 &modifier->mesh_final->fdata_legacy,
CD_MTFACE, uv_no);
709static void rna_ParticleSystem_mcol_on_emitter(
ParticleSystem *particlesystem,
726 const int num = rna_ParticleSystem_tessfaceidx_on_emitter(
727 particlesystem, modifier, particle, particle_no, &fuv);
734 const MFace *mfaces =
static_cast<const MFace *
>(
736 const MFace *mface = &mfaces[num];
738 &modifier->mesh_final->fdata_legacy,
CD_MCOL, vcol_no);
742 r_mcol[0] =
float(mcol.
b) / 255.0f;
743 r_mcol[1] =
float(mcol.
g) / 255.0f;
744 r_mcol[2] =
float(mcol.
r) / 255.0f;
751 if (
ptr->
type == &RNA_ParticleSystem) {
773 rna_Particle_redo(bmain, scene,
ptr);
792 rna_Particle_reset(bmain, scene,
ptr);
800 for (
Object *ob =
static_cast<Object *
>(bmain->objects.first); ob;
801 ob =
static_cast<Object *
>(ob->id.next))
804 if (psys->
part == part) {
837 else if (part->phystype ==
PART_PHYS_FLUID && part->fluid ==
nullptr) {
877 if (
ptr->
type == &RNA_ParticleTarget) {
880 ParticleSystem *kpsys =
nullptr, *psys = rna_particle_system_for_target(ob, pt);
882 if (
ELEM(pt->
ob, ob,
nullptr)) {
889 pt->
flag &= ~PTARGET_VALID;
901 pt->
flag &= ~PTARGET_VALID;
916 if (
ptr->
type == &RNA_ParticleTarget) {
933 if (psys && !psys->
clmd) {
938 rna_Particle_redo(bmain, scene,
ptr);
980 float delta = settings->end + settings->lifetime - settings->sta;
982 settings->path_start = settings->sta + settings->path_start * delta;
983 settings->path_end = settings->sta + settings->path_end * delta;
986 settings->path_start = (settings->path_start - settings->sta) / delta;
987 settings->path_end = (settings->path_end - settings->sta) / delta;
989 rna_Particle_redo(bmain, scene,
ptr);
991static void rna_PartSettings_start_set(
PointerRNA *
ptr,
float value)
996 if (value > settings->end) {
997 settings->end = value;
1001 if (settings->type == PART_REACTOR && value < 1.0)
1009 settings->sta = value;
1012static void rna_PartSettings_end_set(
PointerRNA *
ptr,
float value)
1017 if (value < settings->sta) {
1018 settings->sta = value;
1021 settings->end = value;
1024static void rna_PartSetings_timestep_set(
PointerRNA *
ptr,
float value)
1028 settings->timetweak = value / 0.04f;
1035 return settings->timetweak * 0.04f;
1038static void rna_PartSetting_hairlength_set(
PointerRNA *
ptr,
float value)
1041 settings->normfac = value / 4.0f;
1047 return settings->normfac * 4.0f;
1050static void rna_PartSetting_linelentail_set(
PointerRNA *
ptr,
float value)
1053 settings->draw_line[0] = value;
1056static float rna_PartSetting_linelentail_get(
PointerRNA *
ptr)
1059 return settings->draw_line[0];
1061static void rna_PartSetting_pathstartend_range(
1075static void rna_PartSetting_linelenhead_set(
PointerRNA *
ptr,
float value)
1078 settings->draw_line[1] = value;
1081static float rna_PartSetting_linelenhead_get(
PointerRNA *
ptr)
1084 return settings->draw_line[1];
1090 return ELEM(part->type,
1108 if (!part->clumpcurve) {
1113 rna_Particle_redo_child(bmain, scene,
ptr);
1116static void rna_ParticleSettings_use_roughness_curve_update(
Main *bmain,
1123 if (!part->roughcurve) {
1128 rna_Particle_redo_child(bmain, scene,
ptr);
1136 if (!part->twistcurve) {
1141 rna_Particle_redo_child(bmain, scene,
ptr);
1144static void rna_ParticleSystem_name_set(
PointerRNA *
ptr,
const char *value)
1154 DATA_(
"ParticleSystem"),
1157 sizeof(part->name));
1165 for (; pt; pt = pt->
next) {
1172static void rna_ParticleSystem_active_particle_target_index_range(
1180static int rna_ParticleSystem_active_particle_target_index_get(
PointerRNA *
ptr)
1186 for (; pt; pt = pt->
next, i++) {
1195static void rna_ParticleSystem_active_particle_target_index_set(
PointerRNA *
ptr,
int value)
1201 for (; pt; pt = pt->
next, i++) {
1206 pt->
flag &= ~PTARGET_CURRENT;
1211static size_t rna_ParticleTarget_name_get_impl(
PointerRNA *
ptr,
1213 const size_t value_maxncpy)
1232 value, value_maxncpy,
"%s: %s", pt->
ob->
id.
name + 2, psys->
name);
1244static void rna_ParticleTarget_name_get(
PointerRNA *
ptr,
char *value)
1247 const size_t value_buf_len = rna_ParticleTarget_name_get_impl(
ptr, value_buf,
sizeof(value_buf));
1248 memcpy(value, value_buf, value_buf_len + 1);
1254 return rna_ParticleTarget_name_get_impl(
ptr, value_buf,
sizeof(value_buf));
1261 return (
GS(id->name) ==
ID_PA);
1264static std::optional<std::string> rna_SPHFluidSettings_path(
const PointerRNA *
ptr)
1268 if (particle_id_check(
ptr)) {
1271 if (part->fluid == fluid) {
1275 return std::nullopt;
1278static bool rna_ParticleSystem_multiple_caches_get(
PointerRNA *
ptr)
1306 for (; dw; dw = dw->
next) {
1313static void rna_ParticleDupliWeight_active_index_range(
1321static int rna_ParticleDupliWeight_active_index_get(
PointerRNA *
ptr)
1327 for (; dw; dw = dw->
next, i++) {
1336static void rna_ParticleDupliWeight_active_index_set(
PointerRNA *
ptr,
int value)
1342 for (; dw; dw = dw->
next, i++) {
1347 dw->
flag &= ~PART_DUPLIW_CURRENT;
1352static size_t rna_ParticleDupliWeight_name_get_impl(
PointerRNA *
ptr,
1354 const size_t value_maxncpy)
1368static void rna_ParticleDupliWeight_name_get(
PointerRNA *
ptr,
char *value)
1371 const size_t value_buf_len = rna_ParticleDupliWeight_name_get_impl(
1372 ptr, value_buf,
sizeof(value_buf));
1373 memcpy(value, value_buf, value_buf_len + 1);
1376static int rna_ParticleDupliWeight_name_length(
PointerRNA *
ptr)
1379 return rna_ParticleDupliWeight_name_get_impl(
ptr, value_buf,
sizeof(value_buf));
1393 return part_fluid_type_items;
1403 if (part->type == PART_REACTOR) {
1407 return part_from_items;
1418 return part_hair_dist_items;
1433 return part_hair_draw_as_items;
1448 return part_hair_ren_as_items;
1467static void psys_vg_name_get__internal(
PointerRNA *
ptr,
char *value,
int index)
1473 if (psys->
vgroup[index] > 0) {
1478 strcpy(value, defGroup->
name);
1485static int psys_vg_name_len__internal(
PointerRNA *
ptr,
int index)
1490 if (psys->
vgroup[index] > 0) {
1496 return strlen(defGroup->
name);
1501static void psys_vg_name_set__internal(
PointerRNA *
ptr,
const char *value,
int index)
1506 if (value[0] ==
'\0') {
1512 if (defgrp_index == -1) {
1516 psys->
vgroup[index] = defgrp_index + 1;
1520static std::optional<std::string> rna_ParticleSystem_path(
const PointerRNA *
ptr)
1523 char name_esc[
sizeof(psys->
name) * 2];
1526 return fmt::format(
"particle_systems[\"{}\"]", name_esc);
1544static void rna_ParticleSettings_active_texture_set(
PointerRNA *
ptr,
1554static void rna_ParticleVGroup_name_get_0(
PointerRNA *
ptr,
char *value)
1556 psys_vg_name_get__internal(
ptr, value, 0);
1558static void rna_ParticleVGroup_name_get_1(
PointerRNA *
ptr,
char *value)
1560 psys_vg_name_get__internal(
ptr, value, 1);
1562static void rna_ParticleVGroup_name_get_2(
PointerRNA *
ptr,
char *value)
1564 psys_vg_name_get__internal(
ptr, value, 2);
1566static void rna_ParticleVGroup_name_get_3(
PointerRNA *
ptr,
char *value)
1568 psys_vg_name_get__internal(
ptr, value, 3);
1570static void rna_ParticleVGroup_name_get_4(
PointerRNA *
ptr,
char *value)
1572 psys_vg_name_get__internal(
ptr, value, 4);
1574static void rna_ParticleVGroup_name_get_5(
PointerRNA *
ptr,
char *value)
1576 psys_vg_name_get__internal(
ptr, value, 5);
1578static void rna_ParticleVGroup_name_get_6(
PointerRNA *
ptr,
char *value)
1580 psys_vg_name_get__internal(
ptr, value, 6);
1582static void rna_ParticleVGroup_name_get_7(
PointerRNA *
ptr,
char *value)
1584 psys_vg_name_get__internal(
ptr, value, 7);
1586static void rna_ParticleVGroup_name_get_8(
PointerRNA *
ptr,
char *value)
1588 psys_vg_name_get__internal(
ptr, value, 8);
1590static void rna_ParticleVGroup_name_get_9(
PointerRNA *
ptr,
char *value)
1592 psys_vg_name_get__internal(
ptr, value, 9);
1594static void rna_ParticleVGroup_name_get_10(
PointerRNA *
ptr,
char *value)
1596 psys_vg_name_get__internal(
ptr, value, 10);
1598static void rna_ParticleVGroup_name_get_11(
PointerRNA *
ptr,
char *value)
1600 psys_vg_name_get__internal(
ptr, value, 11);
1602static void rna_ParticleVGroup_name_get_12(
PointerRNA *
ptr,
char *value)
1604 psys_vg_name_get__internal(
ptr, value, 12);
1609 return psys_vg_name_len__internal(
ptr, 0);
1613 return psys_vg_name_len__internal(
ptr, 1);
1617 return psys_vg_name_len__internal(
ptr, 2);
1621 return psys_vg_name_len__internal(
ptr, 3);
1625 return psys_vg_name_len__internal(
ptr, 4);
1629 return psys_vg_name_len__internal(
ptr, 5);
1633 return psys_vg_name_len__internal(
ptr, 6);
1637 return psys_vg_name_len__internal(
ptr, 7);
1641 return psys_vg_name_len__internal(
ptr, 8);
1645 return psys_vg_name_len__internal(
ptr, 9);
1649 return psys_vg_name_len__internal(
ptr, 10);
1653 return psys_vg_name_len__internal(
ptr, 11);
1657 return psys_vg_name_len__internal(
ptr, 12);
1660static void rna_ParticleVGroup_name_set_0(
PointerRNA *
ptr,
const char *value)
1662 psys_vg_name_set__internal(
ptr, value, 0);
1664static void rna_ParticleVGroup_name_set_1(
PointerRNA *
ptr,
const char *value)
1666 psys_vg_name_set__internal(
ptr, value, 1);
1668static void rna_ParticleVGroup_name_set_2(
PointerRNA *
ptr,
const char *value)
1670 psys_vg_name_set__internal(
ptr, value, 2);
1672static void rna_ParticleVGroup_name_set_3(
PointerRNA *
ptr,
const char *value)
1674 psys_vg_name_set__internal(
ptr, value, 3);
1676static void rna_ParticleVGroup_name_set_4(
PointerRNA *
ptr,
const char *value)
1678 psys_vg_name_set__internal(
ptr, value, 4);
1680static void rna_ParticleVGroup_name_set_5(
PointerRNA *
ptr,
const char *value)
1682 psys_vg_name_set__internal(
ptr, value, 5);
1684static void rna_ParticleVGroup_name_set_6(
PointerRNA *
ptr,
const char *value)
1686 psys_vg_name_set__internal(
ptr, value, 6);
1688static void rna_ParticleVGroup_name_set_7(
PointerRNA *
ptr,
const char *value)
1690 psys_vg_name_set__internal(
ptr, value, 7);
1692static void rna_ParticleVGroup_name_set_8(
PointerRNA *
ptr,
const char *value)
1694 psys_vg_name_set__internal(
ptr, value, 8);
1696static void rna_ParticleVGroup_name_set_9(
PointerRNA *
ptr,
const char *value)
1698 psys_vg_name_set__internal(
ptr, value, 9);
1700static void rna_ParticleVGroup_name_set_10(
PointerRNA *
ptr,
const char *value)
1702 psys_vg_name_set__internal(
ptr, value, 10);
1704static void rna_ParticleVGroup_name_set_11(
PointerRNA *
ptr,
const char *value)
1706 psys_vg_name_set__internal(
ptr, value, 11);
1708static void rna_ParticleVGroup_name_set_12(
PointerRNA *
ptr,
const char *value)
1710 psys_vg_name_set__internal(
ptr, value, 12);
1737 prop,
"Location (Object Space)",
"Location of the hair key in object space");
1739 "rna_ParticleHairKey_location_object_get",
1740 "rna_ParticleHairKey_location_object_set",
1747 "Location of the hair key in its local coordinate system, "
1748 "relative to the emitting face");
1751 func =
RNA_def_function(srna,
"co_object",
"rna_ParticleHairKey_co_object");
1755 parm =
RNA_def_pointer(func,
"modifier",
"ParticleSystemModifier",
"",
"Particle modifier");
1757 parm =
RNA_def_pointer(func,
"particle",
"Particle",
"",
"hair particle");
1760 func,
"co", 3,
nullptr, -
FLT_MAX,
FLT_MAX,
"Co",
"Exported hairkey location", -1e4, 1e4);
1764 func =
RNA_def_function(srna,
"co_object_set",
"rna_ParticleHairKey_co_object_set");
1769 parm =
RNA_def_pointer(func,
"modifier",
"ParticleSystemModifier",
"",
"Particle modifier");
1771 parm =
RNA_def_pointer(func,
"particle",
"Particle",
"",
"hair particle");
1774 func,
"co", 3,
nullptr, -
FLT_MAX,
FLT_MAX,
"Co",
"Specified hairkey location", -1e4, 1e4);
1813 srna,
"Child Particle",
"Child particle interpolated from simulated or edited particles");
1837 {0,
nullptr, 0,
nullptr,
nullptr},
1934 func =
RNA_def_function(srna,
"uv_on_emitter",
"rna_Particle_uv_on_emitter");
1936 "Obtain UV coordinates for a particle on an evaluated mesh.");
1940 "ParticleSystemModifier",
1942 "Particle modifier from an evaluated object");
1957 "Particle Instance Object Weight",
1958 "Weight of a particle instance object in a collection");
1963 prop,
"rna_ParticleDupliWeight_name_get",
"rna_ParticleDupliWeight_name_length",
nullptr);
1971 prop,
"Count",
"The number of times this object is repeated with respect to other objects");
1985 "An artistic solver with strong surface tension effects (original)"},
1987 {0,
nullptr, 0,
nullptr,
nullptr},
2000 prop,
"SPH Solver",
"The code used to calculate internal forces on particles");
2025 prop,
"Viscoelastic Springs",
"Use viscoelastic springs instead of Hooke's springs");
2032 "Initial Rest Length",
2033 "Use the initial length as spring rest length instead of 2 * particle size");
2042 "How much the spring rest length can change after the elastic limit is crossed");
2051 "How much the spring has to be stretched/compressed in order to change its rest length");
2059 "Create springs for this number of frames since particles birth (0 is always)");
2092 "How strongly the fluid tries to keep from clustering (factor of stiffness)");
2110 "Artificial buoyancy force in negative gravity direction based on pressure "
2111 "differences inside the fluid");
2126 "Density is calculated as a factor of default density (depends on particle size)");
2132 prop,
"Factor Radius",
"Interaction radius is a factor of 4 * particle size");
2138 prop,
"Factor Stiff Viscosity",
"Stiff viscosity is a factor of normal viscosity");
2144 prop,
"Factor Rest Length",
"Spring rest length is a factor of 2 * particle size");
2154 {
TEXCO_GLOB,
"GLOBAL", 0,
"Global",
"Use global coordinates for the texture coordinates"},
2159 "Use linked object's coordinates for texture coordinates"},
2160 {
TEXCO_UV,
"UV", 0,
"UV",
"Use UV coordinates for texture coordinates"},
2165 "Use the original undeformed coordinates of the object"},
2169 "Strand / Particle",
2170 "Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"},
2171 {0,
nullptr, 0,
nullptr,
nullptr},
2175 {
MTEX_FLAT,
"FLAT", 0,
"Flat",
"Map X and Y coordinates directly"},
2176 {
MTEX_CUBE,
"CUBE", 0,
"Cube",
"Map using the normal vector"},
2177 {
MTEX_TUBE,
"TUBE", 0,
"Tube",
"Map with Z as central axis"},
2178 {
MTEX_SPHERE,
"SPHERE", 0,
"Sphere",
"Map with Z as central axis"},
2179 {0,
nullptr, 0,
nullptr,
nullptr},
2183 {0,
"NONE", 0,
"None",
""},
2184 {1,
"X", 0,
"X",
""},
2185 {2,
"Y", 0,
"Y",
""},
2186 {3,
"Z", 0,
"Z",
""},
2187 {0,
nullptr, 0,
nullptr,
nullptr},
2191 {0,
"NONE", 0,
"None",
""},
2192 {1,
"X", 0,
"X",
""},
2193 {2,
"Y", 0,
"Y",
""},
2194 {3,
"Z", 0,
"Z",
""},
2195 {0,
nullptr, 0,
nullptr,
nullptr},
2199 {0,
"NONE", 0,
"None",
""},
2200 {1,
"X", 0,
"X",
""},
2201 {2,
"Y", 0,
"Y",
""},
2202 {3,
"Z", 0,
"Z",
""},
2203 {0,
nullptr, 0,
nullptr,
nullptr},
2206 srna =
RNA_def_struct(brna,
"ParticleSettingsTextureSlot",
"TextureSlot");
2209 "Particle Settings Texture Slot",
2210 "Texture slot for textures in a Particle Settings data-block");
2217 "Texture Coordinates",
2218 "Texture coordinates used to map the texture onto the background");
2227 prop,
"Object",
"Object to use for mapping with Object texture coordinates");
2233 prop,
"UV Map",
"UV map to use for mapping with UV texture coordinates");
2336 prop,
"Emission Time Factor",
"Amount texture affects particle emission time");
2361 prop,
"Velocity Factor",
"Amount texture affects particle initial velocity");
2398 prop,
"Kink Amplitude Factor",
"Amount texture affects child kink amplitude");
2405 prop,
"Kink Frequency Factor",
"Amount texture affects child kink frequency");
2432 {0,
nullptr, 0,
nullptr,
nullptr},
2436 {0,
"NONE", 0,
"None",
""},
2446 {0,
nullptr, 0,
nullptr,
nullptr},
2450 {0,
"NONE", 0,
"None",
""},
2458 {0,
nullptr, 0,
nullptr,
nullptr},
2465 {0,
nullptr, 0,
nullptr,
nullptr},
2469 {0,
"NONE", 0,
"None",
""},
2472 {0,
nullptr, 0,
nullptr,
nullptr},
2481 {0,
nullptr, 0,
nullptr,
nullptr},
2491 {0,
nullptr, 0,
nullptr,
nullptr},
2499 {0,
nullptr, 0,
nullptr,
nullptr},
2503 {0,
"DUMMY", 0,
"Dummy",
""},
2504 {0,
nullptr, 0,
nullptr,
nullptr},
2509 srna,
"Particle Settings",
"Particle settings, reusable by multiple particle systems");
2514 "rna_ParticleSettings_mtex_begin",
2515 "rna_ParticleSettings_active_texture_get",
2516 "rna_ParticleSettings_active_texture_set",
2518 "ParticleSettingsTextureSlot",
2519 "ParticleSettingsTextureSlots",
2520 "rna_Particle_reset_dependency",
2568 "Even Distribution",
2569 "Use even distribution from faces based on face areas or edge lengths");
2576 prop,
"Die on Hit",
"Particles die when they collide with a deflector object");
2595 prop,
"Dynamic",
"Particle rotations are affected by collisions and effectors");
2623 prop,
"Invert Grid",
"Invert what is considered object and what is not");
2672 prop,
"Distribution",
"How to distribute particles on selected element");
2690 "Particle orientation axis (does not affect Explode modifier's results)");
2698 prop,
"Angular Velocity Axis",
"What axis is used to change particle rotation with time");
2769 "Use object's rotation for duplication (global x-axis is aligned "
2770 "particle rotation axis)");
2866 prop,
"Degrees",
"How many degrees path has to curve to make another render segment");
2872 prop,
"Pixel",
"How many pixels path has to cover to make another render segment");
2884 prop,
"Material Index",
"Index of material slot used for rendering particles");
2898 "Algorithm used to calculate physics, from the fastest to the "
2899 "most stable and accurate: Midpoint, Euler, Verlet, RK4");
2953 prop,
"Tweak",
"A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)");
2958 prop,
"rna_PartSettings_timestep_get",
"rna_PartSetings_timestep_set",
nullptr);
2962 prop,
"Timestep",
"The simulation timestep per frame (seconds per frame)");
2968 prop,
"Automatic Subframes",
"Automatically set the number of subframes");
2976 "Subframes to simulate for improved stability and finer granularity simulations "
2977 "(dt = timestep / (subframes + 1))");
2984 "Adaptive Subframe Threshold",
2985 "The relative distance a particle can move before requiring more subframes "
2986 "(target Courant number); 0.01 to 0.3 is the recommended range");
3039 prop,
"Effector Number",
"How many particles are effectors (0 is all particles)");
3048 prop,
"Normal",
"Let the surface normal give the particle a starting velocity");
3056 prop,
"Object Velocity",
"Let the object give the particle a starting velocity");
3071 prop,
"Particle",
"Let the target particle give the particle a starting velocity");
3079 prop,
"Tangent",
"Let the surface tangent give the particle a starting velocity");
3094 "Let the vector away from the target particle's location give the particle "
3095 "a starting velocity");
3106 "Let the emitter object orientation give the particle a starting velocity");
3114 prop,
"Angular Velocity",
"Angular velocity amount (in radians per second)");
3133 prop,
"Random Phase",
"Randomize rotation around the chosen orientation axis");
3138 prop,
"rna_PartSetting_hairlength_get",
"rna_PartSetting_hairlength_set",
nullptr);
3203 prop,
nullptr,
"child_percent");
3214 prop,
"Rendered Children",
"Number of children per parent for rendering");
3233 prop,
"Random Child Size",
"Random variation to the size of the child particles");
3327 prop,
"Extra Steps",
"Extra steps for resolution of special kink features");
3368 prop,
"Threshold",
"Amount of particles left untouched by random roughness");
3406 prop,
"Threshold",
"Amount of particles left untouched by child path length");
3414 prop,
"Parting Factor",
"Create parting in the children based on parent strands");
3422 "Minimum root to tip angle (tip distance/root distance for long hair)");
3430 "Maximum root to tip angle (tip distance/root distance for long hair)");
3443 prop,
"rna_PartSetting_linelentail_get",
"rna_PartSetting_linelentail_set",
nullptr);
3451 prop,
"rna_PartSetting_linelenhead_get",
"rna_PartSetting_linelenhead_set",
nullptr);
3489 "Use Modifier Stack",
3490 "Emit particles from mesh with modifiers applied "
3491 "(must use same subdivision surface level for viewport and render for correct results)");
3501 prop,
"Instance Collection",
"Show objects in this collection in place of particles");
3508 "Instance Collection Weights",
3509 "Weights for all of the objects in the instance collection");
3514 prop,
"rna_ParticleDupliWeight_active_get",
nullptr,
nullptr,
nullptr);
3519 "rna_ParticleDupliWeight_active_index_get",
3520 "rna_ParticleDupliWeight_active_index_set",
3521 "rna_ParticleDupliWeight_active_index_range");
3591 prop, 0,
"rna_Particle_redo");
3597 prop, 0,
"rna_Particle_redo");
3605 prop, 0,
"rna_Particle_redo");
3613 prop, 0,
"rna_Particle_redo");
3621 prop, 0,
"rna_Particle_redo");
3633 {0,
nullptr, 0,
nullptr,
nullptr},
3641 prop,
"rna_ParticleTarget_name_get",
"rna_ParticleTarget_name_length",
nullptr);
3653 "The object that has the target particle system (empty if same object)");
3660 prop,
"Target Particle System",
"The index of particle system on the target object");
3714 prop,
"rna_particle_settings_get",
"rna_particle_settings_set",
nullptr,
nullptr);
3729 prop,
"Child Particles",
"Child particles generated by the particle system");
3733 prop,
"Seed",
"Offset in the random number table, to get a different randomized result");
3740 "Offset in the random number table for child particles, to get a different "
3741 "randomized result");
3767 "Reactor Target Object",
3768 "For reactor systems, the object that has the target particle system "
3769 "(empty if same object)");
3776 "Reactor Target Particle System",
3777 "For reactor systems, index of particle system on the target object");
3794 prop,
"rna_ParticleSystem_active_particle_target_get",
nullptr,
nullptr,
nullptr);
3799 "rna_ParticleSystem_active_particle_target_index_get",
3800 "rna_ParticleSystem_active_particle_target_index_set",
3801 "rna_ParticleSystem_active_particle_target_index_range");
3816 "rna_ParticleVGroup_name_get_0",
3817 "rna_ParticleVGroup_name_len_0",
3818 "rna_ParticleVGroup_name_set_0");
3825 prop,
"Vertex Group Density Negate",
"Negate the effect of the density vertex group");
3830 "rna_ParticleVGroup_name_get_1",
3831 "rna_ParticleVGroup_name_len_1",
3832 "rna_ParticleVGroup_name_set_1");
3839 prop,
"Vertex Group Velocity Negate",
"Negate the effect of the velocity vertex group");
3844 "rna_ParticleVGroup_name_get_2",
3845 "rna_ParticleVGroup_name_len_2",
3846 "rna_ParticleVGroup_name_set_2");
3853 prop,
"Vertex Group Length Negate",
"Negate the effect of the length vertex group");
3858 "rna_ParticleVGroup_name_get_3",
3859 "rna_ParticleVGroup_name_len_3",
3860 "rna_ParticleVGroup_name_set_3");
3867 prop,
"Vertex Group Clump Negate",
"Negate the effect of the clump vertex group");
3872 "rna_ParticleVGroup_name_get_4",
3873 "rna_ParticleVGroup_name_len_4",
3874 "rna_ParticleVGroup_name_set_4");
3881 prop,
"Vertex Group Kink Negate",
"Negate the effect of the kink vertex group");
3886 "rna_ParticleVGroup_name_get_5",
3887 "rna_ParticleVGroup_name_len_5",
3888 "rna_ParticleVGroup_name_set_5");
3890 prop,
"Vertex Group Roughness 1",
"Vertex group to control roughness 1");
3896 "Vertex Group Roughness 1 Negate",
3897 "Negate the effect of the roughness 1 vertex group");
3902 "rna_ParticleVGroup_name_get_6",
3903 "rna_ParticleVGroup_name_len_6",
3904 "rna_ParticleVGroup_name_set_6");
3906 prop,
"Vertex Group Roughness 2",
"Vertex group to control roughness 2");
3912 "Vertex Group Roughness 2 Negate",
3913 "Negate the effect of the roughness 2 vertex group");
3918 "rna_ParticleVGroup_name_get_7",
3919 "rna_ParticleVGroup_name_len_7",
3920 "rna_ParticleVGroup_name_set_7");
3922 prop,
"Vertex Group Roughness End",
"Vertex group to control roughness end");
3928 "Vertex Group Roughness End Negate",
3929 "Negate the effect of the roughness end vertex group");
3934 "rna_ParticleVGroup_name_get_8",
3935 "rna_ParticleVGroup_name_len_8",
3936 "rna_ParticleVGroup_name_set_8");
3943 prop,
"Vertex Group Size Negate",
"Negate the effect of the size vertex group");
3948 "rna_ParticleVGroup_name_get_9",
3949 "rna_ParticleVGroup_name_len_9",
3950 "rna_ParticleVGroup_name_set_9");
3957 prop,
"Vertex Group Tangent Negate",
"Negate the effect of the tangent vertex group");
3962 "rna_ParticleVGroup_name_get_10",
3963 "rna_ParticleVGroup_name_len_10",
3964 "rna_ParticleVGroup_name_set_10");
3971 prop,
"Vertex Group Rotation Negate",
"Negate the effect of the rotation vertex group");
3976 "rna_ParticleVGroup_name_get_11",
3977 "rna_ParticleVGroup_name_len_11",
3978 "rna_ParticleVGroup_name_set_11");
3985 prop,
"Vertex Group Field Negate",
"Negate the effect of the field vertex group");
3990 "rna_ParticleVGroup_name_get_12",
3991 "rna_ParticleVGroup_name_len_12",
3992 "rna_ParticleVGroup_name_set_12");
3999 prop,
"Vertex Group Twist Negate",
"Negate the effect of the twist vertex group");
4020 prop,
"Parent",
"Use this object's coordinate system instead of global coordinate system");
4040 prop,
"Timestep",
"The current simulation time step size, as a fraction of a frame");
4052 RNA_def_int(func,
"particle_no", 0, INT_MIN, INT_MAX,
"Particle no",
"", INT_MIN, INT_MAX);
4053 RNA_def_int(func,
"step", 0, INT_MIN, INT_MAX,
"step no",
"", INT_MIN, INT_MAX);
4055 func,
"co", 3,
nullptr, -
FLT_MAX,
FLT_MAX,
"Co",
"Exported hairkey location", -1e4, 1e4);
4060 func =
RNA_def_function(srna,
"uv_on_emitter",
"rna_ParticleSystem_uv_on_emitter");
4063 parm =
RNA_def_pointer(func,
"modifier",
"ParticleSystemModifier",
"",
"Particle modifier");
4067 RNA_def_int(func,
"particle_no", 0, INT_MIN, INT_MAX,
"Particle no",
"", INT_MIN, INT_MAX);
4068 RNA_def_int(func,
"uv_no", 0, INT_MIN, INT_MAX,
"UV no",
"", INT_MIN, INT_MAX);
4075 func =
RNA_def_function(srna,
"mcol_on_emitter",
"rna_ParticleSystem_mcol_on_emitter");
4078 parm =
RNA_def_pointer(func,
"modifier",
"ParticleSystemModifier",
"",
"Particle modifier");
4082 RNA_def_int(func,
"particle_no", 0, INT_MIN, INT_MAX,
"Particle no",
"", INT_MIN, INT_MAX);
4083 RNA_def_int(func,
"vcol_no", 0, INT_MIN, INT_MAX,
"vcol no",
"", INT_MIN, INT_MAX);
void boid_default_settings(struct BoidSettings *boids)
struct BoidRule * boid_new_rule(int type)
struct BoidState * boid_new_state(struct BoidSettings *boids)
PointerRNA CTX_data_pointer_get(const bContext *C, const char *member)
Main * CTX_data_main(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
const void * CustomData_get_layer_n(const CustomData *data, eCustomDataType type, int n)
const void * CustomData_get_layer(const CustomData *data, eCustomDataType type)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
General operations, lookup, etc. for materials.
struct Material * BKE_object_material_get(struct Object *ob, short act)
void BKE_mesh_tessface_ensure(Mesh *mesh)
ModifierData * BKE_modifier_get_original(const Object *object, ModifierData *md)
ModifierData * BKE_modifier_new(int type)
void BKE_particlesettings_fluid_default_settings(struct ParticleSettings *part)
void BKE_particlesettings_rough_curve_init(struct ParticleSettings *part)
bool psys_check_edited(struct ParticleSystem *psys)
void BKE_particlesettings_twist_curve_init(struct ParticleSettings *part)
void psys_interpolate_uvs(const struct MTFace *tface, int quad, const float w[4], float uvco[2])
void psys_check_group_weights(struct ParticleSettings *part)
void BKE_particlesettings_clump_curve_init(struct ParticleSettings *part)
void psys_mat_hair_to_object(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
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 psys_check_boid_data(struct ParticleSystem *psys)
void psys_changed_type(struct Object *ob, struct ParticleSystem *psys)
void psys_find_group_weights(struct ParticleSettings *part)
void psys_interpolate_mcol(const struct MCol *mcol, int quad, const float w[4], struct MCol *mc)
void BKE_report(ReportList *reports, eReportType type, const char *message)
struct Tex * give_current_particle_texture(struct ParticleSettings *part)
void set_current_particle_texture(struct ParticleSettings *part, struct Tex *tex)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
void mul_m4_v3(const float M[4][4], float r[3])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void zero_v2(float r[2])
MINLINE void zero_v3(float r[3])
size_t BLI_snprintf_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
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
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
void BLI_uniquename(const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
#define ARRAY_HAS_ITEM(arr_item, arr_start, arr_len)
#define BLT_I18NCONTEXT_AMOUNT
#define BLT_I18NCONTEXT_ID_IMAGE
#define BLT_I18NCONTEXT_ID_PARTICLESETTINGS
#define BLT_I18NCONTEXT_ID_TEXTURE
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
#define BOIDSTATE_CURRENT
@ CLOTH_SIMSETTINGS_FLAG_RESIST_SPRING_COMPRESS
@ eModifierType_ParticleSystem
Object is a sort of wrapper for general info.
@ PART_HIDE_ADVANCED_HAIR
@ PART_FLUID_SPRAYFOAMBUBBLE
@ SPH_CURRENT_REST_LENGTH
@ SPH_VISCOELASTIC_SPRINGS
@ PART_CHILD_USE_TWIST_CURVE
@ PART_CHILD_USE_CLUMP_CURVE
@ PART_CHILD_USE_CLUMP_NOISE
@ PART_CHILD_USE_ROUGH_CURVE
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
@ PROPOVERRIDE_NO_COMPARISON
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
ccl_device_inline uint particle_index(KernelGlobals kg, int particle)
void *(* MEM_callocN)(size_t len, const char *str)
Frequency::GEOMETRY nor[]
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
void rna_def_animdata_common(StructRNA *srna)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
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_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
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)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
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)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
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_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_function_flag(FunctionRNA *func, int flag)
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_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag 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)
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 RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
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)
const EnumPropertyItem rna_enum_axis_xyz_items[]
static void rna_def_particle_settings(BlenderRNA *brna)
static void rna_def_fluid_settings(BlenderRNA *brna)
static void rna_def_particle_settings_mtex(BlenderRNA *brna)
static const EnumPropertyItem part_type_items[]
static void rna_def_particle_dupliweight(BlenderRNA *brna)
static const EnumPropertyItem part_draw_as_items[]
void RNA_def_particle(BlenderRNA *brna)
static void rna_def_particle_target(BlenderRNA *brna)
static void rna_def_particle_system(BlenderRNA *brna)
static void rna_def_particle(BlenderRNA *brna)
static void rna_def_particle_hair_key(BlenderRNA *brna)
static const EnumPropertyItem part_reactor_from_items[]
static const EnumPropertyItem part_dist_items[]
static void rna_def_particle_key(BlenderRNA *brna)
static const EnumPropertyItem part_ren_as_items[]
static void rna_def_child_particle(BlenderRNA *brna)
struct ClothSimSettings * sim_parms
struct ClothCollSettings * coll_parms
struct ModifierData * next
struct ParticleDupliWeight * next
struct ParticleSystem * psys
struct PTCacheEdit * edit
struct ParticleSystem * next
struct PointCache * pointcache
struct ClothModifierData * clmd
struct ParticleCacheKey ** childcache
struct Mesh * hair_out_mesh
struct ParticleCacheKey ** pathcache
struct ParticleTarget * next
struct PTCacheEdit * edit
void WM_main_add_notifier(uint type, void *reference)