9 #define DNA_DEPRECATED_ALLOW
120 if (partticle_settings_src->
mtex[
a]) {
166 for (
int i = 0; i <
MAX_MTEX; i++) {
167 if (psett->
mtex[i]) {
211 switch (rule->type) {
234 BoidCondition *cond =
state->conditions.first;
235 for (; cond; cond = cond->next) {
268 if (dw->ob !=
NULL) {
272 if (
object == dw->ob) {
404 switch (rule->type) {
484 .name =
"ParticleSettings",
485 .name_plural =
"particles",
488 .asset_type_info =
NULL,
495 .foreach_cache =
NULL,
496 .foreach_path =
NULL,
504 .blend_read_undo_preserve =
NULL,
506 .lib_override_apply_post =
NULL,
574 else if (p % totgr == cur) {
583 #define PATH_CACHE_BUF_SIZE 1024
594 int i, totkey, totbufkey;
598 cache =
MEM_callocN(tot *
sizeof(
void *),
"PathCacheArray");
600 while (totkey < tot) {
605 for (i = 0; i < totbufkey; i++) {
624 for (buf = bufs->
first; buf; buf = buf->
next) {
698 for (; md; md = md->
next) {
700 if (md->
mode & mode) {
740 for (; psys; psys = psys->
next) {
748 for (; psys; psys = psys->
next) {
764 if (object_eval ==
object) {
768 while (psys_eval !=
NULL) {
772 psys_eval = psys_eval->
next;
815 if (use_render_params) {
848 if (dw->ob ==
NULL) {
887 while (dw && dw->
ob !=
object) {
1128 BLI_kdtree_3d_free(psys->
tree);
1217 float v1,
float v2,
float v3,
float v4,
const float w[4],
int four)
1221 value =
w[0] *
v1 +
w[1] *
v2 +
w[2] * v3;
1226 CLAMP(value, 0.0f, 1.0f);
1302 *cur = (*cur)->
next;
1307 while (*cur && (*cur)->
next && (
float)(*cur)->
frame <
t) {
1308 *cur = (*cur)->
next;
1348 *r_start = pm->
frame;
1357 *r_dietime = pm->
frame + 1;
1369 int dietime = 10000000;
1374 dietime = pm->
frame + 1;
1379 return (
float)dietime;
1397 else if (pind->
keyed) {
1399 pind->
kkey[0] = key;
1405 else if (pind->
cache) {
1406 float start = 0.0f, dietime = 0.0f;
1418 pind->
hkey[0] = key;
1419 pind->
hkey[1] = key + 1;
1460 float real_t, dfra, keytime, invdt = 1.0f;
1463 memset(keys, 0,
sizeof(keys));
1467 if (
result->time < 0.0f) {
1475 while (*(pind->
ekey[1]->
time) < real_t) {
1481 else if (pind->
keyed) {
1488 if (
result->time < 0.0f) {
1501 while (pt && pa->
time + pt->
time < real_t) {
1519 while (pind->
kkey[1]->
time < real_t) {
1525 else if (pind->
cache) {
1526 if (
result->time < 0.0f) {
1534 if (
result->time < 0.0f) {
1542 while (pind->
hkey[1]->
time < real_t) {
1555 else if (pind->
mesh) {
1560 else if (pind->
keyed) {
1564 else if (pind->
cache) {
1573 if (!pind->
keyed && !pind->
cache && !point_vel) {
1582 else if (pind->
mesh) {
1607 else if (pind->
mesh) {
1625 dfra = keys[2].
time - keys[1].
time;
1626 keytime = (real_t - keys[1].
time) / dfra;
1629 if (pind->
keyed || pind->
cache || point_vel) {
1630 invdt = dfra * 0.04f * (psys ? psys->
part->
timetweak : 1.0f);
1648 if (pind->
keyed || pind->
cache || point_vel) {
1661 while (i < first->segments && cur->
time <
t) {
1665 if (cur->
time ==
t) {
1669 float dt = (
t - (cur - 1)->
time) / (cur->
time - (cur - 1)->
time);
1677 if (cur == first || cur - 1 == first) {
1691 const float (*vert_normals)[3],
1694 const float (*orcodata)[3],
1702 float *
v1 = 0, *
v2 = 0, *v3 = 0, *v4 = 0;
1703 float e1[3], e2[3], s1, s2, t1, t2;
1704 float *uv1, *uv2, *uv3, *uv4;
1705 float n1[3], n2[3], n3[3], n4[3];
1707 const float *o1, *o2, *o3, *o4;
1709 v1 = mvert[mface->
v1].
co;
1710 v2 = mvert[mface->
v2].
co;
1711 v3 = mvert[mface->
v3].
co;
1718 v4 = mvert[mface->
v4].
co;
1767 s1 = uv3[0] - uv1[0];
1768 s2 = uv4[0] - uv1[0];
1770 t1 = uv3[1] - uv1[1];
1771 t2 = uv4[1] - uv1[1];
1777 s1 = uv2[0] - uv1[0];
1778 s2 = uv3[0] - uv1[0];
1780 t1 = uv2[1] - uv1[1];
1781 t2 = uv3[1] - uv1[1];
1787 vtan[0] = (s1 * e2[0] - s2 * e1[0]);
1788 vtan[1] = (s1 * e2[1] - s2 * e1[1]);
1789 vtan[2] = (s1 * e2[2] - s2 * e1[2]);
1791 utan[0] = (t1 * e2[0] - t2 * e1[0]);
1792 utan[1] = (t1 * e2[1] - t2 * e1[1]);
1793 utan[2] = (t1 * e2[2] - t2 * e1[2]);
1798 o1 = orcodata[mface->
v1];
1799 o2 = orcodata[mface->
v2];
1800 o3 = orcodata[mface->
v3];
1803 o4 = orcodata[mface->
v4];
1819 float v10 = tface->
uv[0][0];
1820 float v11 = tface->
uv[0][1];
1821 float v20 = tface->
uv[1][0];
1822 float v21 = tface->
uv[1][1];
1823 float v30 = tface->
uv[2][0];
1824 float v31 = tface->
uv[2][1];
1828 v40 = tface->
uv[3][0];
1829 v41 = tface->
uv[3][1];
1831 uvco[0] =
w[0] * v10 +
w[1] * v20 +
w[2] * v30 +
w[3] * v40;
1832 uvco[1] =
w[0] * v11 +
w[1] * v21 +
w[2] * v31 +
w[3] * v41;
1835 uvco[0] =
w[0] * v10 +
w[1] * v20 +
w[2] * v30;
1836 uvco[1] =
w[0] * v11 +
w[1] * v21 +
w[2] * v31;
1842 const char *cp1, *cp2, *cp3, *cp4;
1846 cp1 = (
const char *)&mcol[0];
1847 cp2 = (
const char *)&mcol[1];
1848 cp3 = (
const char *)&mcol[2];
1851 cp4 = (
char *)&mcol[3];
1853 cp[0] = (int)(
w[0] * cp1[0] +
w[1] * cp2[0] +
w[2] * cp3[0] +
w[3] * cp4[0]);
1854 cp[1] = (int)(
w[0] * cp1[1] +
w[1] * cp2[1] +
w[2] * cp3[1] +
w[3] * cp4[1]);
1855 cp[2] = (int)(
w[0] * cp1[2] +
w[1] * cp2[2] +
w[2] * cp3[2] +
w[3] * cp4[2]);
1856 cp[3] = (int)(
w[0] * cp1[3] +
w[1] * cp2[3] +
w[2] * cp3[3] +
w[3] * cp4[3]);
1859 cp[0] = (int)(
w[0] * cp1[0] +
w[1] * cp2[0] +
w[2] * cp3[0]);
1860 cp[1] = (int)(
w[0] * cp1[1] +
w[1] * cp2[1] +
w[2] * cp3[1]);
1861 cp[2] = (int)(
w[0] * cp1[2] +
w[1] * cp2[2] +
w[2] * cp3[2]);
1862 cp[3] = (int)(
w[0] * cp1[3] +
w[1] * cp2[3] +
w[2] * cp3[3]);
1867 Mesh *
mesh,
short from,
int index,
const float fw[4],
const float *values)
1869 if (values == 0 || index == -1) {
1875 return values[index];
1880 values[mf->
v1], values[mf->
v2], values[mf->
v3], values[mf->
v4], fw, mf->
v4);
1889 uv[0] =
w[1] +
w[2];
1890 uv[1] =
w[2] +
w[3];
1896 float v[4][3], co[3];
1898 v[0][0] = osface->
uv[0][0];
1899 v[0][1] = osface->
uv[0][1];
1901 v[1][0] = osface->
uv[1][0];
1902 v[1][1] = osface->
uv[1][1];
1904 v[2][0] = osface->
uv[2][0];
1905 v[2][1] = osface->
uv[2][1];
1912 v[3][0] = osface->
uv[3][0];
1913 v[3][1] = osface->
uv[3][1];
1924 Mesh *mesh_original,
1929 MFace *mtessface_final;
1933 const float(*faceuv)[2];
1935 const int *index_mf_to_mpoly_deformed =
NULL;
1936 const int *index_mf_to_mpoly =
NULL;
1937 const int *index_mp_to_orig =
NULL;
1939 const int totface_final = mesh_final->
totface;
1940 const int totface_deformed = mesh_original ? mesh_original->
totface : totface_final;
1942 if (
ELEM(0, totface_final, totface_deformed)) {
1950 if (mesh_original) {
1955 index_mf_to_mpoly_deformed = index_mf_to_mpoly;
1959 pindex_orig = index_mf_to_mpoly_deformed[findex_orig];
1961 if (mesh_original ==
NULL) {
1962 mesh_original = mesh_final;
1965 index_mf_to_mpoly_deformed =
NULL;
1967 mtessface_final = mesh_final->
mface;
1970 if (osface_final ==
NULL) {
1972 if (findex_orig < totface_final) {
1977 printf(
"\tNO CD_ORIGSPACE, error out of range\n");
1980 if (findex_orig >= mesh_original->
totface) {
1988 LinkNode *tessface_node = poly_nodes[pindex_orig];
1990 for (; tessface_node; tessface_node = tessface_node->
next) {
1992 faceuv = osface_final[findex_dst].
uv;
1996 if (mtessface_final[findex_dst].v4) {
2007 for (
int findex_dst = 0; findex_dst < totface_final; findex_dst++) {
2012 faceuv = osface_final[findex_dst].
uv;
2016 if (mtessface_final[findex_dst].v4) {
2072 *mapindex = index_dmcache;
2076 int i = index_dmcache;
2089 if (osface ==
NULL) {
2090 mapfw[0] = mapfw[1] = mapfw[2] = mapfw[3] = 0.0f;
2113 float tmpnor[3], mapfw[4];
2114 const float(*orcodata)[3];
2118 mesh_final,
from, index, index_dmcache, fw, foffset, &mapindex, mapfw)) {
2120 vec[0] = vec[1] = vec[2] = 0.0;
2127 orco[0] = orco[1] = orco[2] = 0.0;
2130 utan[0] = utan[1] = utan[2] = 0.0;
2133 vtan[0] = vtan[1] = vtan[2] = 0.0;
2160 utan[0] = utan[1] = utan[2] = 0.0f;
2161 vtan[0] = vtan[1] = vtan[2] = 0.0f;
2169 mface = &mesh_final->
mface[mapindex];
2170 mvert = mesh_final->
mvert;
2171 mtface = mesh_final->
mtface;
2238 if (psmd->
psys == psys) {
2261 const float zerovec[3] = {0.0f, 0.0f, 0.0f};
2347 psmd->
mesh_final,
from, index, index_dmcache, fuv, foffset, vec,
nor, utan, vtan, orco);
2392 for (eff = effectors->
first; eff; eff = eff->
next) {
2399 "GuideEffectorData");
2430 float effect[3] = {0.0f, 0.0f, 0.0f}, veffect[3] = {0.0f, 0.0f, 0.0f};
2431 float guidevec[4], guidedir[3], rot2[4], temp[3];
2432 float guidetime, radius, weight,
angle, totstrength = 0.0f;
2433 float vec_to_point[3];
2436 for (eff = effectors->
first; eff; eff = eff->
next) {
2445 if (
data->strength <= 0.0f) {
2451 if (guidetime > 1.0f) {
2459 eff->
ob,
data->strength * guidetime, guidevec, guidedir,
NULL, &radius, &weight) ==
2478 if (guidetime != 0.0f) {
2497 (
int)(
data->strength * guidetime * 100.0f),
2515 const float par_co[3] = {0.0f, 0.0f, 0.0f};
2516 const float par_vel[3] = {0.0f, 0.0f, 0.0f};
2517 const float par_rot[4] = {1.0f, 0.0f, 0.0f, 0.0f};
2518 const float orco_offset[3] = {0.0f, 0.0f, 0.0f};
2552 totstrength +=
data->strength;
2555 totstrength *= weight;
2560 if (totstrength != 0.0f) {
2561 if (totstrength > 1.0f) {
2564 CLAMP(totstrength, 0.0f, 1.0f);
2588 float force[3] = {0.0f, 0.0f, 0.0f};
2659 else if (psys->
vgroup[vgroup]) {
2663 vg =
MEM_callocN(
sizeof(
float) * totvert,
"vg_cache");
2664 if (psys->
vg_neg & (1 << vgroup)) {
2665 for (i = 0; i < totvert; i++) {
2670 for (i = 0; i < totvert; i++) {
2686 float co[3], orco[3];
2688 totparent = (int)(totchild * part->
parents * 0.3f);
2699 tree = BLI_kdtree_3d_new(totparent);
2701 for (p = 0, cpa = sim->
psys->
child; p < totparent; p++, cpa++) {
2703 sim->
psmd,
from, cpa->
num,
DMCACHE_ISCHILD, cpa->
fuv, cpa->
foffset, co, 0, 0, 0, orco);
2720 BLI_kdtree_3d_insert(
tree, p, orco);
2724 BLI_kdtree_3d_balance(
tree);
2726 for (; p < totchild; p++, cpa++) {
2728 sim->
psmd,
from, cpa->
num,
DMCACHE_ISCHILD, cpa->
fuv, cpa->
foffset, co, 0, 0, 0, orco);
2732 BLI_kdtree_3d_free(
tree);
2739 const bool editupdate,
2740 const bool use_render_params)
2744 int totparent = 0, between = 0;
2754 if ((use_render_params == 0) &&
2763 totparent = (int)(totchild * part->
parents * 0.3f);
2773 if (use_render_params) {
2777 totchild = (int)((
float)totchild * (
float)part->
disp / 100.0f);
2780 totparent =
MIN2(totparent, totchild);
2782 if (totchild == 0) {
2866 float *cpa_fuv = 0, *par_rot = 0,
rot[4];
2867 float orco[3], hairmat[4][4], dvec[3], off1[4][3], off2[4][3];
2868 float eff_length, eff_vec[3], weight[4];
2879 float foffset, wsum = 0.0f;
2889 while (w < 4 && cpa->pa[
w] >= 0) {
2901 memset(child_keys, 0,
sizeof(*child_keys) * (ctx->
segments + 1));
2905 for (
w = 0;
w < 4;
w++) {
2906 if (cpa->
pa[
w] >= 0) {
2907 key[
w] = pcache[cpa->
pa[
w]];
2908 weight[
w] = cpa->
w[
w];
2919 for (
w = 0;
w < 4;
w++) {
2920 if (
w && (weight[
w] > 0.0f)) {
2926 float d1 =
len_v3v3(key[0]->co, key[
w]->co);
2929 d = d1 > 0.0f ? d2 / d1 - 1.0f : 10000.0f;
2941 if (p_max > p_min) {
2942 d = (d - p_min) / (p_max - p_min);
2945 d = (d - p_min) <= 0.0f ? 0.0f : 1.0f;
2948 CLAMP(d, 0.0f, 1.0f);
2951 weight[
w] *= (1.0f - d);
2956 for (
w = 0;
w < 4;
w++) {
2971 ctx->
sim.
psmd, cpa_from, cpa_num,
DMCACHE_ISCHILD, cpa->
fuv, foffset, co, 0, 0, 0, orco);
2975 for (
w = 0;
w < 4;
w++) {
2989 memset(child_keys, 0,
sizeof(*child_keys) * (ctx->
segments + 1));
2993 key[0] = pcache[cpa->
parent];
2996 cpa_from = part->
from;
3041 for (k = 0, child = child_keys; k <= ctx->
segments; k++, child++) {
3049 for (
w = 0;
w < 4;
w++) {
3083 par_rot = key[0]->
rot;
3099 for (k = 0, child = child_keys; k <= ctx->
segments; k++, child++) {
3115 eff_length =
len_v3(eff_vec);
3131 par = cache[cpa->
parent];
3134 else if (cpa->
parent >= 0) {
3136 par = pcache[cpa->
parent];
3141 if (cpa->
pa[k] >= 0) {
3143 par = pcache[cpa->
pa[k]];
3169 ctx, &modifiers, cpa, &ptex, orco, hairmat, child_keys, par, par_orco);
3177 if (i < ctx->totparent) {
3192 for (i =
task->begin; i < task->end; i++, cpa++) {
3200 const bool editupdate,
3201 const bool use_render_params)
3206 int numtasks_parent, numtasks_child;
3207 int i, totchild, totparent;
3237 for (i = 0; i < numtasks_parent; i++) {
3248 for (i = 0; i < numtasks_child; i++) {
3268 float *prev_tangent,
3271 float cosangle,
angle, tangent[3],
normal[3], q[4];
3287 cosangle =
dot_v3v3(tangent, prev_tangent);
3292 if (cosangle > 0.999999f) {
3326 float birthtime = 0.0, dietime = 0.0;
3327 float t,
time = 0.0, dfra = 1.0 ;
3328 float col[4] = {0.5f, 0.5f, 0.5f, 1.0f};
3329 float prev_tangent[3] = {0.0f, 0.0f, 0.0f}, hairmat[4][4];
3332 int segments = (int)
pow(2.0, (
double)((use_render_params) ? part->ren_step : part->draw_step));
3333 int totpart = psys->totpart;
3335 float *vg_effector =
NULL;
3336 float *vg_length =
NULL, pa_length = 1.0f;
3351 baked = psys->pointcache->mem_cache.first && psys->part->type !=
PART_HAIR;
3356 &psys->pathcachebufs, totpart, segments + 1);
3369 if (!psys->totchild) {
3382 if (!psys->totchild) {
3384 pa_length = ptex.length * (1.0f - part->randlength *
psys_frand(psys, psys->seed + p));
3391 pind.cache = baked ? psys->pointcache :
NULL;
3394 pind.mesh = hair_mesh;
3396 memset(cache[p], 0,
sizeof(*cache[p]) * (segments + 1));
3398 cache[p]->segments = segments;
3410 birthtime =
MAX2(pind.birthtime, part->path_start);
3411 dietime =
MIN2(pind.dietime, part->path_end);
3414 float tb = pind.birthtime;
3415 birthtime = tb + part->path_start * (pind.dietime - tb);
3416 dietime = tb + part->path_end * (pind.dietime - tb);
3419 if (birthtime >= dietime) {
3420 cache[p]->segments = -1;
3424 dietime = birthtime + pa_length * (dietime - birthtime);
3427 for (k = 0, ca = cache[p]; k <= segments; k++, ca++) {
3429 t = birthtime +
time * (dietime - birthtime);
3449 for (k = 0, hkey = pa->hair; k < pa->totkey; k++, hkey++) {
3459 float effector = 1.0f;
3462 psmd->mesh_final, psys->part->from, pa, vg_effector);
3465 sub_v3_v3v3(vec, (cache[p] + 1)->co, cache[p]->co);
3468 for (k = 1, ca = cache[p] + 1; k <= segments; k++, ca++) {
3470 sim, p, ca, k, segments, cache[p]->co, effector, dfra, cfra, &
length, vec);
3476 for (k = 0, ca = cache[p]; k <= segments; k++, ca++) {
3483 (
float)k / (
float)segments);
3488 if (psys->lattice_deform_data) {
3489 for (k = 0, ca = cache[p]; k <= segments; k++, ca++) {
3491 psys->lattice_deform_data, ca->
co, psys->lattice_strength);
3497 for (k = 1, ca = cache[p] + 1; k <= segments; k++, ca++) {
3500 if (k == segments) {
3523 psys->totcached = totpart;
3555 if (
point->totkey == 0) {
3564 const int segments = iter_data->
segments;
3565 const bool use_weight = iter_data->
use_weight;
3567 float birthtime = 0.0f, dietime = 0.0f;
3568 float hairmat[4][4], rotmat[3][3], prev_tangent[3] = {0.0f, 0.0f, 0.0f};
3585 memset(cache[iter], 0,
sizeof(*cache[iter]) * (segments + 1));
3602 if (birthtime >= dietime) {
3610 float t,
time = 0.0f, keytime = 0.0f;
3611 for (k = 0, ca = cache[iter]; k <= segments; k++, ca++) {
3613 t = birthtime +
time * (dietime - birthtime);
3626 if (k == segments) {
3639 ca->
vel[0] = ca->
vel[1] = 0.0f;
3651 if (
result.time < 0.0f) {
3659 while (pind.
hkey[1]->
time < real_t) {
3683 ca->
col[0] = 1.0f - keytime;
3689 ca->
col[0] = keytime;
3716 const bool use_render_params)
3726 int totpart = edit->
totpoint, recalc_set = 0;
3732 segments =
MAX2(segments, 4);
3753 iter_data.
edit = edit;
3796 float to_time = to->
time;
3817 static void triatomat(
float *
v1,
float *
v2,
float *v3,
const float (*uv)[2],
float mat[4][4])
3819 float det, w1, w2, d1[2], d2[2];
3821 memset(mat, 0,
sizeof(
float[4][4]));
3829 d1[0] = uv[1][0] - uv[0][0];
3830 d1[1] = uv[1][1] - uv[0][1];
3831 d2[0] = uv[2][0] - uv[0][0];
3832 d2[1] = uv[2][1] - uv[0][1];
3834 det = d2[0] * d1[1] - d2[1] * d1[0];
3841 mat[1][0] = w1 * (
v2[0] -
v1[0]) + w2 * (v3[0] -
v1[0]);
3842 mat[1][1] = w1 * (
v2[1] -
v1[1]) + w2 * (v3[1] -
v1[1]);
3843 mat[1][2] = w1 * (
v2[2] -
v1[2]) + w2 * (v3[2] -
v1[2]);
3847 mat[1][0] = mat[1][1] = mat[1][2] = 0.0f;
3863 const float(*orcodata)[3];
3906 psys_particle_on_dm(
mesh,
from, pa->
num, pa->
num_dmcache, pa->
fuv, pa->
foffset, vec, 0, 0, 0, 0);
3913 float vec[3], orco[3];
3917 mesh,
from, pa->
num, pa->
num_dmcache, pa->
fuv, pa->
foffset, vec, 0, 0, 0, orco);
3938 float facemat[4][4];
3961 name = (psys_orig !=
NULL) ? psys_orig->
name :
DATA_(
"ParticleSystem");
3965 for (; psys; psys = psys->
next) {
3974 if (psys_orig !=
NULL) {
4227 texco[0] = texco[0] * 2.0f - 1.0f;
4228 texco[1] = texco[1] * 2.0f - 1.0f;
4235 #define SET_PARTICLE_TEXTURE(type, pvalue, texfac) \
4236 if ((event & mtex->mapto) & type) { \
4237 pvalue = texture_value_blend(def, pvalue, value, texfac, blend); \
4241 #define CLAMP_PARTICLE_TEXTURE_POS(type, pvalue) \
4242 if (event & type) { \
4243 CLAMP(pvalue, 0.0f, 1.0f); \
4247 #define CLAMP_WARP_PARTICLE_TEXTURE_POS(type, pvalue) \
4248 if (event & type) { \
4249 if (pvalue < 0.0f) { \
4250 pvalue = 1.0f + pvalue; \
4252 CLAMP(pvalue, 0.0f, 1.0f); \
4256 #define CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue) \
4257 if (event & type) { \
4258 CLAMP(pvalue, -1.0f, 1.0f); \
4276 float value,
rgba[4], texvec[3];
4286 for (m = 0; m <
MAX_MTEX; m++, mtexp++) {
4288 if (mtex && mtex->
tex && mtex->
mapto) {
4291 short texco = mtex->
texco;
4326 texvec[0] = 2.0f * (cfra - par->
time) / (par->
dietime - par->
time) - 1.0f;
4361 MTex **mtexp = part->mtex;
4364 float value,
rgba[4], co[3], texvec[3];
4375 for (m = 0; m <
MAX_MTEX; m++, mtexp++) {
4377 if (mtex && mtex->tex && mtex->mapto) {
4378 float def = mtex->def_var;
4379 short blend = mtex->blendtype;
4380 short texco = mtex->texco;
4424 if (me->
size[0] != 0.0f) {
4425 texvec[0] /= me->
size[0];
4427 if (me->
size[1] != 0.0f) {
4428 texvec[1] /= me->
size[1];
4430 if (me->
size[2] != 0.0f) {
4431 texvec[2] /= me->
size[2];
4436 texvec[0] = 2.0f * (cfra - pa->
time) / (pa->
dietime - pa->
time) - 1.0f;
4453 int flip = (mtex->timefac < 0.0f);
4454 float timefac =
fabsf(mtex->timefac);
4455 ptex->
time *= 1.0f - timefac;
4456 ptex->
time += timefac * ((flip) ? 1.0f - value : value);
4503 while (w < 4 && cpa->pa[
w] >= 0) {
4521 *dietime =
time + life;
4524 return (cfra -
time) / life;
4537 while (w < 4 && cpa->pa[
w] >= 0) {
4564 int i = cpa - psys->
child;
4592 ctx->
mesh, cpa_from, cpa_num, cpa_fuv, ctx->
vg_kink);
4632 float co[3], orco[3];
4633 float hairmat[4][4];
4636 short between = 0, edit = 0;
4700 else if (totchild) {
4712 float par_co[3], par_orco[3];
4714 cpa = psys->
child + p - totpart;
4716 if (
state->time < 0.0f) {
4729 while (w < 4 && cpa->pa[
w] >= 0) {
4730 keys[
w].time =
state->time;
4743 psmd, cpa_from, cpa_num,
DMCACHE_ISCHILD, cpa->
fuv, foffset, co, 0, 0, 0, orco);
4781 cpa_from = part->
from;
4798 psmd, cpa_from, cpa_num,
DMCACHE_ISCHILD, cpa_fuv, pa->
foffset, co, 0, 0, 0, orco);
4810 ctx.
mesh = psmd->mesh_final;
4822 while (w < 4 && cpa->pa[
w] >= 0) {
4823 state->co[0] += cpa->
w[
w] * keys[
w].co[0];
4824 state->co[1] += cpa->
w[
w] * keys[
w].co[1];
4825 state->co[2] += cpa->
w[
w] * keys[
w].co[2];
4827 state->vel[0] += cpa->
w[
w] * keys[
w].vel[0];
4828 state->vel[1] += cpa->
w[
w] * keys[
w].vel[1];
4829 state->vel[2] += cpa->
w[
w] * keys[
w].vel[2];
4849 modifier_ctx.
sim = sim;
4850 modifier_ctx.
ptex = &ptex;
4851 modifier_ctx.
cpa = cpa;
4852 modifier_ctx.
orco = orco;
4866 tstate_tmp.
time =
t - 0.001f;
4872 tstate_tmp.
time =
t + 0.001f;
4910 cpa = psys->
child + p - totpart;
4947 state->time = -cfra;
4956 const float par_orco[3] = {0.0f, 0.0f, 0.0f};
4966 modifier_ctx.
sim = sim;
4968 modifier_ctx.
cpa = cpa;
4970 modifier_ctx.
par_co = key1->co;
4971 modifier_ctx.
par_vel = key1->vel;
4972 modifier_ctx.
par_rot = key1->rot;
4987 else if (pa->prev_state.time == cfra) {
4993 if (pa->state.time + 2.0f >=
state->time && pa->prev_state.time - 2.0f <=
state->time) {
4994 if (pa->prev_state.time >= pa->state.time || pa->prev_state.time < 0.0f) {
4997 dfra =
state->time - pa->state.time;
5010 dfra = keys[2].
time - keys[1].
time;
5012 keytime = (
state->time - keys[1].
time) / dfra;
5015 mul_v3_fl(keys[1].vel, dfra * timestep);
5016 mul_v3_fl(keys[2].vel, dfra * timestep);
5027 else if (pa->state.time + 1.0f >=
state->time && pa->state.time - 1.0f <=
state->time) {
5030 dfra =
state->time - pa->state.time;
5071 uv[0] = uv[1] = 0.0f;
5084 if (mtface !=
NULL) {
5136 psmd, part->
from, pa->
num, pa->
num_dmcache, pa->
fuv, pa->
foffset, loc, 0, 0, 0, orco);
5149 float loc[3],
nor[3], vec[3], side[3],
len;
5150 float xvec[3] = {-1.0, 0.0, 0.0}, nmat[3][3];
5248 float hairmat[4][4], imat[4][4];
5250 for (p = 0; p < psys->
totpart; p++, pa++) {
5255 for (h = 0; h < pa->
totkey; h++, hkey++) {
5298 for (
int a = 0;
a < psys->
totpart;
a++, pa++) {
5340 for (
a = 0, pa = psys->
particles; a < psys->totpart;
a++, pa++) {
5346 for (
a = 0, pa = psys->
particles; a < psys->totpart;
a++, pa++) {
5361 for (
a = 1, pa++;
a < psys->
totpart;
a++, pa++) {
5362 pa->
boid = (pa - 1)->boid + 1;
5367 for (
a = 0, pa = psys->
particles; a < psys->totpart;
a++, pa++) {
typedef float(TangentPoint)[2]
void BKE_animdata_blend_read_data(struct BlendDataReader *reader, struct AnimData *adt)
void BKE_animdata_blend_write(struct BlendWriter *writer, struct AnimData *adt)
bool BKE_where_on_path(const struct Object *ob, float ctime, float r_vec[4], float r_dir[3], float r_quat[4], float *r_radius, float *r_weight)
struct BoidSettings * boid_copy_settings(const struct BoidSettings *boids)
void boid_free_settings(struct BoidSettings *boids)
void cloth_free_modifier(struct ClothModifierData *clmd)
struct ListBase BKE_collection_object_cache_get(struct Collection *collection)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
bool BKE_collection_has_object_recursive(struct Collection *collection, struct Object *ob)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
void * CustomData_get_layer_named(const struct CustomData *data, int type, const char *name)
void * CustomData_get_layer_n(const struct CustomData *data, int type, int n)
void * CustomData_get_layer(const struct CustomData *data, int type)
void * CustomData_get(const struct CustomData *data, int index, int type)
int CustomData_get_render_layer(const struct CustomData *data, int type)
display list (or rather multi purpose list) stuff.
float BKE_displist_calc_taper(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *taperobj, int cur, int tot)
void BKE_partdeflect_free(struct PartDeflect *pd)
float effector_falloff(struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, struct EffectorWeights *weights)
struct PartDeflect * BKE_partdeflect_new(int type)
void BKE_effectors_free(struct ListBase *lb)
void BKE_effectors_apply(struct ListBase *effectors, struct ListBase *colliders, struct EffectorWeights *weights, struct EffectedPoint *point, float *force, float *wind_force, float *impulse)
struct PartDeflect * BKE_partdeflect_copy(const struct PartDeflect *pd_src)
struct EffectorWeights * BKE_effector_add_weights(struct Collection *collection)
void pd_point_from_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, struct EffectedPoint *point)
void key_curve_position_weights(float t, float data[4], int type)
void BKE_lattice_deform_data_destroy(struct LatticeDeformData *lattice_deform_data)
void BKE_lattice_deform_data_eval_co(struct LatticeDeformData *lattice_deform_data, float co[3], float weight)
struct LatticeDeformData * BKE_lattice_deform_data_create(const struct Object *oblatt, const struct Object *ob) ATTR_WARN_UNUSED_RESULT
void id_us_min(struct ID *id)
void BKE_id_free(struct Main *bmain, void *idv)
void id_us_plus(struct ID *id)
void BKE_id_blend_write(struct BlendWriter *writer, struct ID *id)
void * BKE_id_new(struct Main *bmain, short type, const char *name)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(_data, _id_super, _cb_flag)
#define BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(_data, _func_call)
General operations, lookup, etc. for materials.
struct Material * BKE_object_material_get(struct Object *ob, short act)
const float(* BKE_mesh_vertex_normals_ensure(const struct Mesh *mesh))[3]
void BKE_mesh_orco_verts_transform(struct Mesh *me, float(*orco)[3], int totvert, int invert)
void BKE_mesh_texspace_ensure(struct Mesh *me)
void BKE_mesh_tessface_ensure(struct Mesh *mesh)
BLI_INLINE int BKE_mesh_origindex_mface_mpoly(const int *index_mf_to_mpoly, const int *index_mp_to_orig, const int i)
void BKE_modifier_free(struct ModifierData *md)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
void BKE_modifier_remove_from_list(struct Object *ob, struct ModifierData *md)
struct ModifierData * BKE_modifier_new(int type)
bool BKE_modifier_unique_name(struct ListBase *modifiers, struct ModifierData *md)
General operations, lookup, etc. for blender objects.
void BKE_object_modifier_set_active(struct Object *ob, struct ModifierData *md)
void psys_thread_context_init(struct ParticleThreadContext *ctx, struct ParticleSimulationData *sim)
void psys_tasks_free(struct ParticleTask *tasks, int numtasks)
#define LOOP_SHOWN_PARTICLES
void psys_apply_child_modifiers(struct ParticleThreadContext *ctx, struct ListBase *modifiers, struct ChildParticle *cpa, struct ParticleTexture *ptex, const float orco[3], float hairmat[4][4], struct ParticleCacheKey *keys, struct ParticleCacheKey *parent_keys, const float parent_orco[3])
void psys_tasks_create(struct ParticleThreadContext *ctx, int startpart, int endpart, struct ParticleTask **r_tasks, int *r_numtasks)
void psys_thread_context_free(struct ParticleThreadContext *ctx)
void psys_unique_name(struct Object *object, struct ParticleSystem *psys, const char *defname)
BLI_INLINE float psys_frand(ParticleSystem *psys, unsigned int seed)
void BKE_ptcache_id_from_particles(PTCacheID *pid, struct Object *ob, struct ParticleSystem *psys)
void BKE_ptcache_id_clear(PTCacheID *id, int mode, unsigned int cfra)
#define PTCACHE_CLEAR_ALL
void BKE_ptcache_blend_read_data(struct BlendDataReader *reader, struct ListBase *ptcaches, struct PointCache **ocache, int force_disk)
struct PointCache * BKE_ptcache_add(struct ListBase *ptcaches)
int BKE_ptcache_mem_index_find(struct PTCacheMem *pm, unsigned int index)
void BKE_ptcache_make_particle_key(struct ParticleKey *key, int index, void **data, float time)
void BKE_ptcache_free_list(struct ListBase *ptcaches)
void BKE_ptcache_blend_write(struct BlendWriter *writer, struct ListBase *ptcaches)
float BKE_scene_frame_to_ctime(const struct Scene *scene, int frame)
void BKE_texture_mtex_foreach_id(struct LibraryForeachIDData *data, struct MTex *mtex)
void BLI_bvhtree_free(BVHTree *tree)
A KD-tree for nearest neighbor search.
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void void void void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src) ATTR_NONNULL(1
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float saacos(float fac)
MINLINE int max_ii(int a, int b)
int isect_point_quad_v2(const float p[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2])
float normal_quad_v3(float n[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
void interp_cubic_v3(float x[3], float v[3], const float x1[3], const float v1[3], const float x2[3], const float v2[3], float t)
void map_to_sphere(float *r_u, float *r_v, float x, float y, float z)
int isect_point_tri_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2])
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
void interp_weights_poly_v3(float w[], float v[][3], int n, const float co[3])
void mul_m3_v3(const float M[3][3], float r[3])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void unit_m4(float m[4][4])
void mul_mat3_m4_v3(const float M[4][4], float r[3])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
void transpose_m3_m4(float R[3][3], const float M[4][4])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
void transpose_m4(float R[4][4])
void interp_qt_qtqt(float q[4], const float a[4], const float b[4], float t)
void axis_angle_to_quat(float r[4], const float axis[3], float angle)
void mul_qt_v3(const float q[4], float r[3])
void mul_qt_qtqt(float q[4], const float a[4], const float b[4])
void mat3_to_quat_is_ok(float q[4], const float mat[3][3])
void copy_qt_qt(float q[4], const float a[4])
void quat_to_mat4(float mat[4][4], const float q[4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t)
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
void interp_v3_v3v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3], const float w[4])
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void int BLI_rng_get_int(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
struct RNG * BLI_rng_new(unsigned int seed)
struct RNG * BLI_rng_new_srandom(unsigned int seed)
float BLI_rng_get_float(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
void BLI_task_pool_work_and_wait(TaskPool *pool)
void BLI_task_parallel_range(int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
TaskPool * BLI_task_pool_create(void *userdata, eTaskPriority priority)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
void BLI_task_pool_free(TaskPool *pool)
void BLI_task_pool_push(TaskPool *pool, TaskRunFunction run, void *taskdata, bool free_taskdata, TaskFreeFunction freedata)
#define POINTER_AS_INT(i)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
#define BLO_read_data_address(reader, ptr_p)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
#define BLO_write_struct(writer, struct_name, data_ptr)
void BLO_read_list(BlendDataReader *reader, struct ListBase *list)
#define BLO_read_id_address(reader, lib, id_ptr_p)
#define BLO_write_struct_array(writer, struct_name, array_size, data_ptr)
#define BLO_expand(expander, id)
#define BLT_I18NCONTEXT_ID_PARTICLESETTINGS
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
float DEG_get_ctime(const Depsgraph *graph)
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
struct ViewLayer * DEG_get_input_view_layer(const Depsgraph *graph)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
@ ID_RECALC_COPY_ON_WRITE
@ eBoidRuleType_FollowLeader
@ eBoidRuleType_AvoidCollision
@ eBoidRuleType_AverageSpeed
Object groups, one object can be in many groups at once.
#define CD_MASK_ORIGINDEX
#define CD_MASK_MDEFORMVERT
#define CD_MASK_ORIGSPACE_MLOOP
#define DNA_struct_default_get(struct_name)
@ FLUID_DOMAIN_PARTICLE_SPRAY
@ FLUID_DOMAIN_PARTICLE_FOAM
@ FLUID_DOMAIN_PARTICLE_TRACER
@ FLUID_DOMAIN_PARTICLE_FLIP
@ FLUID_DOMAIN_PARTICLE_BUBBLE
@ SNDPARTICLE_COMBINED_EXPORT_OFF
@ eModifierType_ParticleSystem
@ eModifierType_DynamicPaint
#define PFIELD_GUIDE_PATH_ADD
#define PFIELD_GUIDE_PATH_WEIGHT
#define PART_DRAW_COL_MAT
#define PART_CHILD_EFFECT
#define SPH_VISCOELASTIC_SPRINGS
struct ParticleSettings ParticleSettings
#define PSYS_HAIR_DYNAMICS
#define PART_HAIR_BSPLINE
@ PART_FLUID_SPRAYFOAMBUBBLE
#define PSYS_SHARED_CACHES
#define PART_CHILD_LONG_HAIR
#define PART_DUPLIW_CURRENT
@ PART_CHILD_USE_TWIST_CURVE
@ PART_CHILD_USE_CLUMP_CURVE
@ PART_CHILD_USE_CLUMP_NOISE
@ PART_CHILD_USE_ROUGH_CURVE
#define PSYS_KEYED_TIMING
#define PHYS_GLOBAL_GRAVITY
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
static void init_data(ModifierData *md)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
static unsigned long seed
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
const Depsgraph * depsgraph
SyclQueue void void size_t num_bytes void
flat(Type::INT, "resource_index")
IconTextureDrawCall normal
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float3 pow(float3 v, float e)
struct blender::compositor::@179::@181 task
T length(const vec_base< T, Size > &a)
static const pxr::TfToken rgba("rgba", pxr::TfToken::Immortal)
void BKE_particle_batch_cache_dirty_tag(ParticleSystem *psys, int mode)
void BKE_particlesettings_clump_curve_init(ParticleSettings *part)
ParticleSystemModifierData * psys_get_modifier(Object *ob, ParticleSystem *psys)
static PTCacheEdit * psys_orig_edit_get(ParticleSystem *psys)
static void psys_free_path_cache_buffers(ParticleCacheKey **cache, ListBase *bufs)
void BKE_particle_system_blend_read_data(BlendDataReader *reader, ListBase *particles)
void psys_particle_on_emitter(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 free_hair(Object *object, ParticleSystem *psys, int dynamics)
static void psys_w_to_origspace(const float w[4], float uv[2])
void psys_free_particles(ParticleSystem *psys)
int psys_particle_dm_face_lookup(Mesh *mesh_final, Mesh *mesh_original, int findex_orig, const float fw[4], struct LinkNode **poly_nodes)
static ParticleCacheKey * pcache_key_segment_endpoint_safe(ParticleCacheKey *key)
float psys_get_timestep(ParticleSimulationData *sim)
float psys_get_child_time(ParticleSystem *psys, ChildParticle *cpa, float cfra, float *birthtime, float *dietime)
static void particle_settings_blend_read_data(BlendDataReader *reader, ID *id)
static int psys_map_index_on_dm(Mesh *mesh, int from, int index, int index_dmcache, const float fw[4], float UNUSED(foffset), int *mapindex, float mapfw[4])
void precalc_guides(ParticleSimulationData *sim, ListBase *effectors)
#define CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue)
static void exec_child_path_cache(TaskPool *__restrict UNUSED(pool), void *taskdata)
static void particle_settings_init(ID *id)
void BKE_particle_system_blend_write(BlendWriter *writer, ListBase *particles)
struct ParticleInterpolationData ParticleInterpolationData
void object_remove_particle_system(Main *bmain, Scene *UNUSED(scene), Object *ob, ParticleSystem *psys)
static void particle_settings_blend_read_expand(BlendExpander *expander, ID *id)
static int get_pointcache_times_for_particle(PointCache *cache, int index, float *r_start, float *r_dietime)
static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float *UNUSED(fuv), float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3])
void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, ParticleKey *result, bool velocity)
static void mvert_to_particle(ParticleKey *key, MVert *mvert, HairKey *hkey)
void psys_sim_data_init(ParticleSimulationData *sim)
static void particle_settings_blend_read_lib(BlendLibReader *reader, ID *id)
void copy_particle_key(ParticleKey *to, ParticleKey *from, int time)
void psys_free(Object *ob, ParticleSystem *psys)
void psys_interpolate_mcol(const MCol *mcol, int quad, const float w[4], MCol *mc)
float PSYS_FRAND_BASE[PSYS_FRAND_COUNT]
void psys_interpolate_uvs(const MTFace *tface, int quad, const float w[4], float uvco[2])
void psys_enable_all(Object *ob)
void BKE_particle_partdeflect_blend_read_data(BlendDataReader *UNUSED(reader), PartDeflect *pd)
static float interpolate_particle_value(float v1, float v2, float v3, float v4, const float w[4], int four)
static int get_particle_uv(Mesh *mesh, ParticleData *pa, int index, const float fuv[4], char *name, float *texco, bool from_vert)
static void init_particle_interpolation(Object *ob, ParticleSystem *psys, ParticleData *pa, ParticleInterpolationData *pind)
ParticleSystem * psys_get_current(Object *ob)
void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *state, const bool vel)
static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheKey *ca, int k, int steps, float *UNUSED(rootco), float effector, float UNUSED(dfra), float UNUSED(cfra), float *length, float *vec)
static void get_pointcache_keys_for_time(Object *UNUSED(ob), PointCache *cache, PTCacheMem **cur, int index, float t, ParticleKey *key1, ParticleKey *key2)
static void edit_to_particle(ParticleKey *key, PTCacheEditKey *ekey)
static void psys_cache_edit_paths_iter(void *__restrict iter_data_v, const int iter, const TaskParallelTLS *__restrict UNUSED(tls))
void BKE_particlesettings_rough_curve_init(ParticleSettings *part)
static void offset_child(ChildParticle *cpa, ParticleKey *par, float *par_rot, ParticleKey *child, float flat, float radius)
void psys_mat_hair_to_global(Object *ob, Mesh *mesh, short from, ParticleData *pa, float hairmat[4][4])
void psys_emitter_customdata_mask(ParticleSystem *psys, CustomData_MeshMasks *r_cddata_masks)
static void get_cpa_texture(Mesh *mesh, ParticleSystem *psys, ParticleSettings *part, ParticleData *par, int child_index, int face_index, const float fw[4], float *orco, ParticleTexture *ptex, int event, float cfra)
#define CLAMP_WARP_PARTICLE_TEXTURE_POS(type, pvalue)
void psys_free_children(ParticleSystem *psys)
void BKE_particle_system_blend_read_lib(BlendLibReader *reader, Object *ob, ID *id, ListBase *particles)
bool psys_check_edited(ParticleSystem *psys)
ParticleSettings * BKE_particlesettings_add(Main *bmain, const char *name)
void psys_mat_hair_to_object(Object *UNUSED(ob), Mesh *mesh, short from, ParticleData *pa, float hairmat[4][4])
static ParticleCacheKey ** psys_alloc_path_cache_buffers(ListBase *bufs, int tot, int totkeys)
unsigned int PSYS_FRAND_SEED_MULTIPLIER[PSYS_FRAND_COUNT]
void psys_sim_data_free(ParticleSimulationData *sim)
static void interpolate_pathcache(ParticleCacheKey *first, float t, ParticleCacheKey *result)
static float psys_interpolate_value_from_verts(Mesh *mesh, short from, int index, const float fw[4], const float *values)
void psys_check_group_weights(ParticleSettings *part)
void psys_apply_hair_lattice(Depsgraph *depsgraph, Scene *scene, Object *ob, ParticleSystem *psys)
float * psys_cache_vgroup(Mesh *mesh, ParticleSystem *psys, int vgroup)
void psys_cache_child_paths(ParticleSimulationData *sim, float cfra, const bool editupdate, const bool use_render_params)
void psys_mat_hair_to_orco(Object *ob, Mesh *mesh, short from, ParticleData *pa, float hairmat[4][4])
void psys_find_parents(ParticleSimulationData *sim, const bool use_render_params)
void psys_free_path_cache(ParticleSystem *psys, PTCacheEdit *edit)
static void hair_to_particle(ParticleKey *key, HairKey *hkey)
static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData *pa, float t, ParticleInterpolationData *pind, ParticleKey *result)
void(* BKE_particle_batch_cache_free_cb)(ParticleSystem *psys)
ModifierData * object_add_particle_system(Main *bmain, Scene *scene, Object *ob, const char *name)
static void triatomat(float *v1, float *v2, float *v3, const float(*uv)[2], float mat[4][4])
bool psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *state, const bool always)
static void particle_settings_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int UNUSED(flag))
void(* BKE_particle_batch_cache_dirty_tag_cb)(ParticleSystem *psys, int mode)
void psys_set_current_num(Object *ob, int index)
void psys_free_pdd(ParticleSystem *psys)
int psys_uses_gravity(ParticleSimulationData *sim)
static void free_child_path_cache(ParticleSystem *psys)
static void fluid_free_settings(SPHFluidSettings *fluid)
void psys_copy_particles(ParticleSystem *psys_dst, ParticleSystem *psys_src)
static void psys_origspace_to_w(OrigSpaceFace *osface, int quad, const float w[4], float neww[4])
ModifierData * object_copy_particle_system(Main *bmain, Scene *scene, Object *ob, const ParticleSystem *psys_orig)
float psys_get_dietime_from_cache(PointCache *cache, int index)
static void cache_key_incremental_rotation(ParticleCacheKey *key0, ParticleCacheKey *key1, ParticleCacheKey *key2, float *prev_tangent, int i)
static void particle_settings_free_data(ID *id)
unsigned int PSYS_FRAND_SEED_OFFSET[PSYS_FRAND_COUNT]
void psys_get_dupli_texture(ParticleSystem *psys, ParticleSettings *part, ParticleSystemModifierData *psmd, ParticleData *pa, ChildParticle *cpa, float uv[2], float orco[3])
void psys_interpolate_face(Mesh *mesh, MVert *mvert, const float(*vert_normals)[3], MFace *mface, MTFace *tface, const float(*orcodata)[3], float w[4], float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3])
float psys_get_child_size(ParticleSystem *psys, ChildParticle *cpa, float UNUSED(cfra), float *UNUSED(pa_time))
short psys_get_current_num(Object *ob)
bool psys_check_enabled(Object *ob, ParticleSystem *psys, const bool use_render_params)
void BKE_particle_init_rng(void)
void psys_get_from_key(ParticleKey *key, float loc[3], float vel[3], float rot[4], float *time)
#define CLAMP_PARTICLE_TEXTURE_POS(type, pvalue)
void psys_vec_rot_to_face(Mesh *mesh, ParticleData *pa, float vec[3])
static void particle_settings_blend_write(BlendWriter *writer, ID *id, const void *id_address)
void BKE_particle_batch_cache_free(ParticleSystem *psys)
void free_keyed_keys(ParticleSystem *psys)
void psys_cache_paths(ParticleSimulationData *sim, float cfra, const bool use_render_params)
bool do_guides(Depsgraph *depsgraph, ParticleSettings *part, ListBase *effectors, ParticleKey *state, int index, float time)
static void get_child_modifier_parameters(ParticleSettings *part, ParticleThreadContext *ctx, ChildParticle *cpa, short cpa_from, int cpa_num, float *cpa_fuv, float *orco, ParticleTexture *ptex)
void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa, ChildParticle *cpa, ParticleCacheKey *cache, float mat[4][4], float *scale)
struct ParticleSystem * psys_eval_get(Depsgraph *depsgraph, Object *object, ParticleSystem *psys)
void psys_find_group_weights(ParticleSettings *part)
int count_particles_mod(ParticleSystem *psys, int totgr, int cur)
#define PATH_CACHE_BUF_SIZE
void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTexture *ptex, int event, float cfra)
void BKE_particle_partdeflect_blend_read_lib(BlendLibReader *reader, ID *id, PartDeflect *pd)
void psys_cache_edit_paths(Depsgraph *depsgraph, Scene *scene, Object *ob, PTCacheEdit *edit, float cfra, const bool use_render_params)
static ModifierData * object_add_or_copy_particle_system(Main *bmain, Scene *scene, Object *ob, const char *name, const ParticleSystem *psys_orig)
float psys_particle_value_from_verts(Mesh *mesh, short from, ParticleData *pa, float *values)
static bool psys_thread_context_init_path(ParticleThreadContext *ctx, ParticleSimulationData *sim, Scene *scene, float cfra, const bool editupdate, const bool use_render_params)
void psys_disable_all(Object *ob)
static void write_boid_state(BlendWriter *writer, BoidState *state)
void psys_particle_on_dm(Mesh *mesh_final, int from, int index, int index_dmcache, const float fw[4], float foffset, float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3])
static void psys_face_mat(Object *ob, Mesh *mesh, ParticleData *pa, float mat[4][4], int orco)
ParticleSystem * psys_orig_get(ParticleSystem *psys)
struct CacheEditrPathsIterData CacheEditrPathsIterData
bool psys_in_edit_mode(Depsgraph *depsgraph, const ParticleSystem *psys)
static void particle_settings_foreach_id(ID *id, LibraryForeachIDData *data)
#define SET_PARTICLE_TEXTURE(type, pvalue, texfac)
int count_particles(ParticleSystem *psys)
void BKE_particlesettings_twist_curve_init(ParticleSettings *part)
static void psys_task_init_path(ParticleTask *task, ParticleSimulationData *sim)
static void psys_thread_create_path(ParticleTask *task, struct ChildParticle *cpa, ParticleCacheKey *child_keys, int i)
void do_kink(ParticleKey *state, const float par_co[3], const float par_vel[3], const float par_rot[4], float time, float freq, float shape, float amplitude, float flat, short type, short axis, float obmat[4][4], int smooth_start)
float do_clump(ParticleKey *state, const float par_co[3], float time, const float orco_offset[3], float clumpfac, float clumppow, float pa_clump, bool use_clump_noise, float clump_noise_size, CurveMapping *clumpcurve)
void do_child_modifiers(const ParticleChildModifierContext *modifier_ctx, float mat[4][4], ParticleKey *state, float t)
ParticleSystemModifierData * psmd
struct Collection * group
struct ClothSolverResult * solver_result
struct ClothHairData * hairdata
struct Cloth * clothObject
struct PointCache * point_cache
struct ClothSimSettings * sim_parms
struct ClothCollSettings * coll_parms
struct EffectorWeights * effector_weights
struct ParticleSystem * psys
struct DynamicPaintBrushSettings * brush
struct GuideEffectorData * guide_data
struct EffectorCache * next
struct Collection * group
char sndparticle_combined_export
struct ParticleSystem * psys
struct FluidDomainSettings * domain
struct FluidFlowSettings * flow
struct MDeformVert * dvert
struct ModifierData * next
struct ParticleCacheKey ** pathcache
PTCacheEditPoint * points
struct ParticleSystem * psys
struct ParticleSystemModifierData * psmd_eval
ParticleThreadContext * thread_ctx
ParticleCacheKey * parent_keys
ParticleSimulationData * sim
struct ParticleDupliWeight * next
PTCacheEditPoint * epoint
struct CurveMapping * clumpcurve
struct Collection * collision_group
struct Collection * instance_collection
struct CurveMapping * roughcurve
struct CurveMapping * twistcurve
struct BoidSettings * boids
struct EffectorWeights * effector_weights
struct ListBase instance_weights
struct Object * instance_object
struct SPHFluidSettings * fluid
struct Depsgraph * depsgraph
struct ParticleSystemModifierData * psmd
struct ParticleSystem * psys
struct ListBase * colliders
struct ParticleSystem * psys
ParticleSpring * fluid_springs
struct PTCacheEdit * edit
struct ListBase * effectors
struct ParticleSystem * next
struct PointCache * pointcache
struct ClothModifierData * clmd
struct Object * target_ob
struct LatticeDeformData * lattice_deform_data
struct ParticleCacheKey ** childcache
struct Mesh * hair_in_mesh
struct ParticleSystem * orig_psys
struct Mesh * hair_out_mesh
struct ParticleDrawData * pdd
struct ParticleCacheKey ** pathcache
void(* free_edit)(struct PTCacheEdit *edit)
struct ParticleTarget * prev
struct ParticleTarget * next
struct CurveMapping * roughcurve
struct CurveMapping * twistcurve
struct CurveMapping * clumpcurve
struct ParticleSimulationData sim
struct ListBase mem_cache
struct PTCacheEdit * edit
struct PhysicsSettings physics_settings
struct ToolSettings * toolsettings
bool RE_texture_evaluate(const MTex *mtex, const float vec[3], const int thread, struct ImagePool *pool, const bool skip_load_image, const bool texnode_preview, float *r_intensity, float r_rgba[4])
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)
float texture_value_blend(float tex, float out, float fact, float facg, int blendtype)