25 #define DNA_DEPRECATED_ALLOW
133 if (partticle_settings_src->
mtex[
a]) {
179 for (
int i = 0; i <
MAX_MTEX; i++) {
180 if (psett->
mtex[i]) {
223 switch (rule->type) {
246 BoidCondition *cond =
state->conditions.first;
247 for (; cond; cond = cond->next) {
280 if (dw->ob !=
NULL) {
284 if (
object == dw->ob) {
386 reader, part->
id.
lib, &part->ipo);
416 switch (rule->type) {
496 .name =
"ParticleSettings",
497 .name_plural =
"particles",
506 .foreach_cache =
NULL,
514 .blend_read_undo_preserve =
NULL,
516 .lib_override_apply_post =
NULL,
585 else if (p % totgr == cur) {
594 #define PATH_CACHE_BUF_SIZE 1024
605 int i, totkey, totbufkey;
609 cache =
MEM_callocN(tot *
sizeof(
void *),
"PathCacheArray");
611 while (totkey < tot) {
616 for (i = 0; i < totbufkey; i++) {
635 for (buf = bufs->
first; buf; buf = buf->
next) {
706 for (; md; md = md->
next) {
708 if (md->
mode & mode) {
722 return lattice_deform_data;
728 for (; psys; psys = psys->
next) {
736 for (; psys; psys = psys->
next) {
752 if (object_eval ==
object) {
756 while (psys_eval !=
NULL) {
760 psys_eval = psys_eval->
next;
803 if (use_render_params) {
836 if (dw->ob ==
NULL) {
875 while (dw && dw->
ob !=
object) {
1130 BLI_kdtree_3d_free(psys->
tree);
1198 float v1,
float v2,
float v3,
float v4,
const float w[4],
int four)
1202 value =
w[0] *
v1 +
w[1] *
v2 +
w[2] * v3;
1207 CLAMP(value, 0.0f, 1.0f);
1283 *cur = (*cur)->
next;
1288 while (*cur && (*cur)->
next && (
float)(*cur)->
frame <
t) {
1289 *cur = (*cur)->
next;
1329 *r_start = pm->
frame;
1338 *r_dietime = pm->
frame + 1;
1350 int dietime = 10000000;
1355 dietime = pm->
frame + 1;
1360 return (
float)dietime;
1378 else if (pind->
keyed) {
1380 pind->
kkey[0] = key;
1386 else if (pind->
cache) {
1387 float start = 0.0f, dietime = 0.0f;
1399 pind->
hkey[0] = key;
1400 pind->
hkey[1] = key + 1;
1440 int point_vel = (point && point->
keys->
vel);
1441 float real_t, dfra, keytime, invdt = 1.0f;
1444 memset(keys, 0,
sizeof(keys));
1448 if (
result->time < 0.0f) {
1456 while (*(pind->
ekey[1]->
time) < real_t) {
1462 else if (pind->
keyed) {
1469 if (
result->time < 0.0f) {
1482 while (pt && pa->
time + pt->
time < real_t) {
1500 while (pind->
kkey[1]->
time < real_t) {
1506 else if (pind->
cache) {
1507 if (
result->time < 0.0f) {
1515 if (
result->time < 0.0f) {
1523 while (pind->
hkey[1]->
time < real_t) {
1536 else if (pind->
mesh) {
1541 else if (pind->
keyed) {
1545 else if (pind->
cache) {
1554 if (!pind->
keyed && !pind->
cache && !point_vel) {
1556 if (pind->
ekey[0] != point->
keys) {
1563 else if (pind->
mesh) {
1588 else if (pind->
mesh) {
1606 dfra = keys[2].
time - keys[1].
time;
1607 keytime = (real_t - keys[1].
time) / dfra;
1610 if (pind->
keyed || pind->
cache || point_vel) {
1611 invdt = dfra * 0.04f * (psys ? psys->
part->
timetweak : 1.0f);
1629 if (pind->
keyed || pind->
cache || point_vel) {
1642 while (i < first->segments && cur->
time <
t) {
1646 if (cur->
time ==
t) {
1650 float dt = (
t - (cur - 1)->
time) / (cur->
time - (cur - 1)->
time);
1658 if (cur == first || cur - 1 == first) {
1673 float (*orcodata)[3],
1681 float *
v1 = 0, *
v2 = 0, *v3 = 0, *v4 = 0;
1682 float e1[3], e2[3], s1, s2, t1, t2;
1683 float *uv1, *uv2, *uv3, *uv4;
1684 float n1[3], n2[3], n3[3], n4[3];
1686 float *o1, *o2, *o3, *o4;
1688 v1 = mvert[mface->
v1].
co;
1689 v2 = mvert[mface->
v2].
co;
1690 v3 = mvert[mface->
v3].
co;
1697 v4 = mvert[mface->
v4].
co;
1746 s1 = uv3[0] - uv1[0];
1747 s2 = uv4[0] - uv1[0];
1749 t1 = uv3[1] - uv1[1];
1750 t2 = uv4[1] - uv1[1];
1756 s1 = uv2[0] - uv1[0];
1757 s2 = uv3[0] - uv1[0];
1759 t1 = uv2[1] - uv1[1];
1760 t2 = uv3[1] - uv1[1];
1766 vtan[0] = (s1 * e2[0] - s2 * e1[0]);
1767 vtan[1] = (s1 * e2[1] - s2 * e1[1]);
1768 vtan[2] = (s1 * e2[2] - s2 * e1[2]);
1770 utan[0] = (t1 * e2[0] - t2 * e1[0]);
1771 utan[1] = (t1 * e2[1] - t2 * e1[1]);
1772 utan[2] = (t1 * e2[2] - t2 * e1[2]);
1777 o1 = orcodata[mface->
v1];
1778 o2 = orcodata[mface->
v2];
1779 o3 = orcodata[mface->
v3];
1782 o4 = orcodata[mface->
v4];
1797 float v10 = tface->
uv[0][0];
1798 float v11 = tface->
uv[0][1];
1799 float v20 = tface->
uv[1][0];
1800 float v21 = tface->
uv[1][1];
1801 float v30 = tface->
uv[2][0];
1802 float v31 = tface->
uv[2][1];
1806 v40 = tface->
uv[3][0];
1807 v41 = tface->
uv[3][1];
1809 uvco[0] =
w[0] * v10 +
w[1] * v20 +
w[2] * v30 +
w[3] * v40;
1810 uvco[1] =
w[0] * v11 +
w[1] * v21 +
w[2] * v31 +
w[3] * v41;
1813 uvco[0] =
w[0] * v10 +
w[1] * v20 +
w[2] * v30;
1814 uvco[1] =
w[0] * v11 +
w[1] * v21 +
w[2] * v31;
1820 const char *cp1, *cp2, *cp3, *cp4;
1824 cp1 = (
const char *)&mcol[0];
1825 cp2 = (
const char *)&mcol[1];
1826 cp3 = (
const char *)&mcol[2];
1829 cp4 = (
char *)&mcol[3];
1831 cp[0] = (int)(
w[0] * cp1[0] +
w[1] * cp2[0] +
w[2] * cp3[0] +
w[3] * cp4[0]);
1832 cp[1] = (int)(
w[0] * cp1[1] +
w[1] * cp2[1] +
w[2] * cp3[1] +
w[3] * cp4[1]);
1833 cp[2] = (int)(
w[0] * cp1[2] +
w[1] * cp2[2] +
w[2] * cp3[2] +
w[3] * cp4[2]);
1834 cp[3] = (int)(
w[0] * cp1[3] +
w[1] * cp2[3] +
w[2] * cp3[3] +
w[3] * cp4[3]);
1837 cp[0] = (int)(
w[0] * cp1[0] +
w[1] * cp2[0] +
w[2] * cp3[0]);
1838 cp[1] = (int)(
w[0] * cp1[1] +
w[1] * cp2[1] +
w[2] * cp3[1]);
1839 cp[2] = (int)(
w[0] * cp1[2] +
w[1] * cp2[2] +
w[2] * cp3[2]);
1840 cp[3] = (int)(
w[0] * cp1[3] +
w[1] * cp2[3] +
w[2] * cp3[3]);
1845 Mesh *
mesh,
short from,
int index,
const float fw[4],
const float *values)
1847 if (values == 0 || index == -1) {
1853 return values[index];
1858 values[mf->
v1], values[mf->
v2], values[mf->
v3], values[mf->
v4], fw, mf->
v4);
1867 uv[0] =
w[1] +
w[2];
1868 uv[1] =
w[2] +
w[3];
1874 float v[4][3], co[3];
1876 v[0][0] = osface->
uv[0][0];
1877 v[0][1] = osface->
uv[0][1];
1879 v[1][0] = osface->
uv[1][0];
1880 v[1][1] = osface->
uv[1][1];
1882 v[2][0] = osface->
uv[2][0];
1883 v[2][1] = osface->
uv[2][1];
1890 v[3][0] = osface->
uv[3][0];
1891 v[3][1] = osface->
uv[3][1];
1914 Mesh *mesh_original,
1919 MFace *mtessface_final;
1922 float uv[2], (*faceuv)[2];
1924 const int *index_mf_to_mpoly_deformed =
NULL;
1925 const int *index_mf_to_mpoly =
NULL;
1926 const int *index_mp_to_orig =
NULL;
1928 const int totface_final = mesh_final->
totface;
1929 const int totface_deformed = mesh_original ? mesh_original->
totface : totface_final;
1931 if (
ELEM(0, totface_final, totface_deformed)) {
1939 if (mesh_original) {
1944 index_mf_to_mpoly_deformed = index_mf_to_mpoly;
1948 pindex_orig = index_mf_to_mpoly_deformed[findex_orig];
1950 if (mesh_original ==
NULL) {
1951 mesh_original = mesh_final;
1954 index_mf_to_mpoly_deformed =
NULL;
1956 mtessface_final = mesh_final->
mface;
1959 if (osface_final ==
NULL) {
1961 if (findex_orig < totface_final) {
1966 printf(
"\tNO CD_ORIGSPACE, error out of range\n");
1969 if (findex_orig >= mesh_original->
totface) {
1977 LinkNode *tessface_node = poly_nodes[pindex_orig];
1979 for (; tessface_node; tessface_node = tessface_node->
next) {
1981 faceuv = osface_final[findex_dst].
uv;
1985 if (mtessface_final[findex_dst].v4) {
1996 for (
int findex_dst = 0; findex_dst < totface_final; findex_dst++) {
2001 faceuv = osface_final[findex_dst].
uv;
2005 if (mtessface_final[findex_dst].v4) {
2061 *mapindex = index_dmcache;
2082 if (osface ==
NULL) {
2083 mapfw[0] = mapfw[1] = mapfw[2] = mapfw[3] = 0.0f;
2107 float tmpnor[3], mapfw[4];
2108 float(*orcodata)[3];
2112 mesh_final,
from, index, index_dmcache, fw, foffset, &mapindex, mapfw)) {
2114 vec[0] = vec[1] = vec[2] = 0.0;
2121 orco[0] = orco[1] = orco[2] = 0.0;
2124 utan[0] = utan[1] = utan[2] = 0.0;
2127 vtan[0] = vtan[1] = vtan[2] = 0.0;
2153 utan[0] = utan[1] = utan[2] = 0.0f;
2154 vtan[0] = vtan[1] = vtan[2] = 0.0f;
2162 mface = &mesh_final->
mface[mapindex];
2163 mvert = mesh_final->
mvert;
2164 mtface = mesh_final->
mtface;
2209 if (psmd->
psys == psys) {
2230 const float zerovec[3] = {0.0f, 0.0f, 0.0f};
2315 psmd->
mesh_final,
from, index, index_dmcache, fuv, foffset, vec,
nor, utan, vtan, orco);
2359 for (eff = effectors->
first; eff; eff = eff->
next) {
2366 "GuideEffectorData");
2397 float effect[3] = {0.0f, 0.0f, 0.0f}, veffect[3] = {0.0f, 0.0f, 0.0f};
2398 float guidevec[4], guidedir[3], rot2[4], temp[3];
2399 float guidetime, radius, weight,
angle, totstrength = 0.0f;
2400 float vec_to_point[3];
2403 for (eff = effectors->
first; eff; eff = eff->
next) {
2412 if (
data->strength <= 0.0f) {
2418 if (guidetime > 1.0f) {
2426 eff->
ob,
data->strength * guidetime, guidevec, guidedir,
NULL, &radius, &weight) ==
2445 if (guidetime != 0.0f) {
2464 (
int)(
data->strength * guidetime * 100.0f),
2482 const float par_co[3] = {0.0f, 0.0f, 0.0f};
2483 const float par_vel[3] = {0.0f, 0.0f, 0.0f};
2484 const float par_rot[4] = {1.0f, 0.0f, 0.0f, 0.0f};
2485 const float orco_offset[3] = {0.0f, 0.0f, 0.0f};
2519 totstrength +=
data->strength;
2522 totstrength *= weight;
2527 if (totstrength != 0.0f) {
2528 if (totstrength > 1.0f) {
2531 CLAMP(totstrength, 0.0f, 1.0f);
2555 float force[3] = {0.0f, 0.0f, 0.0f};
2605 child->
co[0] *= flat;
2626 else if (psys->
vgroup[vgroup]) {
2630 vg =
MEM_callocN(
sizeof(
float) * totvert,
"vg_cache");
2631 if (psys->
vg_neg & (1 << vgroup)) {
2632 for (i = 0; i < totvert; i++) {
2637 for (i = 0; i < totvert; i++) {
2653 float co[3], orco[3];
2655 totparent = (int)(totchild * part->
parents * 0.3f);
2666 tree = BLI_kdtree_3d_new(totparent);
2668 for (p = 0, cpa = sim->
psys->
child; p < totparent; p++, cpa++) {
2670 sim->
psmd,
from, cpa->
num,
DMCACHE_ISCHILD, cpa->
fuv, cpa->
foffset, co, 0, 0, 0, orco);
2687 BLI_kdtree_3d_insert(
tree, p, orco);
2691 BLI_kdtree_3d_balance(
tree);
2693 for (; p < totchild; p++, cpa++) {
2695 sim->
psmd,
from, cpa->
num,
DMCACHE_ISCHILD, cpa->
fuv, cpa->
foffset, co, 0, 0, 0, orco);
2699 BLI_kdtree_3d_free(
tree);
2706 const bool editupdate,
2707 const bool use_render_params)
2711 int totparent = 0, between = 0;
2721 if ((use_render_params == 0) &&
2730 totparent = (int)(totchild * part->
parents * 0.3f);
2740 if (use_render_params) {
2744 totchild = (int)((
float)totchild * (
float)part->
disp / 100.0f);
2747 totparent =
MIN2(totparent, totchild);
2749 if (totchild == 0) {
2833 float *cpa_fuv = 0, *par_rot = 0,
rot[4];
2834 float orco[3], hairmat[4][4], dvec[3], off1[4][3], off2[4][3];
2835 float eff_length, eff_vec[3], weight[4];
2846 float foffset, wsum = 0.0f;
2856 while (w < 4 && cpa->pa[
w] >= 0) {
2868 memset(child_keys, 0,
sizeof(*child_keys) * (ctx->
segments + 1));
2872 for (
w = 0;
w < 4;
w++) {
2873 if (cpa->
pa[
w] >= 0) {
2874 key[
w] = pcache[cpa->
pa[
w]];
2875 weight[
w] = cpa->
w[
w];
2886 for (
w = 0;
w < 4;
w++) {
2887 if (
w && (weight[
w] > 0.0f)) {
2893 float d1 =
len_v3v3(key[0]->co, key[
w]->co);
2896 d = d1 > 0.0f ? d2 / d1 - 1.0f : 10000.0f;
2908 if (p_max > p_min) {
2909 d = (d - p_min) / (p_max - p_min);
2912 d = (d - p_min) <= 0.0f ? 0.0f : 1.0f;
2915 CLAMP(d, 0.0f, 1.0f);
2918 weight[
w] *= (1.0f - d);
2923 for (
w = 0;
w < 4;
w++) {
2938 ctx->
sim.
psmd, cpa_from, cpa_num,
DMCACHE_ISCHILD, cpa->
fuv, foffset, co, 0, 0, 0, orco);
2942 for (
w = 0;
w < 4;
w++) {
2956 memset(child_keys, 0,
sizeof(*child_keys) * (ctx->
segments + 1));
2960 key[0] = pcache[cpa->
parent];
2963 cpa_from = part->
from;
3008 for (k = 0, child = child_keys; k <= ctx->
segments; k++, child++) {
3016 for (
w = 0;
w < 4;
w++) {
3050 par_rot = key[0]->
rot;
3066 for (k = 0, child = child_keys; k <= ctx->
segments; k++, child++) {
3082 eff_length =
len_v3(eff_vec);
3098 par = cache[cpa->
parent];
3101 else if (cpa->
parent >= 0) {
3103 par = pcache[cpa->
parent];
3108 if (cpa->
pa[k] >= 0) {
3110 par = pcache[cpa->
pa[k]];
3136 ctx, &modifiers, cpa, &ptex, orco, hairmat, child_keys, par, par_orco);
3144 if (i < ctx->totparent) {
3159 for (i =
task->begin; i < task->end; i++, cpa++) {
3167 const bool editupdate,
3168 const bool use_render_params)
3173 int numtasks_parent, numtasks_child;
3174 int i, totchild, totparent;
3204 for (i = 0; i < numtasks_parent; i++) {
3215 for (i = 0; i < numtasks_child; i++) {
3235 float *prev_tangent,
3238 float cosangle,
angle, tangent[3],
normal[3], q[4];
3254 cosangle =
dot_v3v3(tangent, prev_tangent);
3259 if (cosangle > 0.999999f) {
3298 float birthtime = 0.0, dietime = 0.0;
3299 float t,
time = 0.0, dfra = 1.0 ;
3300 float col[4] = {0.5f, 0.5f, 0.5f, 1.0f};
3301 float prev_tangent[3] = {0.0f, 0.0f, 0.0f}, hairmat[4][4];
3304 int segments = (int)
pow(2.0, (
double)((use_render_params) ? part->ren_step : part->draw_step));
3305 int totpart = psys->totpart;
3307 float *vg_effector =
NULL;
3308 float *vg_length =
NULL, pa_length = 1.0f;
3323 baked = psys->pointcache->mem_cache.first && psys->part->type !=
PART_HAIR;
3328 &psys->pathcachebufs, totpart, segments + 1);
3341 if (!psys->totchild) {
3354 if (!psys->totchild) {
3356 pa_length = ptex.length * (1.0f - part->randlength *
psys_frand(psys, psys->seed + p));
3363 pind.cache = baked ? psys->pointcache :
NULL;
3366 pind.mesh = hair_mesh;
3368 memset(cache[p], 0,
sizeof(*cache[p]) * (segments + 1));
3370 cache[p]->segments = segments;
3382 birthtime =
MAX2(pind.birthtime, part->path_start);
3383 dietime =
MIN2(pind.dietime, part->path_end);
3386 float tb = pind.birthtime;
3387 birthtime = tb + part->path_start * (pind.dietime - tb);
3388 dietime = tb + part->path_end * (pind.dietime - tb);
3391 if (birthtime >= dietime) {
3392 cache[p]->segments = -1;
3396 dietime = birthtime + pa_length * (dietime - birthtime);
3399 for (k = 0, ca = cache[p]; k <= segments; k++, ca++) {
3401 t = birthtime +
time * (dietime - birthtime);
3421 for (k = 0, hkey = pa->hair; k < pa->totkey; k++, hkey++) {
3431 float effector = 1.0f;
3434 psmd->mesh_final, psys->part->from, pa, vg_effector);
3437 sub_v3_v3v3(vec, (cache[p] + 1)->co, cache[p]->co);
3440 for (k = 1, ca = cache[p] + 1; k <= segments; k++, ca++) {
3442 sim, p, ca, k, segments, cache[p]->co, effector, dfra, cfra, &
length, vec);
3448 for (k = 0, ca = cache[p]; k <= segments; k++, ca++) {
3455 (
float)k / (
float)segments);
3460 if (psys->lattice_deform_data) {
3461 for (k = 0, ca = cache[p]; k <= segments; k++, ca++) {
3463 psys->lattice_deform_data, ca->
co, psys->lattice_strength);
3469 for (k = 1, ca = cache[p] + 1; k <= segments; k++, ca++) {
3472 if (k == segments) {
3495 psys->totcached = totpart;
3497 if (psys->lattice_deform_data) {
3499 psys->lattice_deform_data =
NULL;
3530 if (point->
totkey == 0) {
3539 const int segments = iter_data->
segments;
3540 const bool use_weight = iter_data->
use_weight;
3542 float birthtime = 0.0f, dietime = 0.0f;
3543 float hairmat[4][4], rotmat[3][3], prev_tangent[3] = {0.0f, 0.0f, 0.0f};
3560 memset(cache[iter], 0,
sizeof(*cache[iter]) * (segments + 1));
3577 if (birthtime >= dietime) {
3585 float t,
time = 0.0f, keytime = 0.0f;
3586 for (k = 0, ca = cache[iter]; k <= segments; k++, ca++) {
3588 t = birthtime +
time * (dietime - birthtime);
3601 if (k == segments) {
3614 ca->
vel[0] = ca->
vel[1] = 0.0f;
3626 if (
result.time < 0.0f) {
3634 while (pind.
hkey[1]->
time < real_t) {
3658 ca->
col[0] = 1.0f - keytime;
3664 ca->
col[0] = keytime;
3691 const bool use_render_params)
3701 int totpart = edit->
totpoint, recalc_set = 0;
3707 segments =
MAX2(segments, 4);
3717 for (i = 0, point = edit->
points; i < totpart; i++, point++) {
3728 iter_data.
edit = edit;
3755 for (i = 0, point = edit->
points; i < totpart; i++, point++) {
3769 float to_time = to->
time;
3790 static void triatomat(
float *
v1,
float *
v2,
float *v3,
float (*uv)[2],
float mat[4][4])
3792 float det, w1, w2, d1[2], d2[2];
3794 memset(mat, 0,
sizeof(
float[4][4]));
3802 d1[0] = uv[1][0] - uv[0][0];
3803 d1[1] = uv[1][1] - uv[0][1];
3804 d2[0] = uv[2][0] - uv[0][0];
3805 d2[1] = uv[2][1] - uv[0][1];
3807 det = d2[0] * d1[1] - d2[1] * d1[0];
3814 mat[1][0] = w1 * (
v2[0] -
v1[0]) + w2 * (v3[0] -
v1[0]);
3815 mat[1][1] = w1 * (
v2[1] -
v1[1]) + w2 * (v3[1] -
v1[1]);
3816 mat[1][2] = w1 * (
v2[2] -
v1[2]) + w2 * (v3[2] -
v1[2]);
3820 mat[1][0] = mat[1][1] = mat[1][2] = 0.0f;
3837 float(*orcodata)[3];
3880 psys_particle_on_dm(
mesh,
from, pa->
num, pa->
num_dmcache, pa->
fuv, pa->
foffset, vec, 0, 0, 0, 0);
3887 float vec[3], orco[3];
3891 mesh,
from, pa->
num, pa->
num_dmcache, pa->
fuv, pa->
foffset, vec, 0, 0, 0, orco);
3912 float facemat[4][4];
3934 name = (psys_orig !=
NULL) ? psys_orig->
name :
DATA_(
"ParticleSystem");
3938 for (; psys; psys = psys->
next) {
3947 if (psys_orig !=
NULL) {
4198 texco[0] = texco[0] * 2.0f - 1.0f;
4199 texco[1] = texco[1] * 2.0f - 1.0f;
4206 #define SET_PARTICLE_TEXTURE(type, pvalue, texfac) \
4207 if ((event & mtex->mapto) & type) { \
4208 pvalue = texture_value_blend(def, pvalue, value, texfac, blend); \
4212 #define CLAMP_PARTICLE_TEXTURE_POS(type, pvalue) \
4213 if (event & type) { \
4214 CLAMP(pvalue, 0.0f, 1.0f); \
4218 #define CLAMP_WARP_PARTICLE_TEXTURE_POS(type, pvalue) \
4219 if (event & type) { \
4220 if (pvalue < 0.0f) { \
4221 pvalue = 1.0f + pvalue; \
4223 CLAMP(pvalue, 0.0f, 1.0f); \
4227 #define CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue) \
4228 if (event & type) { \
4229 CLAMP(pvalue, -1.0f, 1.0f); \
4247 float value, rgba[4], texvec[3];
4257 for (m = 0; m <
MAX_MTEX; m++, mtexp++) {
4259 if (mtex && mtex->
tex && mtex->
mapto) {
4262 short texco = mtex->
texco;
4297 texvec[0] = 2.0f * (cfra - par->
time) / (par->
dietime - par->
time) - 1.0f;
4332 MTex **mtexp = part->mtex;
4335 float value, rgba[4], co[3], texvec[3];
4346 for (m = 0; m <
MAX_MTEX; m++, mtexp++) {
4348 if (mtex && mtex->tex && mtex->mapto) {
4349 float def = mtex->def_var;
4350 short blend = mtex->blendtype;
4351 short texco = mtex->texco;
4395 if (me->
size[0] != 0.0f) {
4396 texvec[0] /= me->
size[0];
4398 if (me->
size[1] != 0.0f) {
4399 texvec[1] /= me->
size[1];
4401 if (me->
size[2] != 0.0f) {
4402 texvec[2] /= me->
size[2];
4407 texvec[0] = 2.0f * (cfra - pa->
time) / (pa->
dietime - pa->
time) - 1.0f;
4424 int flip = (mtex->timefac < 0.0f);
4425 float timefac =
fabsf(mtex->timefac);
4426 ptex->
time *= 1.0f - timefac;
4427 ptex->
time += timefac * ((flip) ? 1.0f - value : value);
4472 while (w < 4 && cpa->pa[
w] >= 0) {
4490 *dietime =
time + life;
4493 return (cfra -
time) / life;
4506 while (w < 4 && cpa->pa[
w] >= 0) {
4533 int i = cpa - psys->
child;
4561 ctx->
mesh, cpa_from, cpa_num, cpa_fuv, ctx->
vg_kink);
4602 float co[3], orco[3];
4603 float hairmat[4][4];
4606 short between = 0, edit = 0;
4670 else if (totchild) {
4682 float par_co[3], par_orco[3];
4684 cpa = psys->
child + p - totpart;
4686 if (
state->time < 0.0f) {
4699 while (w < 4 && cpa->pa[
w] >= 0) {
4700 keys[
w].time =
state->time;
4713 psmd, cpa_from, cpa_num,
DMCACHE_ISCHILD, cpa->
fuv, foffset, co, 0, 0, 0, orco);
4751 cpa_from = part->
from;
4768 psmd, cpa_from, cpa_num,
DMCACHE_ISCHILD, cpa_fuv, pa->
foffset, co, 0, 0, 0, orco);
4780 ctx.
mesh = psmd->mesh_final;
4792 while (w < 4 && cpa->pa[
w] >= 0) {
4793 state->co[0] += cpa->
w[
w] * keys[
w].co[0];
4794 state->co[1] += cpa->
w[
w] * keys[
w].co[1];
4795 state->co[2] += cpa->
w[
w] * keys[
w].co[2];
4797 state->vel[0] += cpa->
w[
w] * keys[
w].vel[0];
4798 state->vel[1] += cpa->
w[
w] * keys[
w].vel[1];
4799 state->vel[2] += cpa->
w[
w] * keys[
w].vel[2];
4819 modifier_ctx.
sim = sim;
4820 modifier_ctx.
ptex = &ptex;
4821 modifier_ctx.
cpa = cpa;
4822 modifier_ctx.
orco = orco;
4836 tstate_tmp.
time =
t - 0.001f;
4842 tstate_tmp.
time =
t + 0.001f;
4877 cpa = psys->
child + p - totpart;
4914 state->time = -cfra;
4923 const float par_orco[3] = {0.0f, 0.0f, 0.0f};
4933 modifier_ctx.
sim = sim;
4935 modifier_ctx.
cpa = cpa;
4937 modifier_ctx.
par_co = key1->co;
4938 modifier_ctx.
par_vel = key1->vel;
4939 modifier_ctx.
par_rot = key1->rot;
4954 else if (pa->prev_state.time == cfra) {
4960 if (pa->state.time + 2.0f >=
state->time && pa->prev_state.time - 2.0f <=
state->time) {
4961 if (pa->prev_state.time >= pa->state.time || pa->prev_state.time < 0.0f) {
4964 dfra =
state->time - pa->state.time;
4977 dfra = keys[2].
time - keys[1].
time;
4979 keytime = (
state->time - keys[1].
time) / dfra;
4982 mul_v3_fl(keys[1].vel, dfra * timestep);
4983 mul_v3_fl(keys[2].vel, dfra * timestep);
4994 else if (pa->state.time + 1.0f >=
state->time && pa->state.time - 1.0f <=
state->time) {
4997 dfra =
state->time - pa->state.time;
5039 uv[0] = uv[1] = 0.0f;
5052 if (mtface !=
NULL) {
5104 psmd, part->
from, pa->
num, pa->
num_dmcache, pa->
fuv, pa->
foffset, loc, 0, 0, 0, orco);
5117 float loc[3],
nor[3], vec[3], side[3],
len;
5118 float xvec[3] = {-1.0, 0.0, 0.0}, nmat[3][3];
5216 float hairmat[4][4], imat[4][4];
5218 for (p = 0; p < psys->
totpart; p++, pa++) {
5223 for (h = 0; h < pa->
totkey; h++, hkey++) {
5267 for (
int a = 0;
a < psys->
totpart;
a++, pa++) {
5309 for (
a = 0, pa = psys->
particles; a < psys->totpart;
a++, pa++) {
5315 for (
a = 0, pa = psys->
particles; a < psys->totpart;
a++, pa++) {
5330 for (
a = 1, pa++;
a < psys->
totpart;
a++, pa++) {
5331 pa->
boid = (pa - 1)->boid + 1;
5336 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)
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, const short type, const char *name)
#define BKE_LIB_FOREACHID_PROCESS(_data, _id_super, _cb_flag)
General operations, lookup, etc. for materials.
struct Material * BKE_object_material_get(struct Object *ob, short act)
void BKE_mesh_tessface_ensure(struct Mesh *mesh)
void BKE_mesh_orco_verts_transform(struct Mesh *me, float(*orco)[3], int totvert, int invert)
void BKE_mesh_texspace_ensure(struct Mesh *me)
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, const float 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)
void map_to_sphere(float *r_u, float *r_v, const float x, const float y, const float z)
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_weights_poly_v3(float w[], float v[][3], const int n, const float co[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], const float t)
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 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 axis_angle_to_quat(float r[4], const float axis[3], const 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 interp_qt_qtqt(float q[4], const float a[4], const float b[4], const float t)
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])
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t)
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 normal_short_to_float_v3(float r[3], const short n[3])
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], const float t)
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
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
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, const size_t maxncpy) ATTR_NONNULL()
void BLI_task_parallel_range(const int start, const int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
void BLI_task_pool_work_and_wait(TaskPool *pool)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
TaskPool * BLI_task_pool_create(void *userdata, TaskPriority priority)
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)
bool BLO_write_is_undo(BlendWriter *writer)
#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
#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
@ PART_FLUID_SPRAYFOAMBUBBLE
#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 RGB to Bright Vector Camera CLAMP
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.
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
static unsigned long seed
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
const Depsgraph * depsgraph
IconTextureDrawCall normal
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
struct blender::compositor::@172::@174 task
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
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)
int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *state, int always)
static void mvert_to_particle(ParticleKey *key, MVert *mvert, HairKey *hkey)
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]
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 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])
int do_guides(Depsgraph *depsgraph, ParticleSettings *part, ListBase *effectors, ParticleKey *state, int index, float time)
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])
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)
static void triatomat(float *v1, float *v2, float *v3, float(*uv)[2], float mat[4][4])
void psys_cache_paths(ParticleSimulationData *sim, float cfra, const bool use_render_params)
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)
void object_remove_particle_system(Main *bmain, Scene *UNUSED(scene), Object *ob)
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 psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float(*orcodata)[3], float w[4], float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3])
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)
struct LatticeDeformData * psys_create_lattice_deform_data(ParticleSimulationData *sim)
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 CustomData vdata edata fdata
struct ModifierData * next
struct PTCacheEditKey * keys
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)