28#define DNA_DEPRECATED_ALLOW
55#include "RNA_prototypes.hh"
65 std::optional<Library *> ,
70 Key *key_dst = (
Key *)id_dst;
71 const Key *key_src = (
const Key *)id_src;
78 kb_src = kb_src->
next, kb_dst = kb_dst->
next)
83 if (kb_src == key_src->
refkey) {
102 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
205#define KEY_MODE_DUMMY 0
206#define KEY_MODE_BPOINT 1
207#define KEY_MODE_BEZTRIPLE 2
295 if (kb2->pos > kb->
pos) {
324 data[0] = -fc * t3 + 2.0f * fc * t2 - fc * t;
325 data[1] = (2.0f - fc) * t3 + (fc - 3.0f) * t2 + 1.0f;
326 data[2] = (fc - 2.0f) * t3 + (3.0f - 2.0f * fc) * t2 + fc * t;
327 data[3] = fc * t3 - fc * t2;
333 data[0] = -0.16666666f * t3 + 0.5f * t2 - 0.5f * t + 0.16666666f;
334 data[1] = 0.5f * t3 - t2 + 0.66666666f;
335 data[2] = -0.5f * t3 + 0.5f * t2 + 0.5f * t + 0.16666666f;
336 data[3] = 0.16666666f * t3;
343 data[0] = -fc * t3 + 2.0f * fc * t2 - fc * t;
344 data[1] = (2.0f - fc) * t3 + (fc - 3.0f) * t2 + 1.0f;
345 data[2] = (fc - 2.0f) * t3 + (3.0f - 2.0f * fc) * t2 + fc * t;
346 data[3] = fc * t3 - fc * t2;
366 data[0] = -3.0f * fc * t2 + 4.0f * fc * t - fc;
367 data[1] = 3.0f * (2.0f - fc) * t2 + 2.0f * (fc - 3.0f) * t;
368 data[2] = 3.0f * (fc - 2.0f) * t2 + 2.0f * (3.0f - 2.0f * fc) * t + fc;
369 data[3] = 3.0f * fc * t2 - 2.0f * fc * t;
374 data[0] = -0.5f * t2 + t - 0.5f;
375 data[1] = 1.5f * t2 - t * 2.0f;
376 data[2] = -1.5f * t2 + t + 0.5f;
383 data[0] = -3.0f * fc * t2 + 4.0f * fc * t - fc;
384 data[1] = 3.0f * (2.0f - fc) * t2 + 2.0f * (fc - 3.0f) * t;
385 data[2] = 3.0f * (fc - 2.0f) * t2 + 2.0f * (3.0f - 2.0f * fc) * t + fc;
386 data[3] = 3.0f * fc * t2 - 2.0f * fc * t;
405 data[0] = -6.0f * fc * t + 4.0f * fc;
406 data[1] = 6.0f * (2.0f - fc) * t + 2.0f * (fc - 3.0f);
407 data[2] = 6.0f * (fc - 2.0f) * t + 2.0f * (3.0f - 2.0f * fc);
408 data[3] = 6.0f * fc * t - 2.0f * fc;
411 data[0] = -1.0f * t + 1.0f;
412 data[1] = 3.0f * t - 2.0f;
413 data[2] = -3.0f * t + 1.0f;
419 data[0] = -6.0f * fc * t + 4.0f * fc;
420 data[1] = 6.0f * (2.0f - fc) * t + 2.0f * (fc - 3.0f);
421 data[2] = 6.0f * (fc - 2.0f) * t + 2.0f * (3.0f - 2.0f * fc);
422 data[3] = 6.0f * fc * t - 2.0f * fc;
431 float d, dpos, ofs = 0, lastpos;
437 dpos = lastpos - firstkey->
pos;
439 if (fac < firstkey->
pos) {
442 else if (fac > k1->
pos) {
446 k1 = k[0] = k[1] = k[2] = k[3] = firstkey;
447 t[0] = t[1] = t[2] = t[3] = k1->
pos;
450 if (fac < 0.0 || fac > 1.0) {
455 if (k1->
next ==
nullptr) {
462 if (k[3] ==
nullptr) {
466 if (k1->
next ==
nullptr) {
474 t[2] = k[2]->
pos + dpos;
475 t[3] = k[3]->
pos + dpos;
491 if (k[3] ==
nullptr) {
499 if (k1->
next ==
nullptr) {
504 else if (t[2] == t[3]) {
518 t[3] = k1->
pos + ofs;
521 if (ofs > 2.1f + lastpos) {
532 if (bsplinetype == 0) {
542 else if (fac > t[2]) {
551 if (bsplinetype == 0) {
556 d = (fac - t[1]) / d;
562 if (k[1]->type != k[2]->type) {
581 for (a = 0; a < tot; a++) {
582 in[a] = t[0] * f0[a] + t[1] * f1[a] + t[2] * f2[a] + t[3] * f3[a];
586static void rel_flerp(
int tot,
float *
in,
const float *ref,
const float *
out,
float fac)
590 for (a = 0; a < tot; a++) {
591 in[a] -= fac * (ref[a] -
out[a]);
612 "key_block_get_data");
619 *freedata = (
char *)co;
626 return static_cast<char *
>(kb->
data);
631 const Key *key,
const int mode,
int *r_poinsize,
int *r_ofs,
int *r_step)
633 if (key->
from ==
nullptr) {
642 *r_poinsize = *r_ofs;
646 *r_poinsize = *r_ofs;
677 float ktot = 0.0, kd = 0.0;
678 int elemsize, poinsize = 0, a,
step, *ofsp, ofs[32], flagflo = 0;
679 char *k1, *kref, *freek1, *freekref;
680 char *cp, elemstr[8];
689 end = std::min(end, tot);
708 poin += poinsize * start;
712 a = int(
floor(ktot));
732 for (a = start; a < end; a +=
step) {
746 if (*weights != 0.0f) {
782 while (ktot >= 1.0f) {
848 float **per_keyblock_weights,
852 int *ofsp, ofs[3], elemsize,
b,
step;
853 char *cp, *poin, *reffrom, *from, elemstr[8];
854 int poinsize, keyblock_index;
863 end = std::min(end, tot);
874 cp_key(start, end, tot, basispoin, key, actkb, key->
refkey,
nullptr, mode);
879 kb = kb->
next, keyblock_index++)
882 float icuval = kb->
curval;
888 *weights = per_keyblock_weights ? per_keyblock_weights[keyblock_index] :
nullptr;
889 char *freefrom =
nullptr;
893 if (refb ==
nullptr) {
902 reffrom =
static_cast<char *
>(refb->
data);
904 poin += start * poinsize;
908 for (
b = start;
b < end;
b +=
step) {
910 weight = weights ? (*weights * icuval) : icuval;
984 float k1tot = 0.0, k2tot = 0.0, k3tot = 0.0, k4tot = 0.0;
985 float k1d = 0.0, k2d = 0.0, k3d = 0.0, k4d = 0.0;
986 int a,
step, ofs[32], *ofsp;
987 int flagdo = 15, flagflo = 0, elemsize, poinsize = 0;
988 char *k1, *k2, *k3, *k4, *freek1, *freek2, *freek3, *freek4;
989 char *cp, elemstr[8];
998 end = std::min(end, tot);
1006 if (tot != k[0]->totelem) {
1009 if (k[0]->totelem) {
1016 if (tot != k[1]->totelem) {
1019 if (k[0]->totelem) {
1026 if (tot != k[2]->totelem) {
1029 if (k[0]->totelem) {
1036 if (tot != k[3]->totelem) {
1039 if (k[0]->totelem) {
1050 poin += poinsize * start;
1054 k1tot += start * k1d;
1055 a = int(
floor(k1tot));
1067 k2tot += start * k2d;
1068 a = int(
floor(k2tot));
1080 k3tot += start * k3d;
1081 a = int(
floor(k3tot));
1093 k4tot += start * k4d;
1094 a = int(
floor(k4tot));
1114 for (a = start; a < end; a +=
step) {
1178 while (k1tot >= 1.0f) {
1190 while (k2tot >= 1.0f) {
1202 while (k3tot >= 1.0f) {
1214 while (k4tot >= 1.0f) {
1245 int totvert = 0, defgrp_index = 0;
1248 if (vgroup[0] == 0) {
1255 dvert = mesh->deform_verts().data();
1258 if (mesh->
runtime->edit_mesh && mesh->
runtime->edit_mesh->bm->totvert == totvert) {
1259 em = mesh->
runtime->edit_mesh.get();
1268 if (dvert ==
nullptr) {
1274 if (defgrp_index != -1) {
1281 "cached defgroup weights");
1301 for (
int i = 0;
i < totvert;
i++, dvert++) {
1318 float **per_keyblock_weights;
1323 for (keyblock =
static_cast<KeyBlock *
>(key->
block.
first), keyblock_index = 0; keyblock;
1324 keyblock = keyblock->
next, keyblock_index++)
1329 return per_keyblock_weights;
1333 float **per_keyblock_weights,
1350 for (a = 0; a < key->
totkey; a++) {
1351 if (per_keyblock_weights[a]) {
1368 float **per_keyblock_weights;
1374 const float ctime_scaled = key->
ctime / 100.0f;
1398 else if (nu->
bezt) {
1418 else if (nu->
bezt) {
1439 const float ctime_scaled = key->
ctime / 100.0f;
1460 float **per_keyblock_weights;
1466 const float ctime_scaled = key->
ctime / 100.0f;
1485 const int totpoint);
1489 Object *ob,
int *r_totelem,
float *arr,
size_t arr_size,
ID *obdata)
1494 int tot = 0,
size = 0;
1521 if (tot == 0 ||
size == 0) {
1526 if (arr ==
nullptr) {
1530 if (arr_size !=
size) {
1545 if (kb ==
nullptr) {
1553 cp_key(0, tot, tot,
out, key, actkb, kb, weights, 0);
1578 if (obdata !=
nullptr) {
1579 switch (
GS(obdata->
name)) {
1583 mesh->vert_positions_for_write().take_front(totvert).copy_from(
1585 mesh->tag_positions_changed();
1608 return (
float *)
out;
1621 kb = kb->
next, index++)
1623 if (
ELEM(shape_index, -1, index)) {
1654 const int shape_index)
1656 uint8_t *elements = (uint8_t *)arr.
data();
1659 kb = kb->
next, index++)
1661 if (
ELEM(shape_index, -1, index)) {
1662 const int block_elem_len = kb->totelem * key->
elemsize;
1663 memcpy(elements, kb->data, block_elem_len);
1664 elements += block_elem_len;
1675 const int shape_index,
1679 if (key->
elemsize !=
sizeof(
float[3])) {
1688 if (
ELEM(shape_index, -1, index)) {
1689 const int block_elem_len = kb->totelem;
1690 float (*block_data)[3] = (
float (*)[3])kb->data;
1691 for (
int data_offset = 0; data_offset < block_elem_len; ++data_offset) {
1692 const float *src_data = (
const float *)(elements + data_offset);
1693 float *dst_data = (
float *)(block_data + data_offset);
1696 elements += block_elem_len;
1703 const int shape_index,
1707 const uint8_t *elements =
static_cast<const uint8_t *
>(
data);
1711 if (
ELEM(shape_index, -1, index)) {
1712 const int block_elem_size = kb->totelem * key->
elemsize;
1714 elements += block_elem_size;
1721 const uint8_t *elements =
static_cast<const uint8_t *
>(
data);
1724 if (
ELEM(shape_index, -1, index)) {
1725 const int block_elem_size = kb->totelem * key->
elemsize;
1726 memcpy(kb->data, elements, block_elem_size);
1727 elements += block_elem_size;
1784 if (ob ==
nullptr || ob->
data ==
nullptr) {
1805 float curpos = -0.1;
1844 kb->
pos = curpos + 0.1f;
1865 const float cpos = key->
ctime / 100.0f;
1924 if (kb->uid == uid) {
1933 kb_dst->
pos = kb_src->
pos;
1944 if (
ELEM(
nullptr, key, kb)) {
1945 return std::nullopt;
1970 fp =
static_cast<float (*)[3]
>(kb->
data);
1971 for (a = 0; a < kb->
totelem; a++, fp++, bp++) {
1997 for (
int i = 0;
i < totpoint;
i++, fp++, bpoint++) {
2005 const float (*fp)[3] =
static_cast<const float (*)[3]
>(kb->
data);
2018 nu =
static_cast<const Nurb *
>(nurb->
first);
2047 fp =
static_cast<float *
>(kb->
data);
2050 for (a = nu->pntsu, bezt = nu->bezt; a; a--, bezt++) {
2051 for (
int i = 0;
i < 3;
i++) {
2060 for (a = nu->pntsu * nu->pntsv, bp = nu->bp; a; a--, bp++) {
2071 const float mat[4][4],
2072 const void *src_data,
2075 const float *src =
static_cast<const float *
>(src_data);
2076 float *dst =
static_cast<float *
>(dst_data);
2079 for (
int a = nu->pntsu; a; a--) {
2080 for (
int i = 0;
i < 3;
i++) {
2090 for (
int a = nu->pntsu * nu->pntsv; a; a--) {
2121 for (
Nurb *nu =
static_cast<Nurb *
>(nurb->
first); nu && totpoint > 0; nu = nu->
next) {
2122 if (nu->bezt !=
nullptr) {
2127 for (
int j = 0; j < 3; j++) {
2149 const float *fp =
static_cast<const float *
>(kb->
data);
2167 memcpy(kb->
data, positions.
data(),
sizeof(
float[3]) * tot);
2195 float (*r_vert_normals)[3],
2196 float (*r_face_normals)[3],
2197 float (*r_loop_normals)[3])
2201 if (r_vert_normals ==
nullptr && r_face_normals ==
nullptr && r_loop_normals ==
nullptr) {
2211 const bool loop_normals_needed = r_loop_normals !=
nullptr;
2212 const bool vert_normals_needed = r_vert_normals !=
nullptr;
2213 const bool face_normals_needed = r_face_normals !=
nullptr || vert_normals_needed ||
2214 loop_normals_needed;
2216 float (*vert_normals)[3] = r_vert_normals;
2217 float (*face_normals)[3] = r_face_normals;
2218 bool free_vert_normals =
false;
2219 bool free_face_normals =
false;
2220 if (vert_normals_needed && r_vert_normals ==
nullptr) {
2222 free_vert_normals =
true;
2224 if (face_normals_needed && r_face_normals ==
nullptr) {
2226 free_face_normals =
true;
2229 if (face_normals_needed) {
2235 if (vert_normals_needed) {
2240 mesh->vert_to_face_map(),
2241 {reinterpret_cast<const blender::float3 *>(face_normals), faces.size()},
2242 {reinterpret_cast<blender::float3 *>(vert_normals), mesh->verts_num});
2244 if (loop_normals_needed) {
2255 mesh->vert_to_face_map(),
2256 {reinterpret_cast<blender::float3 *>(face_normals), faces.size()},
2261 {reinterpret_cast<blender::float3 *>(r_loop_normals), corner_verts.size()});
2264 if (free_vert_normals) {
2267 if (free_face_normals) {
2278 const int act_index = ob->
shapenr - 1;
2279 const int totkey = key->
totkey;
2281 bool rev, in_range =
false;
2283 if (org_index < 0) {
2284 org_index = act_index;
2290 if (new_index == org_index) {
2294 rev = ((new_index - org_index) < 0) ?
true :
false;
2300 i = (rev ? totkey - 1 : 0);
2302 kb = (rev ? kb->
prev : kb->
next), rev ?
i-- :
i++)
2304 if (
i == org_index) {
2307 else if (
i == new_index) {
2318 std::swap(kb->
pos, other_kb->
pos);
2339 if (org_index == act_index) {
2342 else if (act_index < org_index && act_index >= new_index) {
2345 else if (act_index > org_index && act_index <= new_index) {
2362 if ((
i != index) && (kb->
relative == index)) {
2375 return std::nullopt;
2380 if (index < 0 || index >=
count) {
2381 return std::nullopt;
2387 marked[index] =
true;
2391 bool updated, found =
false;
2400 updated = found =
true;
2406 return std::nullopt;
2410 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_)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
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)
char * STRNCPY(char(&dst)[N], const char *src)
#define SNPRINTF_UTF8(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)
#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)
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< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
VecBase< short, 2 > short2
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 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