Blender  V3.3
Classes | Macros | Typedefs | Functions | Variables
key.c File Reference
#include <math.h>
#include <stddef.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_endian_switch.h"
#include "BLI_math_vector.h"
#include "BLI_string_utils.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_ID.h"
#include "DNA_anim_types.h"
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_anim_data.h"
#include "BKE_curve.h"
#include "BKE_customdata.h"
#include "BKE_deform.h"
#include "BKE_editmesh.h"
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_scene.h"
#include "RNA_access.h"
#include "RNA_path.h"
#include "RNA_prototypes.h"
#include "BLO_read_write.h"

Go to the source code of this file.

Classes

struct  WeightsArrayCache
 

Macros

#define DNA_DEPRECATED_ALLOW
 
#define IPO_FLOAT   4
 
#define IPO_BEZTRIPLE   100
 
#define IPO_BPOINT   101
 
#define KEY_MODE_DUMMY   0 /* use where mode isn't checked for */
 
#define KEY_MODE_BPOINT   1
 
#define KEY_MODE_BEZTRIPLE   2
 

Typedefs

typedef struct WeightsArrayCache WeightsArrayCache
 

Functions

static void shapekey_copy_data (Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int UNUSED(flag))
 
static void shapekey_free_data (ID *id)
 
static void shapekey_foreach_id (ID *id, LibraryForeachIDData *data)
 
static IDshapekey_owner_get (Main *UNUSED(bmain), ID *id, ID *UNUSED(owner_id_hint))
 
static void shapekey_blend_write (BlendWriter *writer, ID *id, const void *id_address)
 
static void switch_endian_keyblock (Key *key, KeyBlock *kb)
 
static void shapekey_blend_read_data (BlendDataReader *reader, ID *id)
 
static void shapekey_blend_read_lib (BlendLibReader *reader, ID *id)
 
static void shapekey_blend_read_expand (BlendExpander *expander, ID *id)
 
void BKE_key_free_data (Key *key)
 
void BKE_key_free_nolib (Key *key)
 
KeyBKE_key_add (Main *bmain, ID *id)
 
void BKE_key_sort (Key *key)
 
void key_curve_position_weights (float t, float data[4], int type)
 
void key_curve_tangent_weights (float t, float data[4], int type)
 
void key_curve_normal_weights (float t, float data[4], int type)
 
static int setkeys (float fac, ListBase *lb, KeyBlock *k[], float t[4], int cycl)
 
static void flerp (int tot, float *in, const float *f0, const float *f1, const float *f2, const float *f3, const float *t)
 
static void rel_flerp (int tot, float *in, const float *ref, const float *out, float fac)
 
static char * key_block_get_data (Key *key, KeyBlock *actkb, KeyBlock *kb, char **freedata)
 
static bool key_pointer_size (const Key *key, const int mode, int *poinsize, int *ofs, int *step)
 
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 cp_cu_key (Curve *cu, Key *key, KeyBlock *actkb, KeyBlock *kb, const int start, int end, char *out, const int tot)
 
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)
 
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)
 
static floatget_weights_array (Object *ob, char *vgroup, WeightsArrayCache *cache)
 
static float ** keyblock_get_per_block_weights (Object *ob, Key *key, WeightsArrayCache *cache)
 
static void keyblock_free_per_block_weights (Key *key, float **per_keyblock_weights, WeightsArrayCache *cache)
 
static void do_mesh_key (Object *ob, Key *key, char *out, const int tot)
 
static void do_cu_key (Curve *cu, Key *key, KeyBlock *actkb, KeyBlock **k, float *t, char *out, const int tot)
 
static void do_rel_cu_key (Curve *cu, Key *key, KeyBlock *actkb, char *out, const int tot)
 
static void do_curve_key (Object *ob, Key *key, char *out, const int tot)
 
static void do_latt_key (Object *ob, Key *key, char *out, const int tot)
 
static void keyblock_data_convert_to_mesh (const float(*fp)[3], MVert *mvert, const int totvert)
 
static void keyblock_data_convert_to_lattice (const float(*fp)[3], BPoint *bpoint, const int totpoint)
 
static void keyblock_data_convert_to_curve (const float *fp, ListBase *nurb, const int totpoint)
 
floatBKE_key_evaluate_object_ex (Object *ob, int *r_totelem, float *arr, size_t arr_size, ID *obdata)
 
floatBKE_key_evaluate_object (Object *ob, int *r_totelem)
 
int BKE_keyblock_element_count_from_shape (const Key *key, const int shape_index)
 
int BKE_keyblock_element_count (const Key *key)
 
size_t BKE_keyblock_element_calc_size_from_shape (const Key *key, const int shape_index)
 
size_t BKE_keyblock_element_calc_size (const Key *key)
 
bool BKE_key_idtype_support (const short id_type)
 
Key ** BKE_key_from_id_p (ID *id)
 
KeyBKE_key_from_id (ID *id)
 
Key ** BKE_key_from_object_p (Object *ob)
 
KeyBKE_key_from_object (Object *ob)
 
KeyBlockBKE_keyblock_add (Key *key, const char *name)
 
KeyBlockBKE_keyblock_add_ctime (Key *key, const char *name, const bool do_force)
 
KeyBlockBKE_keyblock_from_object (Object *ob)
 
KeyBlockBKE_keyblock_from_object_reference (Object *ob)
 
KeyBlockBKE_keyblock_from_key (Key *key, int index)
 
KeyBlockBKE_keyblock_find_name (Key *key, const char name[])
 
void BKE_keyblock_copy_settings (KeyBlock *kb_dst, const KeyBlock *kb_src)
 
char * BKE_keyblock_curval_rnapath_get (const Key *key, const KeyBlock *kb)
 
void BKE_keyblock_update_from_lattice (const Lattice *lt, KeyBlock *kb)
 
void BKE_keyblock_convert_from_lattice (const Lattice *lt, KeyBlock *kb)
 
void BKE_keyblock_convert_to_lattice (const KeyBlock *kb, Lattice *lt)
 
int BKE_keyblock_curve_element_count (const ListBase *nurb)
 
void BKE_keyblock_update_from_curve (const Curve *UNUSED(cu), KeyBlock *kb, const ListBase *nurb)
 
void BKE_keyblock_curve_data_transform (const ListBase *nurb, const float mat[4][4], const void *src_data, void *dst_data)
 
void BKE_keyblock_convert_from_curve (const Curve *cu, KeyBlock *kb, const ListBase *nurb)
 
void BKE_keyblock_convert_to_curve (KeyBlock *kb, Curve *UNUSED(cu), ListBase *nurb)
 
void BKE_keyblock_update_from_mesh (const Mesh *me, KeyBlock *kb)
 
void BKE_keyblock_convert_from_mesh (const Mesh *me, const Key *key, KeyBlock *kb)
 
void BKE_keyblock_convert_to_mesh (const KeyBlock *kb, MVert *mvert, const int totvert)
 
void BKE_keyblock_mesh_calc_normals (const KeyBlock *kb, const Mesh *mesh, float(*r_vertnors)[3], float(*r_polynors)[3], float(*r_loopnors)[3])
 
void BKE_keyblock_update_from_vertcos (const Object *ob, KeyBlock *kb, const float(*vertCos)[3])
 
void BKE_keyblock_convert_from_vertcos (const Object *ob, KeyBlock *kb, const float(*vertCos)[3])
 
float(* BKE_keyblock_convert_to_vertcos (const Object *ob, const KeyBlock *kb))[3]
 
void BKE_keyblock_update_from_offset (const Object *ob, KeyBlock *kb, const float(*ofs)[3])
 
bool BKE_keyblock_move (Object *ob, int org_index, int new_index)
 
bool BKE_keyblock_is_basis (const Key *key, const int index)
 
Key-Block Data Access

Utilities for getting/setting key data as a single array, use BKE_keyblock_element_calc_size to allocate the size of the data needed.

void BKE_keyblock_data_get_from_shape (const Key *key, float(*arr)[3], const int shape_index)
 
void BKE_keyblock_data_get (const Key *key, float(*arr)[3])
 
void BKE_keyblock_data_set_with_mat4 (Key *key, const int shape_index, const float(*coords)[3], const float mat[4][4])
 
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])
 
void BKE_keyblock_data_set (Key *key, const int shape_index, const void *data)
 

Variables

IDTypeInfo IDType_ID_KE
 

Macro Definition Documentation

◆ DNA_DEPRECATED_ALLOW

#define DNA_DEPRECATED_ALLOW

Definition at line 23 of file key.c.

◆ IPO_BEZTRIPLE

#define IPO_BEZTRIPLE   100

Definition at line 129 of file key.c.

◆ IPO_BPOINT

#define IPO_BPOINT   101

Definition at line 130 of file key.c.

◆ IPO_FLOAT

#define IPO_FLOAT   4

Definition at line 128 of file key.c.

◆ KEY_MODE_BEZTRIPLE

#define KEY_MODE_BEZTRIPLE   2

Definition at line 227 of file key.c.

◆ KEY_MODE_BPOINT

#define KEY_MODE_BPOINT   1

Definition at line 226 of file key.c.

◆ KEY_MODE_DUMMY

#define KEY_MODE_DUMMY   0 /* use where mode isn't checked for */

Definition at line 225 of file key.c.

Typedef Documentation

◆ WeightsArrayCache

Function Documentation

◆ BKE_key_add()

Key* BKE_key_add ( Main bmain,
ID id 
)

◆ BKE_key_evaluate_object()

float* BKE_key_evaluate_object ( Object ob,
int *  r_totelem 
)

◆ BKE_key_evaluate_object_ex()

float* BKE_key_evaluate_object_ex ( struct Object ob,
int *  r_totelem,
float arr,
size_t  arr_size,
struct ID obdata 
)

◆ BKE_key_free_data()

void BKE_key_free_data ( struct Key key)

Free (or release) any data used by this shapekey (does not free the key itself).

Definition at line 235 of file key.c.

References Key::id, and shapekey_free_data().

Referenced by undomesh_free_data().

◆ BKE_key_free_nolib()

void BKE_key_free_nolib ( Key key)

Definition at line 240 of file key.c.

References BLI_pophead(), Key::block, KeyBlock::data, and MEM_freeN.

◆ BKE_key_from_id()

Key* BKE_key_from_id ( ID id)

◆ BKE_key_from_id_p()

Key** BKE_key_from_id_p ( ID id)

◆ BKE_key_from_object()

Key* BKE_key_from_object ( Object ob)

◆ BKE_key_from_object_p()

Key** BKE_key_from_object_p ( Object ob)

Definition at line 1794 of file key.c.

References BKE_key_from_id_p(), Object::data, and NULL.

Referenced by BKE_key_from_object(), and BKE_object_shapekey_free().

◆ BKE_key_idtype_support()

bool BKE_key_idtype_support ( const short  id_type)

Definition at line 1746 of file key.c.

References ID_CU_LEGACY, ID_LT, and ID_ME.

Referenced by BLO_main_validate_shapekeys().

◆ BKE_key_sort()

void BKE_key_sort ( struct Key key)

Sort shape keys after a change. This assumes that at most one key was moved, which is a valid assumption for the places it's currently being called.

Definition at line 304 of file key.c.

References BLI_insertlinkafter(), BLI_remlink(), Key::block, ListBase::first, KeyBlock::next, KeyBlock::pos, KeyBlock::prev, and Key::refkey.

Referenced by BKE_keyblock_add_ctime(), and ED_mesh_join_objects_exec().

◆ BKE_keyblock_add()

KeyBlock* BKE_keyblock_add ( Key key,
const char *  name 
)

◆ BKE_keyblock_add_ctime()

KeyBlock* BKE_keyblock_add_ctime ( struct Key key,
const char *  name,
bool  do_force 
)
Note
sorting is a problematic side effect in some cases, better only do this explicitly by having its own function,
Parameters
keyThe key datablock to add to.
nameOptional name for the new keyblock.
do_forcealways use ctime even for relative keys.

Definition at line 1862 of file key.c.

References BKE_key_sort(), BKE_keyblock_add(), Key::block, compare_ff(), Key::ctime, ListBase::first, KEY_RELATIVE, KeyBlock::next, KeyBlock::pos, and Key::type.

Referenced by insert_curvekey(), insert_lattkey(), insert_meshkey(), and ArmatureImporter::make_shape_keys().

◆ BKE_keyblock_convert_from_curve()

void BKE_keyblock_convert_from_curve ( const Curve cu,
KeyBlock kb,
const ListBase nurb 
)

◆ BKE_keyblock_convert_from_lattice()

void BKE_keyblock_convert_from_lattice ( const Lattice lt,
KeyBlock kb 
)

◆ BKE_keyblock_convert_from_mesh()

void BKE_keyblock_convert_from_mesh ( const Mesh me,
const Key key,
KeyBlock kb 
)

◆ BKE_keyblock_convert_from_vertcos()

void BKE_keyblock_convert_from_vertcos ( const Object ob,
KeyBlock kb,
const float(*)  vertCos[3] 
)

◆ BKE_keyblock_convert_to_curve()

void BKE_keyblock_convert_to_curve ( KeyBlock kb,
Curve UNUSEDcu,
ListBase nurb 
)

◆ BKE_keyblock_convert_to_lattice()

void BKE_keyblock_convert_to_lattice ( const KeyBlock kb,
Lattice lt 
)

◆ BKE_keyblock_convert_to_mesh()

void BKE_keyblock_convert_to_mesh ( const KeyBlock kb,
MVert mvert,
const int  totvert 
)

◆ BKE_keyblock_convert_to_vertcos()

float(* BKE_keyblock_convert_to_vertcos ( const Object ob,
const KeyBlock kb 
) )[3]

◆ BKE_keyblock_copy_settings()

void BKE_keyblock_copy_settings ( KeyBlock kb_dst,
const KeyBlock kb_src 
)

◆ BKE_keyblock_curval_rnapath_get()

char* BKE_keyblock_curval_rnapath_get ( const Key key,
const KeyBlock kb 
)

◆ BKE_keyblock_curve_data_set_with_mat4()

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] 
)

◆ BKE_keyblock_curve_data_transform()

void BKE_keyblock_curve_data_transform ( const ListBase nurb,
const float  mat[4][4],
const void src_data,
void dst_data 
)

◆ BKE_keyblock_curve_element_count()

int BKE_keyblock_curve_element_count ( const ListBase nurb)

◆ BKE_keyblock_data_get()

void BKE_keyblock_data_get ( const Key key,
float(*)  arr[3] 
)

Definition at line 1684 of file key.c.

References BKE_keyblock_data_get_from_shape().

◆ BKE_keyblock_data_get_from_shape()

void BKE_keyblock_data_get_from_shape ( const Key key,
float(*)  arr[3],
const int  shape_index 
)

Definition at line 1671 of file key.c.

References Key::block, ELEM, Key::elemsize, and ListBase::first.

Referenced by BKE_keyblock_data_get().

◆ BKE_keyblock_data_set()

void BKE_keyblock_data_set ( struct Key key,
int  shape_index,
const void data 
)

Set the data for all key-blocks (or shape_index if != -1).

Definition at line 1731 of file key.c.

References Key::block, data, ELEM, Key::elemsize, and ListBase::first.

Referenced by ED_object_data_xform_restore().

◆ BKE_keyblock_data_set_with_mat4()

void BKE_keyblock_data_set_with_mat4 ( struct Key key,
int  shape_index,
const float(*)  coords[3],
const float  mat[4][4] 
)

Set the data to all key-blocks (or shape_index if != -1).

Definition at line 1689 of file key.c.

References BLI_assert_msg, Key::block, ELEM, Key::elemsize, ListBase::first, float(), and mul_v3_m4v3().

Referenced by ED_object_data_xform_by_mat4().

◆ BKE_keyblock_element_calc_size()

size_t BKE_keyblock_element_calc_size ( const Key key)

Definition at line 1659 of file key.c.

References BKE_keyblock_element_calc_size_from_shape().

◆ BKE_keyblock_element_calc_size_from_shape()

size_t BKE_keyblock_element_calc_size_from_shape ( const Key key,
const int  shape_index 
)

Definition at line 1654 of file key.c.

References BKE_keyblock_element_count_from_shape(), and Key::elemsize.

Referenced by BKE_keyblock_element_calc_size().

◆ BKE_keyblock_element_count()

int BKE_keyblock_element_count ( const Key key)

Definition at line 1649 of file key.c.

References BKE_keyblock_element_count_from_shape().

◆ BKE_keyblock_element_count_from_shape()

int BKE_keyblock_element_count_from_shape ( const Key key,
const int  shape_index 
)

◆ BKE_keyblock_find_name()

KeyBlock* BKE_keyblock_find_name ( struct Key key,
const char  name[] 
)

Get the appropriate KeyBlock given a name to search for.

Definition at line 1930 of file key.c.

References BLI_findstring(), and Key::block.

Referenced by ED_mesh_join_objects_exec(), edbm_blend_from_shape_exec(), join_mesh_single(), and sculpt_undo_restore_coords().

◆ BKE_keyblock_from_key()

KeyBlock* BKE_keyblock_from_key ( struct Key key,
int  index 
)

Get the appropriate KeyBlock given an index.

Definition at line 1913 of file key.c.

References Key::block, ListBase::first, KeyBlock::next, NULL, and Key::totkey.

Referenced by deformVerts(), get_orco_coords(), and shapekey_adrcodes_to_paths().

◆ BKE_keyblock_from_object()

KeyBlock* BKE_keyblock_from_object ( struct Object ob)

◆ BKE_keyblock_from_object_reference()

KeyBlock* BKE_keyblock_from_object_reference ( Object ob)

Definition at line 1902 of file key.c.

References BKE_key_from_object(), NULL, and Key::refkey.

◆ BKE_keyblock_is_basis()

bool BKE_keyblock_is_basis ( const Key key,
const int  index 
)

Definition at line 2570 of file key.c.

References Key::block, ListBase::first, KEY_RELATIVE, KeyBlock::next, KeyBlock::relative, and Key::type.

◆ BKE_keyblock_mesh_calc_normals()

void BKE_keyblock_mesh_calc_normals ( const KeyBlock kb,
const Mesh mesh,
float(*)  r_vertnors[3],
float(*)  r_polynors[3],
float(*)  r_loopnors[3] 
)

◆ BKE_keyblock_move()

bool BKE_keyblock_move ( struct Object ob,
int  org_index,
int  new_index 
)

Move shape key from org_index to new_index. Safe, clamps index to valid range, updates reference keys, the object's active shape index, the 'frame' value in case of absolute keys, etc. Note indices are expected in real values (not 'fake' shapenr +1 ones).

Parameters
org_indexif < 0, current object's active shape will be used as skey to move.
Returns
true if something was done, else false.

Definition at line 2492 of file key.c.

References BKE_key_from_object(), BLI_listbase_swaplinks(), Key::block, CLAMP, ListBase::first, ListBase::last, KeyBlock::next, KeyBlock::pos, KeyBlock::prev, Key::refkey, KeyBlock::relative, Object::shapenr, SWAP, and Key::totkey.

Referenced by shape_key_move_exec().

◆ BKE_keyblock_update_from_curve()

void BKE_keyblock_update_from_curve ( const Curve UNUSEDcu,
KeyBlock kb,
const ListBase nurb 
)

◆ BKE_keyblock_update_from_lattice()

void BKE_keyblock_update_from_lattice ( const Lattice lt,
KeyBlock kb 
)

◆ BKE_keyblock_update_from_mesh()

void BKE_keyblock_update_from_mesh ( const Mesh me,
KeyBlock kb 
)

◆ BKE_keyblock_update_from_offset()

void BKE_keyblock_update_from_offset ( const Object ob,
KeyBlock kb,
const float(*)  ofs[3] 
)

◆ BKE_keyblock_update_from_vertcos()

void BKE_keyblock_update_from_vertcos ( const Object ob,
KeyBlock kb,
const float(*)  vertCos[3] 
)

◆ cp_cu_key()

static void cp_cu_key ( Curve cu,
Key key,
KeyBlock actkb,
KeyBlock kb,
const int  start,
int  end,
char *  out,
const int  tot 
)
static

◆ cp_key()

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

◆ do_cu_key()

static void do_cu_key ( Curve cu,
Key key,
KeyBlock actkb,
KeyBlock **  k,
float t,
char *  out,
const int  tot 
)
static

◆ do_curve_key()

static void do_curve_key ( Object ob,
Key key,
char *  out,
const int  tot 
)
static

◆ do_key()

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 
)
static

◆ do_latt_key()

static void do_latt_key ( Object ob,
Key key,
char *  out,
const int  tot 
)
static

◆ do_mesh_key()

static void do_mesh_key ( Object ob,
Key key,
char *  out,
const int  tot 
)
static

◆ do_rel_cu_key()

static void do_rel_cu_key ( Curve cu,
Key key,
KeyBlock actkb,
char *  out,
const int  tot 
)
static

◆ flerp()

static void flerp ( int  tot,
float in,
const float f0,
const float f1,
const float f2,
const float f3,
const float t 
)
static

Definition at line 589 of file key.c.

References Freestyle::a, and t.

Referenced by do_key().

◆ get_weights_array()

static float* get_weights_array ( Object ob,
char *  vgroup,
WeightsArrayCache cache 
)
static

◆ key_block_get_data()

static char* key_block_get_data ( Key key,
KeyBlock actkb,
KeyBlock kb,
char **  freedata 
)
static

◆ key_curve_normal_weights()

void key_curve_normal_weights ( float  t,
float  data[4],
int  type 
)

Second derivative.

Definition at line 415 of file key.c.

References data, KEY_BSPLINE, KEY_CARDINAL, KEY_CATMULL_ROM, KEY_LINEAR, t, and type.

◆ key_curve_position_weights()

void key_curve_position_weights ( float  t,
float  data[4],
int  type 
)

◆ key_curve_tangent_weights()

void key_curve_tangent_weights ( float  t,
float  data[4],
int  type 
)

First derivative.

Definition at line 377 of file key.c.

References data, KEY_BSPLINE, KEY_CARDINAL, KEY_CATMULL_ROM, KEY_LINEAR, t, and type.

Referenced by BKE_where_on_path().

◆ key_evaluate_relative()

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 
)
static

◆ key_pointer_size()

static bool key_pointer_size ( const Key key,
const int  mode,
int *  poinsize,
int *  ofs,
int *  step 
)
static

◆ keyblock_data_convert_to_curve()

static void keyblock_data_convert_to_curve ( const float fp,
ListBase nurb,
const int  totpoint 
)
static

◆ keyblock_data_convert_to_lattice()

static void keyblock_data_convert_to_lattice ( const float(*)  fp[3],
BPoint bpoint,
const int  totpoint 
)
static

Definition at line 2006 of file key.c.

References copy_v3_v3(), and BPoint::vec.

Referenced by BKE_key_evaluate_object_ex(), and BKE_keyblock_convert_to_lattice().

◆ keyblock_data_convert_to_mesh()

static void keyblock_data_convert_to_mesh ( const float(*)  fp[3],
MVert mvert,
const int  totvert 
)
static

Definition at line 2205 of file key.c.

References MVert::co, and copy_v3_v3().

Referenced by BKE_key_evaluate_object_ex(), and BKE_keyblock_convert_to_mesh().

◆ keyblock_free_per_block_weights()

static void keyblock_free_per_block_weights ( Key key,
float **  per_keyblock_weights,
WeightsArrayCache cache 
)
static

◆ keyblock_get_per_block_weights()

static float** keyblock_get_per_block_weights ( Object ob,
Key key,
WeightsArrayCache cache 
)
static

◆ rel_flerp()

static void rel_flerp ( int  tot,
float in,
const float ref,
const float out,
float  fac 
)
static

Definition at line 604 of file key.c.

References Freestyle::a, and usdtokens::out().

Referenced by cp_key(), and key_evaluate_relative().

◆ setkeys()

static int setkeys ( float  fac,
ListBase lb,
KeyBlock k[],
float  t[4],
int  cycl 
)
static

◆ shapekey_blend_read_data()

static void shapekey_blend_read_data ( BlendDataReader reader,
ID id 
)
static

◆ shapekey_blend_read_expand()

static void shapekey_blend_read_expand ( BlendExpander expander,
ID id 
)
static

Definition at line 187 of file key.c.

References BLO_expand.

◆ shapekey_blend_read_lib()

static void shapekey_blend_read_lib ( BlendLibReader reader,
ID id 
)
static

Definition at line 178 of file key.c.

References BLI_assert, BLO_read_id_address, Key::from, Key::id, ID::lib, LIB_TAG_EXTERN, and ID::tag.

◆ shapekey_blend_write()

static void shapekey_blend_write ( BlendWriter writer,
ID id,
const void id_address 
)
static

◆ shapekey_copy_data()

static void shapekey_copy_data ( Main UNUSEDbmain,
ID id_dst,
const ID id_src,
const int   UNUSEDflag 
)
static

◆ shapekey_foreach_id()

static void shapekey_foreach_id ( ID id,
LibraryForeachIDData data 
)
static

Definition at line 88 of file key.c.

References BKE_LIB_FOREACHID_PROCESS_ID, data, Key::from, and IDWALK_CB_LOOPBACK.

◆ shapekey_free_data()

static void shapekey_free_data ( ID id)
static

Definition at line 75 of file key.c.

References BLI_pophead(), Key::block, KeyBlock::data, and MEM_freeN.

Referenced by BKE_key_free_data().

◆ shapekey_owner_get()

static ID* shapekey_owner_get ( Main UNUSEDbmain,
ID id,
ID UNUSEDowner_id_hint 
)
static

Definition at line 94 of file key.c.

◆ switch_endian_keyblock()

static void switch_endian_keyblock ( Key key,
KeyBlock kb 
)
static

Variable Documentation

◆ IDType_ID_KE

IDTypeInfo IDType_ID_KE
Initial value:
= {
.id_code = ID_KE,
.id_filter = FILTER_ID_KE,
.main_listbase_index = INDEX_ID_KE,
.struct_size = sizeof(Key),
.name = "Key",
.name_plural = "shape_keys",
.translation_context = BLT_I18NCONTEXT_ID_SHAPEKEY,
.asset_type_info = NULL,
.copy_data = shapekey_copy_data,
.free_data = shapekey_free_data,
.make_local = NULL,
.foreach_id = shapekey_foreach_id,
.foreach_cache = NULL,
.foreach_path = NULL,
.owner_get = shapekey_owner_get,
.blend_write = shapekey_blend_write,
.blend_read_data = shapekey_blend_read_data,
.blend_read_lib = shapekey_blend_read_lib,
.blend_read_expand = shapekey_blend_read_expand,
.blend_read_undo_preserve = NULL,
.lib_override_apply_post = NULL,
}
@ IDTYPE_FLAGS_NO_LIBLINKING
Definition: BKE_idtype.h:32
#define BLT_I18NCONTEXT_ID_SHAPEKEY
@ INDEX_ID_KE
Definition: DNA_ID.h:1022
#define FILTER_ID_KE
Definition: DNA_ID.h:934
@ ID_KE
Definition: DNA_ID_enums.h:58
struct Key Key
static void init_data(ModifierData *md)
static void shapekey_blend_read_data(BlendDataReader *reader, ID *id)
Definition: key.c:159
static void shapekey_foreach_id(ID *id, LibraryForeachIDData *data)
Definition: key.c:88
static void shapekey_blend_read_expand(BlendExpander *expander, ID *id)
Definition: key.c:187
static ID * shapekey_owner_get(Main *UNUSED(bmain), ID *id, ID *UNUSED(owner_id_hint))
Definition: key.c:94
static void shapekey_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition: key.c:99
static void shapekey_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int UNUSED(flag))
Definition: key.c:54
static void shapekey_free_data(ID *id)
Definition: key.c:75
static void shapekey_blend_read_lib(BlendLibReader *reader, ID *id)
Definition: key.c:178

Definition at line 193 of file key.c.