29#define DNA_DEPRECATED_ALLOW
56#include "RNA_prototypes.hh"
66 std::optional<Library *> ,
71 Key *key_dst = (
Key *)id_dst;
72 const Key *key_src = (
const Key *)id_src;
79 kb_src = kb_src->
next, kb_dst = kb_dst->
next)
84 if (kb_src == key_src->
refkey) {
103 Key *key =
reinterpret_cast<Key *
>(id);
117 if (debug_relationship_assert) {
140 tmp_kb.
data =
nullptr;
143 if (tmp_kb.
data !=
nullptr) {
151#define IPO_BEZTRIPLE 100
152#define IPO_BPOINT 101
157 char *
data =
static_cast<char *
>(kb->
data);
159 for (
int a = 0; a < kb->
totelem; a++) {
170 poin +=
sizeof(float) *
b;
238#define KEY_MODE_DUMMY 0
239#define KEY_MODE_BPOINT 1
240#define KEY_MODE_BEZTRIPLE 2
328 if (kb2->pos > kb->
pos) {
357 data[0] = -fc * t3 + 2.0f * fc * t2 - fc * t;
358 data[1] = (2.0f - fc) * t3 + (fc - 3.0f) * t2 + 1.0f;
359 data[2] = (fc - 2.0f) * t3 + (3.0f - 2.0f * fc) * t2 + fc * t;
360 data[3] = fc * t3 - fc * t2;
366 data[0] = -0.16666666f * t3 + 0.5f * t2 - 0.5f * t + 0.16666666f;
367 data[1] = 0.5f * t3 - t2 + 0.66666666f;
368 data[2] = -0.5f * t3 + 0.5f * t2 + 0.5f * t + 0.16666666f;
369 data[3] = 0.16666666f * t3;
376 data[0] = -fc * t3 + 2.0f * fc * t2 - fc * t;
377 data[1] = (2.0f - fc) * t3 + (fc - 3.0f) * t2 + 1.0f;
378 data[2] = (fc - 2.0f) * t3 + (3.0f - 2.0f * fc) * t2 + fc * t;
379 data[3] = fc * t3 - fc * t2;
399 data[0] = -3.0f * fc * t2 + 4.0f * fc * t - fc;
400 data[1] = 3.0f * (2.0f - fc) * t2 + 2.0f * (fc - 3.0f) * t;
401 data[2] = 3.0f * (fc - 2.0f) * t2 + 2.0f * (3.0f - 2.0f * fc) * t + fc;
402 data[3] = 3.0f * fc * t2 - 2.0f * fc * t;
407 data[0] = -0.5f * t2 + t - 0.5f;
408 data[1] = 1.5f * t2 - t * 2.0f;
409 data[2] = -1.5f * t2 + t + 0.5f;
416 data[0] = -3.0f * fc * t2 + 4.0f * fc * t - fc;
417 data[1] = 3.0f * (2.0f - fc) * t2 + 2.0f * (fc - 3.0f) * t;
418 data[2] = 3.0f * (fc - 2.0f) * t2 + 2.0f * (3.0f - 2.0f * fc) * t + fc;
419 data[3] = 3.0f * fc * t2 - 2.0f * fc * t;
438 data[0] = -6.0f * fc * t + 4.0f * fc;
439 data[1] = 6.0f * (2.0f - fc) * t + 2.0f * (fc - 3.0f);
440 data[2] = 6.0f * (fc - 2.0f) * t + 2.0f * (3.0f - 2.0f * fc);
441 data[3] = 6.0f * fc * t - 2.0f * fc;
444 data[0] = -1.0f * t + 1.0f;
445 data[1] = 3.0f * t - 2.0f;
446 data[2] = -3.0f * t + 1.0f;
452 data[0] = -6.0f * fc * t + 4.0f * fc;
453 data[1] = 6.0f * (2.0f - fc) * t + 2.0f * (fc - 3.0f);
454 data[2] = 6.0f * (fc - 2.0f) * t + 2.0f * (3.0f - 2.0f * fc);
455 data[3] = 6.0f * fc * t - 2.0f * fc;
464 float d, dpos, ofs = 0, lastpos;
470 dpos = lastpos - firstkey->
pos;
472 if (fac < firstkey->
pos) {
475 else if (fac > k1->
pos) {
479 k1 = k[0] = k[1] = k[2] = k[3] = firstkey;
480 t[0] = t[1] = t[2] = t[3] = k1->
pos;
483 if (fac < 0.0 || fac > 1.0) {
488 if (k1->
next ==
nullptr) {
495 if (k[3] ==
nullptr) {
499 if (k1->
next ==
nullptr) {
507 t[2] = k[2]->
pos + dpos;
508 t[3] = k[3]->
pos + dpos;
524 if (k[3] ==
nullptr) {
532 if (k1->
next ==
nullptr) {
537 else if (t[2] == t[3]) {
551 t[3] = k1->
pos + ofs;
554 if (ofs > 2.1f + lastpos) {
565 if (bsplinetype == 0) {
575 else if (fac > t[2]) {
584 if (bsplinetype == 0) {
589 d = (fac - t[1]) / d;
595 if (k[1]->type != k[2]->type) {
614 for (a = 0; a < tot; a++) {
615 in[a] = t[0] * f0[a] + t[1] * f1[a] + t[2] * f2[a] + t[3] * f3[a];
619static void rel_flerp(
int tot,
float *
in,
const float *ref,
const float *
out,
float fac)
623 for (a = 0; a < tot; a++) {
624 in[a] -= fac * (ref[a] -
out[a]);
645 "key_block_get_data");
652 *freedata = (
char *)co;
659 return static_cast<char *
>(kb->
data);
664 const Key *key,
const int mode,
int *r_poinsize,
int *r_ofs,
int *r_step)
666 if (key->
from ==
nullptr) {
675 *r_poinsize = *r_ofs;
679 *r_poinsize = *r_ofs;
710 float ktot = 0.0, kd = 0.0;
711 int elemsize, poinsize = 0, a,
step, *ofsp, ofs[32], flagflo = 0;
712 char *k1, *kref, *freek1, *freekref;
713 char *cp, elemstr[8];
722 end = std::min(end, tot);
741 poin += poinsize * start;
745 a = int(
floor(ktot));
765 for (a = start; a < end; a +=
step) {
779 if (*weights != 0.0f) {
815 while (ktot >= 1.0f) {
881 float **per_keyblock_weights,
885 int *ofsp, ofs[3], elemsize,
b,
step;
886 char *cp, *poin, *reffrom, *from, elemstr[8];
887 int poinsize, keyblock_index;
896 end = std::min(end, tot);
907 cp_key(start, end, tot, basispoin, key, actkb, key->
refkey,
nullptr, mode);
912 kb = kb->
next, keyblock_index++)
915 float icuval = kb->
curval;
921 *weights = per_keyblock_weights ? per_keyblock_weights[keyblock_index] :
nullptr;
922 char *freefrom =
nullptr;
926 if (refb ==
nullptr) {
935 reffrom =
static_cast<char *
>(refb->
data);
937 poin += start * poinsize;
941 for (
b = start;
b < end;
b +=
step) {
943 weight = weights ? (*weights * icuval) : icuval;
1017 float k1tot = 0.0, k2tot = 0.0, k3tot = 0.0, k4tot = 0.0;
1018 float k1d = 0.0, k2d = 0.0, k3d = 0.0, k4d = 0.0;
1019 int a,
step, ofs[32], *ofsp;
1020 int flagdo = 15, flagflo = 0, elemsize, poinsize = 0;
1021 char *k1, *k2, *k3, *k4, *freek1, *freek2, *freek3, *freek4;
1022 char *cp, elemstr[8];
1031 end = std::min(end, tot);
1039 if (tot != k[0]->totelem) {
1042 if (k[0]->totelem) {
1043 k1d = k[0]->
totelem / float(tot);
1049 if (tot != k[1]->totelem) {
1052 if (k[0]->totelem) {
1053 k2d = k[1]->
totelem / float(tot);
1059 if (tot != k[2]->totelem) {
1062 if (k[0]->totelem) {
1063 k3d = k[2]->
totelem / float(tot);
1069 if (tot != k[3]->totelem) {
1072 if (k[0]->totelem) {
1073 k4d = k[3]->
totelem / float(tot);
1083 poin += poinsize * start;
1087 k1tot += start * k1d;
1088 a = int(
floor(k1tot));
1100 k2tot += start * k2d;
1101 a = int(
floor(k2tot));
1113 k3tot += start * k3d;
1114 a = int(
floor(k3tot));
1126 k4tot += start * k4d;
1127 a = int(
floor(k4tot));
1147 for (a = start; a < end; a +=
step) {
1211 while (k1tot >= 1.0f) {
1223 while (k2tot >= 1.0f) {
1235 while (k3tot >= 1.0f) {
1247 while (k4tot >= 1.0f) {
1278 int totvert = 0, defgrp_index = 0;
1281 if (vgroup[0] == 0) {
1288 dvert = mesh->deform_verts().data();
1291 if (mesh->
runtime->edit_mesh && mesh->
runtime->edit_mesh->bm->totvert == totvert) {
1292 em = mesh->
runtime->edit_mesh.get();
1301 if (dvert ==
nullptr) {
1307 if (defgrp_index != -1) {
1314 "cached defgroup weights");
1334 for (
int i = 0;
i < totvert;
i++, dvert++) {
1351 float **per_keyblock_weights;
1356 for (keyblock =
static_cast<KeyBlock *
>(key->
block.
first), keyblock_index = 0; keyblock;
1357 keyblock = keyblock->
next, keyblock_index++)
1362 return per_keyblock_weights;
1366 float **per_keyblock_weights,
1383 for (a = 0; a < key->
totkey; a++) {
1384 if (per_keyblock_weights[a]) {
1401 float **per_keyblock_weights;
1407 const float ctime_scaled = key->
ctime / 100.0f;
1431 else if (nu->
bezt) {
1451 else if (nu->
bezt) {
1472 const float ctime_scaled = key->
ctime / 100.0f;
1493 float **per_keyblock_weights;
1499 const float ctime_scaled = key->
ctime / 100.0f;
1518 const int totpoint);
1522 Object *ob,
int *r_totelem,
float *arr,
size_t arr_size,
ID *obdata)
1527 int tot = 0,
size = 0;
1554 if (tot == 0 ||
size == 0) {
1559 if (arr ==
nullptr) {
1563 if (arr_size !=
size) {
1578 if (kb ==
nullptr) {
1586 cp_key(0, tot, tot,
out, key, actkb, kb, weights, 0);
1611 if (obdata !=
nullptr) {
1612 switch (
GS(obdata->
name)) {
1616 mesh->vert_positions_for_write().take_front(totvert).copy_from(
1618 mesh->tag_positions_changed();
1641 return (
float *)
out;
1654 kb = kb->
next, index++)
1656 if (
ELEM(shape_index, -1, index)) {
1687 const int shape_index)
1689 uint8_t *elements = (uint8_t *)arr.
data();
1692 kb = kb->
next, index++)
1694 if (
ELEM(shape_index, -1, index)) {
1695 const int block_elem_len = kb->totelem * key->
elemsize;
1696 memcpy(elements, kb->data, block_elem_len);
1697 elements += block_elem_len;
1708 const int shape_index,
1712 if (key->
elemsize !=
sizeof(
float[3])) {
1721 if (
ELEM(shape_index, -1, index)) {
1722 const int block_elem_len = kb->totelem;
1723 float(*block_data)[3] = (float(*)[3])kb->data;
1724 for (
int data_offset = 0; data_offset < block_elem_len; ++data_offset) {
1725 const float *src_data = (
const float *)(elements + data_offset);
1726 float *dst_data = (
float *)(block_data + data_offset);
1729 elements += block_elem_len;
1736 const int shape_index,
1740 const uint8_t *elements =
static_cast<const uint8_t *
>(
data);
1744 if (
ELEM(shape_index, -1, index)) {
1745 const int block_elem_size = kb->totelem * key->
elemsize;
1747 elements += block_elem_size;
1754 const uint8_t *elements =
static_cast<const uint8_t *
>(
data);
1757 if (
ELEM(shape_index, -1, index)) {
1758 const int block_elem_size = kb->totelem * key->
elemsize;
1759 memcpy(kb->data, elements, block_elem_size);
1760 elements += block_elem_size;
1817 if (ob ==
nullptr || ob->
data ==
nullptr) {
1838 float curpos = -0.1;
1877 kb->
pos = curpos + 0.1f;
1898 const float cpos = key->
ctime / 100.0f;
1957 if (kb->uid == uid) {
1966 kb_dst->
pos = kb_src->
pos;
1977 if (
ELEM(
nullptr, key, kb)) {
1978 return std::nullopt;
2003 fp =
static_cast<float(*)[3]
>(kb->
data);
2004 for (a = 0; a < kb->
totelem; a++, fp++, bp++) {
2030 for (
int i = 0;
i < totpoint;
i++, fp++, bpoint++) {
2038 const float(*fp)[3] =
static_cast<const float(*)[3]
>(kb->
data);
2051 nu =
static_cast<const Nurb *
>(nurb->
first);
2080 fp =
static_cast<float *
>(kb->
data);
2083 for (a = nu->pntsu, bezt = nu->bezt; a; a--, bezt++) {
2084 for (
int i = 0;
i < 3;
i++) {
2093 for (a = nu->pntsu * nu->pntsv, bp = nu->bp; a; a--, bp++) {
2104 const float mat[4][4],
2105 const void *src_data,
2108 const float *src =
static_cast<const float *
>(src_data);
2109 float *dst =
static_cast<float *
>(dst_data);
2112 for (
int a = nu->pntsu; a; a--) {
2113 for (
int i = 0;
i < 3;
i++) {
2123 for (
int a = nu->pntsu * nu->pntsv; a; a--) {
2154 for (
Nurb *nu =
static_cast<Nurb *
>(nurb->
first); nu && totpoint > 0; nu = nu->
next) {
2155 if (nu->bezt !=
nullptr) {
2160 for (
int j = 0; j < 3; j++) {
2182 const float *fp =
static_cast<const float *
>(kb->
data);
2200 memcpy(kb->
data, positions.
data(),
sizeof(
float[3]) * tot);
2228 float (*r_vert_normals)[3],
2229 float (*r_face_normals)[3],
2230 float (*r_loop_normals)[3])
2234 if (r_vert_normals ==
nullptr && r_face_normals ==
nullptr && r_loop_normals ==
nullptr) {
2244 const bool loop_normals_needed = r_loop_normals !=
nullptr;
2245 const bool vert_normals_needed = r_vert_normals !=
nullptr;
2246 const bool face_normals_needed = r_face_normals !=
nullptr || vert_normals_needed ||
2247 loop_normals_needed;
2249 float(*vert_normals)[3] = r_vert_normals;
2250 float(*face_normals)[3] = r_face_normals;
2251 bool free_vert_normals =
false;
2252 bool free_face_normals =
false;
2253 if (vert_normals_needed && r_vert_normals ==
nullptr) {
2255 free_vert_normals =
true;
2257 if (face_normals_needed && r_face_normals ==
nullptr) {
2259 free_face_normals =
true;
2262 if (face_normals_needed) {
2268 if (vert_normals_needed) {
2273 mesh->vert_to_face_map(),
2274 {reinterpret_cast<const blender::float3 *>(face_normals), faces.size()},
2275 {reinterpret_cast<blender::float3 *>(vert_normals), mesh->verts_num});
2277 if (loop_normals_needed) {
2288 mesh->vert_to_face_map(),
2289 {reinterpret_cast<blender::float3 *>(face_normals), faces.size()},
2294 {reinterpret_cast<blender::float3 *>(r_loop_normals), corner_verts.size()});
2297 if (free_vert_normals) {
2300 if (free_face_normals) {
2311 const int act_index = ob->
shapenr - 1;
2312 const int totkey = key->
totkey;
2314 bool rev, in_range =
false;
2316 if (org_index < 0) {
2317 org_index = act_index;
2323 if (new_index == org_index) {
2327 rev = ((new_index - org_index) < 0) ?
true :
false;
2333 i = (rev ? totkey - 1 : 0);
2335 kb = (rev ? kb->
prev : kb->
next), rev ?
i-- :
i++)
2337 if (
i == org_index) {
2340 else if (
i == new_index) {
2351 std::swap(kb->
pos, other_kb->
pos);
2372 if (org_index == act_index) {
2375 else if (act_index < org_index && act_index >= new_index) {
2378 else if (act_index > org_index && act_index <= new_index) {
2395 if ((
i != index) && (kb->
relative == index)) {
2408 return std::nullopt;
2413 if (index < 0 || index >=
count) {
2414 return std::nullopt;
2420 marked[index] =
true;
2424 bool updated, found =
false;
2433 updated = found =
true;
2439 return std::nullopt;
2443 marked[index] =
false;
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
@ IDTYPE_FLAGS_NO_LIBLINKING
int BKE_keyblock_curve_element_count(const ListBase *nurb)
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)
#define BKE_LIB_FOREACHID_PROCESS_ID(data_, id_, cb_flag_)
LibraryForeachIDFlag BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
@ IDWALK_DO_DEPRECATED_POINTERS
#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)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_listbase_swaplinks(ListBase *listbase, void *vlinka, void *vlinkb) ATTR_NONNULL(1
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) ATTR_NONNULL(1
void * BLI_pophead(ListBase *listbase) 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)
#define SNPRINTF(dst, format,...)
char * STRNCPY(char(&dst)[N], const char *src)
#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 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)
BMesh const char void * data
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
constexpr T * data() const
constexpr void copy_from(Span< T > values) const
constexpr MutableSpan take_front(const int64_t n) const
constexpr const T * data() const
GAttributeReader lookup(const StringRef attribute_id) const
VecBase< short, 2 > short2
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
#define FILTER_ID_CU_LEGACY
#define ID_IS_OVERRIDE_LIBRARY(_id)
static void shapekey_blend_read_data(BlendDataReader *reader, ID *id)
void BKE_keyblock_curve_data_set_with_mat4(Key *key, const ListBase *nurb, const int shape_index, const void *data, const float4x4 &transform)
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)
static float * get_weights_array(Object *ob, const char *vgroup, WeightsArrayCache *cache)
size_t BKE_keyblock_element_calc_size_from_shape(const Key *key, const int shape_index)
void BKE_key_free_nolib(Key *key)
void BKE_keyblock_data_get_from_shape(const Key *key, MutableSpan< float3 > arr, const int shape_index)
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)
void BKE_keyblock_data_get(const Key *key, MutableSpan< float3 > arr)
KeyBlock * BKE_keyblock_add(Key *key, const char *name)
KeyBlock * BKE_keyblock_from_object_reference(Object *ob)
void BKE_keyblock_convert_to_mesh(const KeyBlock *kb, blender::MutableSpan< blender::float3 > vert_positions)
KeyBlock * BKE_keyblock_duplicate(Key *key, KeyBlock *kb_src)
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 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_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_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
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)
Key ** BKE_key_from_object_p(Object *ob)
void BKE_keyblock_data_set_with_mat4(Key *key, const int shape_index, const Span< float3 > coords, const float4x4 &transform)
static void do_cu_key(Curve *cu, Key *key, KeyBlock *actkb, KeyBlock **k, float *t, char *out, const int tot)
void key_curve_position_weights(float t, float data[4], KeyInterpolationType type)
Key * BKE_key_from_id(ID *id)
KeyBlock * BKE_keyblock_find_uid(Key *key, const int uid)
void key_curve_tangent_weights(float t, float data[4], KeyInterpolationType type)
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)
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)
static void shapekey_free_data(ID *id)
void key_curve_normal_weights(float t, float data[4], KeyInterpolationType type)
static void shapekey_blend_read_after_liblink(BlendLibReader *, ID *id)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
void normals_calc_corners(Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, Span< int > corner_edges, GroupedSpan< int > vert_to_face_map, Span< float3 > face_normals, Span< bool > sharp_edges, Span< bool > sharp_faces, Span< short2 > custom_normals, CornerNormalSpaceArray *r_fan_spaces, MutableSpan< float3 > r_corner_normals)
void normals_calc_verts(Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, GroupedSpan< int > vert_to_face_map, Span< float3 > face_normals, MutableSpan< float3 > vert_normals)
void normals_calc_faces(Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, MutableSpan< float3 > face_normals)
MatBase< float, 4, 4 > float4x4
VecBase< float, 3 > float3
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
std::optional< std::string > RNA_path_from_ID_to_property(const PointerRNA *ptr, PropertyRNA *prop)
struct MDeformVert * dvert
MeshRuntimeHandle * runtime
float ** defgroup_weights