26#define DNA_DEPRECATED_ALLOW
54#include "RNA_prototypes.hh"
59 std::optional<Library *> ,
64 Key *key_dst = (
Key *)id_dst;
65 const Key *key_src = (
const Key *)id_src;
72 kb_src = kb_src->
next, kb_dst = kb_dst->
next)
77 if (kb_src == key_src->
refkey) {
96 Key *key =
reinterpret_cast<Key *
>(id);
110 if (debug_relationship_assert) {
133 tmp_kb.
data =
nullptr;
136 if (tmp_kb.
data !=
nullptr) {
144#define IPO_BEZTRIPLE 100
145#define IPO_BPOINT 101
150 char *data =
static_cast<char *
>(kb->
data);
152 for (
int a = 0; a < kb->
totelem; a++) {
163 poin +=
sizeof(
float) *
b;
231#define KEY_MODE_DUMMY 0
232#define KEY_MODE_BPOINT 1
233#define KEY_MODE_BEZTRIPLE 2
269 switch (
GS(id->name)) {
326 if (kb2->pos > kb->
pos) {
354 data[0] = -fc * t3 + 2.0f * fc * t2 - fc * t;
355 data[1] = (2.0f - fc) * t3 + (fc - 3.0f) * t2 + 1.0f;
356 data[2] = (fc - 2.0f) * t3 + (3.0f - 2.0f * fc) * t2 + fc * t;
357 data[3] = fc * t3 - fc * t2;
363 data[0] = -0.16666666f * t3 + 0.5f * t2 - 0.5f * t + 0.16666666f;
364 data[1] = 0.5f * t3 - t2 + 0.66666666f;
365 data[2] = -0.5f * t3 + 0.5f * t2 + 0.5f * t + 0.16666666f;
366 data[3] = 0.16666666f * t3;
373 data[0] = -fc * t3 + 2.0f * fc * t2 - fc * t;
374 data[1] = (2.0f - fc) * t3 + (fc - 3.0f) * t2 + 1.0f;
375 data[2] = (fc - 2.0f) * t3 + (3.0f - 2.0f * fc) * t2 + fc * t;
376 data[3] = fc * t3 - fc * t2;
394 data[0] = -3.0f * fc * t2 + 4.0f * fc * t - fc;
395 data[1] = 3.0f * (2.0f - fc) * t2 + 2.0f * (fc - 3.0f) * t;
396 data[2] = 3.0f * (fc - 2.0f) * t2 + 2.0f * (3.0f - 2.0f * fc) * t + fc;
397 data[3] = 3.0f * fc * t2 - 2.0f * fc * t;
402 data[0] = -0.5f * t2 + t - 0.5f;
403 data[1] = 1.5f * t2 - t * 2.0f;
404 data[2] = -1.5f * t2 + t + 0.5f;
411 data[0] = -3.0f * fc * t2 + 4.0f * fc * t - fc;
412 data[1] = 3.0f * (2.0f - fc) * t2 + 2.0f * (fc - 3.0f) * t;
413 data[2] = 3.0f * (fc - 2.0f) * t2 + 2.0f * (3.0f - 2.0f * fc) * t + fc;
414 data[3] = 3.0f * fc * t2 - 2.0f * fc * t;
431 data[0] = -6.0f * fc * t + 4.0f * fc;
432 data[1] = 6.0f * (2.0f - fc) * t + 2.0f * (fc - 3.0f);
433 data[2] = 6.0f * (fc - 2.0f) * t + 2.0f * (3.0f - 2.0f * fc);
434 data[3] = 6.0f * fc * t - 2.0f * fc;
437 data[0] = -1.0f * t + 1.0f;
438 data[1] = 3.0f * t - 2.0f;
439 data[2] = -3.0f * t + 1.0f;
445 data[0] = -6.0f * fc * t + 4.0f * fc;
446 data[1] = 6.0f * (2.0f - fc) * t + 2.0f * (fc - 3.0f);
447 data[2] = 6.0f * (fc - 2.0f) * t + 2.0f * (3.0f - 2.0f * fc);
448 data[3] = 6.0f * fc * t - 2.0f * fc;
456 float d, dpos, ofs = 0, lastpos;
462 dpos = lastpos - firstkey->
pos;
464 if (fac < firstkey->
pos) {
467 else if (fac > k1->
pos) {
471 k1 = k[0] = k[1] = k[2] = k[3] = firstkey;
472 t[0] = t[1] = t[2] = t[3] = k1->
pos;
475 if (fac < 0.0 || fac > 1.0) {
480 if (k1->
next ==
nullptr) {
487 if (k[3] ==
nullptr) {
491 if (k1->
next ==
nullptr) {
499 t[2] = k[2]->
pos + dpos;
500 t[3] = k[3]->
pos + dpos;
516 if (k[3] ==
nullptr) {
524 if (k1->
next ==
nullptr) {
529 else if (t[2] == t[3]) {
543 t[3] = k1->
pos + ofs;
546 if (ofs > 2.1f + lastpos) {
557 if (bsplinetype == 0) {
567 else if (fac > t[2]) {
576 if (bsplinetype == 0) {
581 d = (fac - t[1]) / d;
587 if (k[1]->type != k[2]->type) {
606 for (a = 0; a < tot; a++) {
607 in[a] = t[0] * f0[a] + t[1] * f1[a] + t[2] * f2[a] + t[3] * f3[a];
611static void rel_flerp(
int tot,
float *in,
const float *ref,
const float *out,
float fac)
615 for (a = 0; a < tot; a++) {
616 in[a] -= fac * (ref[a] - out[a]);
634 if (mesh->runtime->edit_mesh && mesh->runtime->edit_mesh->bm->totvert == kb->
totelem) {
637 sizeof(
float[3]) * mesh->runtime->edit_mesh->bm->totvert,
"key_block_get_data"));
644 *freedata = (
char *)co;
651 return static_cast<char *
>(kb->
data);
656 const Key *key,
const int mode,
int *r_poinsize,
int *r_ofs,
int *r_step)
658 if (key->
from ==
nullptr) {
667 *r_poinsize = *r_ofs;
671 *r_poinsize = *r_ofs;
702 float ktot = 0.0, kd = 0.0;
703 int elemsize, poinsize = 0, a, step, *ofsp, ofs[32], flagflo = 0;
704 char *k1, *kref, *freek1, *freekref;
705 char *cp, elemstr[8];
735 poin += poinsize * start;
759 for (a = start; a < end; a += step) {
773 if (*weights != 0.0f) {
809 while (ktot >= 1.0f) {
841 for (a = 0, nu =
static_cast<Nurb *
>(cu->
nurb.
first); nu; nu = nu->
next, a += step) {
846 a2 =
min_ii(a + step, end);
857 a2 =
min_ii(a + step, end);
875 float **per_keyblock_weights,
879 int *ofsp, ofs[3], elemsize,
b, step;
880 char *cp, *poin, *reffrom, *
from, elemstr[8];
881 int poinsize, keyblock_index;
903 cp_key(start, end, tot, basispoin, key, actkb, key->
refkey,
nullptr, mode);
908 kb = kb->
next, keyblock_index++)
911 float icuval = kb->
curval;
917 *weights = per_keyblock_weights ? per_keyblock_weights[keyblock_index] :
nullptr;
918 char *freefrom =
nullptr;
922 if (refb ==
nullptr) {
931 reffrom =
static_cast<char *
>(refb->
data);
933 poin += start * poinsize;
937 for (
b = start;
b < end;
b += step) {
939 weight = weights ? (*weights * icuval) : icuval;
1013 float k1tot = 0.0, k2tot = 0.0, k3tot = 0.0, k4tot = 0.0;
1014 float k1d = 0.0, k2d = 0.0, k3d = 0.0, k4d = 0.0;
1015 int a, step, ofs[32], *ofsp;
1016 int flagdo = 15, flagflo = 0, elemsize, poinsize = 0;
1017 char *k1, *k2, *k3, *k4, *freek1, *freek2, *freek3, *freek4;
1018 char *cp, elemstr[8];
1037 if (tot != k[0]->totelem) {
1040 if (k[0]->totelem) {
1047 if (tot != k[1]->totelem) {
1050 if (k[0]->totelem) {
1057 if (tot != k[2]->totelem) {
1060 if (k[0]->totelem) {
1067 if (tot != k[3]->totelem) {
1070 if (k[0]->totelem) {
1081 poin += poinsize * start;
1085 k1tot += start * k1d;
1098 k2tot += start * k2d;
1111 k3tot += start * k3d;
1124 k4tot += start * k4d;
1145 for (a = start; a < end; a += step) {
1209 while (k1tot >= 1.0f) {
1221 while (k2tot >= 1.0f) {
1233 while (k3tot >= 1.0f) {
1245 while (k4tot >= 1.0f) {
1276 int totvert = 0, defgrp_index = 0;
1279 if (vgroup[0] == 0) {
1286 dvert = mesh->deform_verts().data();
1287 totvert = mesh->verts_num;
1289 if (mesh->runtime->edit_mesh && mesh->runtime->edit_mesh->bm->totvert == totvert) {
1290 em = mesh->runtime->edit_mesh.get();
1299 if (dvert ==
nullptr) {
1305 if (defgrp_index != -1) {
1312 sizeof(*cache->
defgroup_weights) * num_defgroup,
"cached defgroup weights"));
1321 weights =
static_cast<float *
>(
MEM_mallocN(totvert *
sizeof(
float),
"weights"));
1332 for (
int i = 0; i < totvert; i++, dvert++) {
1349 float **per_keyblock_weights;
1352 per_keyblock_weights =
static_cast<float **
>(
1353 MEM_mallocN(
sizeof(*per_keyblock_weights) * key->
totkey,
"per keyblock weights"));
1355 for (keyblock =
static_cast<KeyBlock *
>(key->
block.
first), keyblock_index = 0; keyblock;
1356 keyblock = keyblock->
next, keyblock_index++)
1361 return per_keyblock_weights;
1365 float **per_keyblock_weights,
1382 for (a = 0; a < key->
totkey; a++) {
1383 if (per_keyblock_weights[a]) {
1400 float **per_keyblock_weights;
1403 0, tot, tot, (
char *)out, key, actkb, per_keyblock_weights,
KEY_MODE_DUMMY);
1407 const float ctime_scaled = key->
ctime / 100.0f;
1426 for (a = 0, nu =
static_cast<Nurb *
>(cu->
nurb.
first); nu; nu = nu->
next, a += step) {
1431 else if (nu->
bezt) {
1446 for (a = 0, nu =
static_cast<Nurb *
>(cu->
nurb.
first); nu; nu = nu->
next, a += step) {
1451 else if (nu->
bezt) {
1472 const float ctime_scaled = key->
ctime / 100.0f;
1477 do_cu_key(cu, key, actkb, k, t, out, tot);
1480 cp_cu_key(cu, key, actkb, k[2], 0, tot, out, tot);
1493 float **per_keyblock_weights;
1496 0, tot, tot, (
char *)out, key, actkb, per_keyblock_weights,
KEY_MODE_DUMMY);
1500 const float ctime_scaled = key->
ctime / 100.0f;
1519 const int totpoint);
1523 Object *ob,
int *r_totelem,
float *arr,
size_t arr_size,
ID *obdata)
1528 int tot = 0, size = 0;
1555 if (tot == 0 || size == 0) {
1560 if (arr ==
nullptr) {
1561 out =
static_cast<char *
>(
MEM_callocN(size,
"BKE_key_evaluate_object out"));
1564 if (arr_size != size) {
1579 if (kb ==
nullptr) {
1587 cp_key(0, tot, tot, out, key, actkb, kb, weights, 0);
1612 if (obdata !=
nullptr) {
1613 switch (
GS(obdata->
name)) {
1616 const int totvert =
min_ii(tot, mesh->verts_num);
1617 mesh->vert_positions_for_write().take_front(totvert).copy_from(
1619 mesh->tag_positions_changed();
1642 return (
float *)out;
1655 kb = kb->next, index++)
1657 if (
ELEM(shape_index, -1, index)) {
1658 result += kb->totelem;
1691 kb = kb->
next, index++)
1693 if (
ELEM(shape_index, -1, index)) {
1694 const int block_elem_len = kb->totelem * key->
elemsize;
1695 memcpy(elements, kb->data, block_elem_len);
1696 elements += block_elem_len;
1707 const int shape_index,
1708 const float (*coords)[3],
1709 const float mat[4][4])
1711 if (key->
elemsize !=
sizeof(
float[3])) {
1716 const float(*elements)[3] = coords;
1720 if (
ELEM(shape_index, -1, index)) {
1721 const int block_elem_len = kb->totelem;
1722 float(*block_data)[3] = (
float(*)[3])kb->data;
1723 for (
int data_offset = 0; data_offset < block_elem_len; ++data_offset) {
1724 const float *src_data = (
const float *)(elements + data_offset);
1725 float *dst_data = (
float *)(block_data + data_offset);
1728 elements += block_elem_len;
1734 Key *key,
const ListBase *nurb,
const int shape_index,
const void *data,
const float mat[4][4])
1740 if (
ELEM(shape_index, -1, index)) {
1741 const int block_elem_size = kb->totelem * key->
elemsize;
1743 elements += block_elem_size;
1753 if (
ELEM(shape_index, -1, index)) {
1754 const int block_elem_size = kb->totelem * key->
elemsize;
1755 memcpy(kb->data, elements, block_elem_size);
1756 elements += block_elem_size;
1777 switch (
GS(id->name)) {
1784 if (cu->
vfont ==
nullptr) {
1813 if (ob ==
nullptr || ob->
data ==
nullptr) {
1834 float curpos = -0.1;
1842 kb = MEM_cnew<KeyBlock>(
"Keyblock");
1873 kb->
pos = curpos + 0.1f;
1881 const float cpos = key->
ctime / 100.0f;
1940 if (kb->uid == uid) {
1949 kb_dst->
pos = kb_src->
pos;
1960 if (
ELEM(
nullptr, key, kb)) {
1986 fp =
static_cast<float(*)[3]
>(kb->
data);
1987 for (a = 0; a < kb->
totelem; a++, fp++, bp++) {
2013 for (
int i = 0; i < totpoint; i++, fp++, bpoint++) {
2021 const float(*fp)[3] =
static_cast<const float(*)[3]
>(kb->
data);
2034 nu =
static_cast<const Nurb *
>(nurb->
first);
2063 fp =
static_cast<float *
>(kb->
data);
2066 for (a = nu->pntsu, bezt = nu->bezt; a; a--, bezt++) {
2067 for (
int i = 0; i < 3; i++) {
2076 for (a = nu->pntsu * nu->pntsv, bp = nu->bp; a; a--, bp++) {
2087 const float mat[4][4],
2088 const void *src_data,
2091 const float *src =
static_cast<const float *
>(src_data);
2092 float *dst =
static_cast<float *
>(dst_data);
2095 for (
int a = nu->pntsu; a; a--) {
2096 for (
int i = 0; i < 3; i++) {
2106 for (
int a = nu->pntsu * nu->pntsv; a; a--) {
2137 for (
Nurb *nu =
static_cast<Nurb *
>(nurb->
first); nu && totpoint > 0; nu = nu->next) {
2138 if (nu->bezt !=
nullptr) {
2143 for (
int j = 0; j < 3; j++) {
2165 const float *fp =
static_cast<const float *
>(kb->
data);
2177 const int tot = mesh->verts_num;
2183 memcpy(kb->
data, positions.data(),
sizeof(
float[3]) * tot);
2188 const int len = mesh->verts_num;
2190 if (mesh->verts_num == 0) {
2203 float (*vert_positions)[3],
2207 memcpy(vert_positions, kb->
data,
sizeof(
float[3]) * tot);
2212 float (*r_vert_normals)[3],
2213 float (*r_face_normals)[3],
2214 float (*r_loop_normals)[3])
2218 if (r_vert_normals ==
nullptr && r_face_normals ==
nullptr && r_loop_normals ==
nullptr) {
2224 kb,
reinterpret_cast<float(*)[3]
>(positions.data()), mesh->verts_num);
2230 const bool loop_normals_needed = r_loop_normals !=
nullptr;
2231 const bool vert_normals_needed = r_vert_normals !=
nullptr || loop_normals_needed;
2232 const bool face_normals_needed = r_face_normals !=
nullptr || vert_normals_needed ||
2233 loop_normals_needed;
2235 float(*vert_normals)[3] = r_vert_normals;
2236 float(*face_normals)[3] = r_face_normals;
2237 bool free_vert_normals =
false;
2238 bool free_face_normals =
false;
2239 if (vert_normals_needed && r_vert_normals ==
nullptr) {
2240 vert_normals =
static_cast<float(*)[3]
>(
2242 free_vert_normals =
true;
2244 if (face_normals_needed && r_face_normals ==
nullptr) {
2245 face_normals =
static_cast<float(*)[3]
>(
2247 free_face_normals =
true;
2250 if (face_normals_needed) {
2251 mesh::normals_calc_faces(positions,
2256 if (vert_normals_needed) {
2257 mesh::normals_calc_verts(
2261 mesh->vert_to_face_map(),
2262 {reinterpret_cast<const blender::float3 *>(face_normals), faces.size()},
2263 {reinterpret_cast<blender::float3 *>(vert_normals), mesh->verts_num});
2265 if (loop_normals_needed) {
2269 const VArraySpan sharp_edges = *attributes.lookup<
bool>(
"sharp_edge", AttrDomain::Edge);
2270 const VArraySpan sharp_faces = *attributes.lookup<
bool>(
"sharp_face", AttrDomain::Face);
2271 mesh::normals_calc_corners(
2277 mesh->corner_to_face_map(),
2278 {reinterpret_cast<blender::float3 *>(vert_normals), mesh->verts_num},
2279 {reinterpret_cast<blender::float3 *>(face_normals), faces.size()},
2284 {reinterpret_cast<blender::float3 *>(r_loop_normals), corner_verts.size()});
2287 if (free_vert_normals) {
2290 if (free_face_normals) {
2299 const float(*co)[3] = vertCos;
2300 float *fp =
static_cast<float *
>(kb->
data);
2328 for (a = 0; a < tot; a++, fp += 3, co++) {
2339 for (a = nu->pntsu, bezt = nu->bezt; a; a--, bezt++) {
2340 for (
int i = 0; i < 3; i++, co++) {
2347 for (a = nu->pntsu * nu->pntsv, bp = nu->bp; a; a--, bp++, co++) {
2358 int tot = 0, elemsize;
2365 tot = mesh->verts_num;
2366 elemsize = mesh->key->elemsize;
2391 float(*vertCos)[3], (*co)[3];
2392 const float *fp =
static_cast<const float *
>(kb->
data);
2398 tot = mesh->verts_num;
2413 co = vertCos =
static_cast<float(*)[3]
>(
MEM_mallocN(tot *
sizeof(*vertCos), __func__));
2417 for (a = 0; a < tot; a++, fp += 3, co++) {
2428 for (a = nu->pntsu, bezt = nu->bezt; a; a--, bezt++) {
2429 for (
int i = 0; i < 3; i++, co++) {
2436 for (a = nu->pntsu * nu->pntsv, bp = nu->bp; a; a--, bp++, co++) {
2450 float *fp =
static_cast<float *
>(kb->
data);
2453 for (a = 0; a < kb->
totelem; a++, fp += 3, ofs++) {
2464 for (a = nu->pntsu, bezt = nu->bezt; a; a--, bezt++) {
2465 for (
int i = 0; i < 3; i++, ofs++) {
2472 for (a = nu->pntsu * nu->pntsv, bp = nu->bp; a; a--, bp++, ofs++) {
2485 const int act_index = ob->
shapenr - 1;
2486 const int totkey = key->
totkey;
2488 bool rev, in_range =
false;
2490 if (org_index < 0) {
2491 org_index = act_index;
2497 if (new_index == org_index) {
2501 rev = ((new_index - org_index) < 0) ?
true :
false;
2507 i = (rev ? totkey - 1 : 0);
2509 kb = (rev ? kb->
prev : kb->
next), rev ? i-- : i++)
2511 if (i == org_index) {
2514 else if (i == new_index) {
2525 std::swap(kb->
pos, other_kb->
pos);
2546 if (org_index == act_index) {
2549 else if (act_index < org_index && act_index >= new_index) {
2552 else if (act_index > org_index && act_index <= new_index) {
2569 if ((i != index) && (kb->relative == index)) {
2582 return std::nullopt;
2587 if (index < 0 || index >=
count) {
2588 return std::nullopt;
2594 marked[index] =
true;
2598 bool updated, found =
false;
2607 updated = found =
true;
2613 return std::nullopt;
2617 marked[index] =
false;
int BKE_nurbList_verts_count(const ListBase *nurb)
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
const void * CustomData_get_layer(const CustomData *data, eCustomDataType type)
@ IDTYPE_FLAGS_NO_LIBLINKING
void outside_lattice(Lattice *lt)
void * BKE_id_new(Main *bmain, short type, const char *name)
void BKE_id_blend_write(BlendWriter *writer, ID *id)
int BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
@ IDWALK_DO_DEPRECATED_POINTERS
#define BKE_LIB_FOREACHID_PROCESS_ID(data_, id_, cb_flag_)
#define BKE_LIB_FOREACHID_PROCESS_ID_NOCHECK(data_, id_, cb_flag_)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
void BLI_endian_switch_float_array(float *val, int size) ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void void void void void void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src) ATTR_NONNULL(1
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_listbase_swaplinks(struct ListBase *listbase, void *vlinka, void *vlinkb) ATTR_NONNULL(1
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
MINLINE int compare_ff(float a, float b, float max_diff)
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
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)
MINLINE void add_v3_v3(float r[3], const float a[3])
#define STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
#define STRNCPY_UTF8(dst, src)
void BLI_uniquename(const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
#define UNUSED_VARS_NDEBUG(...)
#define BLO_read_data_address(reader, ptr_p)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
bool BLO_read_requires_endian_switch(BlendDataReader *reader)
#define BLO_read_struct_list(reader, struct_name, list)
void BLO_write_raw(BlendWriter *writer, size_t size_in_bytes, const void *data_ptr)
#define BLO_read_struct(reader, struct_name, ptr_p)
bool BLO_write_is_undo(BlendWriter *writer)
#define BLO_write_struct_at_address(writer, struct_name, address, data_ptr)
#define BLT_I18NCONTEXT_ID_SHAPEKEY
ID and Library types, which are fundamental for SDNA.
#define FILTER_ID_CU_LEGACY
#define ID_IS_OVERRIDE_LIBRARY(_id)
#define KEYELEM_FLOAT_LEN_COORD
#define KEYELEM_ELEM_LEN_BPOINT
#define KEYELEM_FLOAT_LEN_BEZTRIPLE
#define KEYELEM_ELEM_SIZE_CURVE
#define KEYELEM_FLOAT_LEN_BPOINT
#define KEYELEM_ELEM_LEN_BEZTRIPLE
Object is a sort of wrapper for general info.
#define OB_TYPE_SUPPORT_VGROUP(_type)
Read Guarded memory(de)allocation.
#define BM_ELEM_CD_GET_VOID_P(ele, offset)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
static void shapekey_blend_read_data(BlendDataReader *reader, ID *id)
void BKE_keyblock_data_set_with_mat4(Key *key, const int shape_index, const float(*coords)[3], const float mat[4][4])
void key_curve_normal_weights(float t, float data[4], int type)
static void key_evaluate_relative(const int start, int end, const int tot, char *basispoin, Key *key, KeyBlock *actkb, float **per_keyblock_weights, const int mode)
void BKE_keyblock_curve_data_transform(const ListBase *nurb, const float mat[4][4], const void *src_data, void *dst_data)
void BKE_keyblock_mesh_calc_normals(const KeyBlock *kb, Mesh *mesh, float(*r_vert_normals)[3], float(*r_face_normals)[3], float(*r_loop_normals)[3])
KeyBlock * BKE_keyblock_from_object(Object *ob)
static void flerp(int tot, float *in, const float *f0, const float *f1, const float *f2, const float *f3, const float *t)
void BKE_keyblock_convert_to_lattice(const KeyBlock *kb, Lattice *lt)
Key ** BKE_key_from_id_p(ID *id)
std::optional< std::string > BKE_keyblock_curval_rnapath_get(const Key *key, const KeyBlock *kb)
static ID ** shapekey_owner_pointer_get(ID *id, const bool debug_relationship_assert)
void BKE_keyblock_curve_data_set_with_mat4(Key *key, const ListBase *nurb, const int shape_index, const void *data, const float mat[4][4])
size_t BKE_keyblock_element_calc_size_from_shape(const Key *key, const int shape_index)
void BKE_key_free_nolib(Key *key)
int BKE_keyblock_element_count_from_shape(const Key *key, const int shape_index)
Key * BKE_key_add(Main *bmain, ID *id)
std::optional< blender::Array< bool > > BKE_keyblock_get_dependent_keys(const Key *key, const int index)
bool BKE_key_idtype_support(const short id_type)
static void keyblock_free_per_block_weights(Key *key, float **per_keyblock_weights, WeightsArrayCache *cache)
KeyBlock * BKE_keyblock_add(Key *key, const char *name)
KeyBlock * BKE_keyblock_from_object_reference(Object *ob)
bool BKE_keyblock_move(Object *ob, int org_index, int new_index)
void BKE_keyblock_update_from_mesh(const Mesh *mesh, KeyBlock *kb)
static void shapekey_foreach_id(ID *id, LibraryForeachIDData *data)
static float * get_weights_array(Object *ob, char *vgroup, WeightsArrayCache *cache)
static bool key_pointer_size(const Key *key, const int mode, int *r_poinsize, int *r_ofs, int *r_step)
void BKE_keyblock_data_set(Key *key, const int shape_index, const void *data)
static void do_rel_cu_key(Curve *cu, Key *key, KeyBlock *actkb, char *out, const int tot)
void BKE_key_free_data(Key *key)
void BKE_keyblock_update_from_offset(const Object *ob, KeyBlock *kb, const float(*ofs)[3])
void BKE_keyblock_convert_to_curve(KeyBlock *kb, Curve *, ListBase *nurb)
static void do_key(const int start, int end, const int tot, char *poin, Key *key, KeyBlock *actkb, KeyBlock **k, float *t, const int mode)
KeyBlock * BKE_keyblock_add_ctime(Key *key, const char *name, const bool do_force)
int BKE_keyblock_curve_element_count(const ListBase *nurb)
void BKE_keyblock_data_get(const Key *key, float(*arr)[3])
void BKE_keyblock_convert_from_mesh(const Mesh *mesh, const Key *key, KeyBlock *kb)
static void switch_endian_keyblock(Key *key, KeyBlock *kb)
static void shapekey_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
size_t BKE_keyblock_element_calc_size(const Key *key)
void BKE_keyblock_update_from_curve(const Curve *, KeyBlock *kb, const ListBase *nurb)
float * BKE_key_evaluate_object_ex(Object *ob, int *r_totelem, float *arr, size_t arr_size, ID *obdata)
KeyBlock * BKE_keyblock_find_by_index(Key *key, int index)
static void do_curve_key(Object *ob, Key *key, char *out, const int tot)
void BKE_keyblock_copy_settings(KeyBlock *kb_dst, const KeyBlock *kb_src)
copy shape-key attributes, but not key data or name/UID.
void BKE_keyblock_convert_from_curve(const Curve *cu, KeyBlock *kb, const ListBase *nurb)
#define KEY_MODE_BEZTRIPLE
void key_curve_tangent_weights(float t, float data[4], int type)
KeyBlock * BKE_keyblock_find_name(Key *key, const char name[])
void BKE_keyblock_convert_from_lattice(const Lattice *lt, KeyBlock *kb)
static void keyblock_data_convert_to_curve(const float *fp, ListBase *nurb, const int totpoint)
float * BKE_key_evaluate_object(Object *ob, int *r_totelem)
static void do_mesh_key(Object *ob, Key *key, char *out, const int tot)
static char * key_block_get_data(Key *key, KeyBlock *actkb, KeyBlock *kb, char **freedata)
static void keyblock_data_convert_to_lattice(const float(*fp)[3], BPoint *bpoint, const int totpoint)
static void do_latt_key(Object *ob, Key *key, char *out, const int tot)
static void cp_key(const int start, int end, const int tot, char *poin, Key *key, KeyBlock *actkb, KeyBlock *kb, float *weights, const int mode)
static void shapekey_blend_write(BlendWriter *writer, ID *id, const void *id_address)
void BKE_keyblock_update_from_lattice(const Lattice *lt, KeyBlock *kb)
int BKE_keyblock_element_count(const Key *key)
static void rel_flerp(int tot, float *in, const float *ref, const float *out, float fac)
static float ** keyblock_get_per_block_weights(Object *ob, Key *key, WeightsArrayCache *cache)
void BKE_keyblock_convert_to_mesh(const KeyBlock *kb, float(*vert_positions)[3], const int totvert)
Key ** BKE_key_from_object_p(Object *ob)
void BKE_keyblock_convert_from_vertcos(const Object *ob, KeyBlock *kb, const float(*vertCos)[3])
static void do_cu_key(Curve *cu, Key *key, KeyBlock *actkb, KeyBlock **k, float *t, char *out, const int tot)
Key * BKE_key_from_id(ID *id)
KeyBlock * BKE_keyblock_find_uid(Key *key, const int uid)
static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float t[4], int cycl)
void BKE_key_sort(Key *key)
bool BKE_keyblock_is_basis(const Key *key, const int index)
void BKE_keyblock_update_from_vertcos(const Object *ob, KeyBlock *kb, const float(*vertCos)[3])
static void cp_cu_key(Curve *cu, Key *key, KeyBlock *actkb, KeyBlock *kb, const int start, int end, char *out, const int tot)
Key * BKE_key_from_object(Object *ob)
float(* BKE_keyblock_convert_to_vertcos(const Object *ob, const KeyBlock *kb))[3]
static void shapekey_free_data(ID *id)
void key_curve_position_weights(float t, float data[4], int type)
void BKE_keyblock_data_get_from_shape(const Key *key, float(*arr)[3], const int shape_index)
static void shapekey_blend_read_after_liblink(BlendLibReader *, ID *id)
void *(* MEM_mallocN)(size_t len, const char *str)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_dupallocN)(const void *vmemh)
ccl_device_inline float2 floor(const float2 a)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
std::optional< std::string > RNA_path_from_ID_to_property(const PointerRNA *ptr, PropertyRNA *prop)
struct MDeformVert * dvert
float ** defgroup_weights