Blender V5.0
key.cc File Reference
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstring>
#include <optional>
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math_matrix.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_string_utils.hh"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "DNA_ID.h"
#include "DNA_curve_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 "BKE_anim_data.hh"
#include "BKE_attribute.hh"
#include "BKE_curve.hh"
#include "BKE_customdata.hh"
#include "BKE_deform.hh"
#include "BKE_editmesh.hh"
#include "BKE_idtype.hh"
#include "BKE_key.hh"
#include "BKE_lattice.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_main.hh"
#include "BKE_mesh.hh"
#include "BKE_scene.hh"
#include "RNA_access.hh"
#include "RNA_path.hh"
#include "RNA_prototypes.hh"
#include "BLO_read_write.hh"

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

using float3
using float4x4

Functions

static void shapekey_copy_data (Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
static void shapekey_free_data (ID *id)
static void shapekey_foreach_id (ID *id, LibraryForeachIDData *data)
static ID ** shapekey_owner_pointer_get (ID *id, const bool debug_relationship_assert)
static void shapekey_blend_write (BlendWriter *writer, ID *id, const void *id_address)
static void shapekey_blend_read_data (BlendDataReader *reader, ID *id)
static void shapekey_blend_read_after_liblink (BlendLibReader *, ID *id)
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], KeyInterpolationType type)
void key_curve_tangent_weights (float t, float data[4], KeyInterpolationType type)
void key_curve_normal_weights (float t, float data[4], KeyInterpolationType 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 *r_poinsize, int *r_ofs, int *r_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, const 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_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_duplicate (Key *key, KeyBlock *kb_src)
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_find_by_index (Key *key, int index)
KeyBlockBKE_keyblock_find_name (Key *key, const char name[])
KeyBlockBKE_keyblock_find_uid (Key *key, const int uid)
void BKE_keyblock_copy_settings (KeyBlock *kb_dst, const KeyBlock *kb_src)
 copy shape-key attributes, but not key data or name/UID.
std::optional< std::string > 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 *, 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 *, ListBase *nurb)
void BKE_keyblock_update_from_mesh (const Mesh *mesh, KeyBlock *kb)
void BKE_keyblock_convert_from_mesh (const Mesh *mesh, const Key *key, KeyBlock *kb)
void BKE_keyblock_convert_to_mesh (const KeyBlock *kb, blender::MutableSpan< blender::float3 > vert_positions)
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])
bool BKE_keyblock_move (Object *ob, int org_index, int new_index)
bool BKE_keyblock_is_basis (const Key *key, const int index)
std::optional< blender::Array< bool > > BKE_keyblock_get_dependent_keys (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, MutableSpan< float3 > arr, const int shape_index)
void BKE_keyblock_data_get (const Key *key, MutableSpan< float3 > arr)
void BKE_keyblock_data_set_with_mat4 (Key *key, const int shape_index, const Span< float3 > coords, const float4x4 &transform)
void BKE_keyblock_curve_data_set_with_mat4 (Key *key, const ListBase *nurb, const int shape_index, const void *data, const float4x4 &transform)
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 28 of file key.cc.

◆ IPO_BEZTRIPLE

#define IPO_BEZTRIPLE   100

Definition at line 144 of file key.cc.

Referenced by cp_key(), do_key(), and key_evaluate_relative().

◆ IPO_BPOINT

#define IPO_BPOINT   101

Definition at line 145 of file key.cc.

Referenced by BKE_key_add(), cp_key(), do_key(), and key_evaluate_relative().

◆ IPO_FLOAT

#define IPO_FLOAT   4

Definition at line 143 of file key.cc.

Referenced by BKE_key_add(), cp_key(), do_key(), and key_evaluate_relative().

◆ KEY_MODE_BEZTRIPLE

#define KEY_MODE_BEZTRIPLE   2

Definition at line 207 of file key.cc.

Referenced by cp_cu_key(), cp_key(), do_cu_key(), do_key(), do_rel_cu_key(), and key_evaluate_relative().

◆ KEY_MODE_BPOINT

#define KEY_MODE_BPOINT   1

Definition at line 206 of file key.cc.

Referenced by cp_cu_key(), do_cu_key(), do_rel_cu_key(), and key_pointer_size().

◆ KEY_MODE_DUMMY

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

Definition at line 205 of file key.cc.

Referenced by do_latt_key(), and do_mesh_key().

Typedef Documentation

◆ float3

Definition at line 619 of file BLI_math_vector_types.hh.

◆ float4x4

Definition at line 1012 of file BLI_math_matrix_types.hh.

Function Documentation

◆ BKE_key_add()

◆ BKE_key_evaluate_object()

float * BKE_key_evaluate_object ( Object * ob,
int * r_totelem )

◆ BKE_key_evaluate_object_ex()

◆ BKE_key_free_nolib()

void BKE_key_free_nolib ( Key * key)

Definition at line 215 of file key.cc.

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

◆ BKE_key_from_id()

◆ BKE_key_from_id_p()

◆ BKE_key_from_object()

Key * BKE_key_from_object ( Object * ob)

Definition at line 1791 of file key.cc.

References BKE_key_from_object_p().

Referenced by actedit_get_shapekeys(), action_new_poll(), ANIM_active_action_from_area(), animdata_filter_dopesheet_ob(), BKE_key_evaluate_object_ex(), BKE_keyblock_from_object(), BKE_keyblock_from_object_reference(), BKE_keyblock_move(), BKE_modifiers_get_virtual_modifierlist(), BKE_object_is_deform_modified(), BKE_object_is_modified(), BKE_object_shapekey_remove(), blender::deg::DepsgraphRelationBuilder::build_object_data(), blender::deg::DepsgraphRelationBuilder::build_object_data_geometry(), blender::ed::object::shapekey::ShapeKeyTreeView::build_tree(), blender::io::AbstractHierarchyWriter::check_is_animated(), deform_matrices(), deform_matrices_EM(), deform_verts(), deform_verts(), deform_verts_EM(), draw_selected_name(), ED_actedit_animdata_from_context(), blender::bke::get_orco_coords(), object_deforms_in_time(), blender::ed::object::object_is_any_shape_key_locked(), blender::ed::object::object_shape_key_add(), blender::ed::object::object_shape_key_mirror(), blender::ed::object::object_update_shapes_poll(), blender::ed::object::shapekey::ShapeKeyDropTarget::on_drop(), blender::ed::sculpt_paint::undo::restore_active_shape_key(), blender::ed::object::shape_key_clear_exec(), blender::ed::object::shape_key_copy_exec(), blender::ed::object::shape_key_lock_exec(), blender::ed::object::shape_key_make_basis_exec(), blender::ed::object::shape_key_move_exec(), blender::ed::object::shape_key_move_poll(), blender::ed::object::shape_key_remove_exec(), blender::ed::object::shape_key_retime_exec(), and blender::ed::transform::special_aftertrans_update__actedit().

◆ BKE_key_from_object_p()

Key ** BKE_key_from_object_p ( Object * ob)

Definition at line 1782 of file key.cc.

References BKE_key_from_id_p(), and Object::data.

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 1734 of file key.cc.

References ID_CU_LEGACY, ID_LT, and ID_ME.

Referenced by BLO_main_validate_shapekeys().

◆ BKE_key_sort()

void BKE_key_sort ( 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 277 of file key.cc.

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

Referenced by BKE_keyblock_add_ctime(), and blender::ed::mesh::join_objects_exec().

◆ BKE_keyblock_add()

◆ BKE_keyblock_add_ctime()

KeyBlock * BKE_keyblock_add_ctime ( 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.cc.

References BKE_key_sort(), BKE_keyblock_add(), Key::block, compare_ff(), Key::ctime, KEY_RELATIVE, LISTBASE_FOREACH, name, KeyBlock::pos, and Key::type.

Referenced by insert_curvekey(), insert_lattkey(), and insert_meshkey().

◆ 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()

◆ BKE_keyblock_convert_to_curve()

void BKE_keyblock_convert_to_curve ( KeyBlock * kb,
Curve * cu,
ListBase * nurb )

◆ BKE_keyblock_convert_to_lattice()

void BKE_keyblock_convert_to_lattice ( const KeyBlock * kb,
Lattice * lt )

◆ BKE_keyblock_convert_to_mesh()

◆ BKE_keyblock_copy_settings()

void BKE_keyblock_copy_settings ( KeyBlock * kb_dst,
const KeyBlock * kb_src )

copy shape-key attributes, but not key data or name/UID.

Definition at line 1931 of file key.cc.

References KeyBlock::curval, KeyBlock::pos, KeyBlock::relative, KeyBlock::slidermax, KeyBlock::slidermin, STRNCPY(), KeyBlock::type, and KeyBlock::vgroup.

Referenced by BKE_keyblock_duplicate(), and blender::ed::mesh::join_shape_keys().

◆ BKE_keyblock_curval_rnapath_get()

std::optional< std::string > BKE_keyblock_curval_rnapath_get ( const Key * key,
const KeyBlock * kb )

Get RNA-Path for 'value' setting of the given shape-key.

Note
the user needs to free the returned string once they're finished with it.

Definition at line 1942 of file key.cc.

References ELEM, Key::id, ptr, RNA_path_from_ID_to_property(), RNA_pointer_create_discrete(), and RNA_struct_find_property().

Referenced by achannel_setting_slider_shapekey_cb(), ANIM_channel_draw_widgets(), and make_new_animlistelem().

◆ BKE_keyblock_curve_data_set_with_mat4()

void BKE_keyblock_curve_data_set_with_mat4 ( Key * key,
const ListBase * nurb,
int shape_index,
const void * data,
const blender::float4x4 & transform )

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

Definition at line 1701 of file key.cc.

References BKE_keyblock_curve_data_transform(), Key::block, data, ELEM, Key::elemsize, ListBase::first, KeyBlock::next, and transform().

Referenced by blender::ed::object::data_xform_by_mat4().

◆ 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()

◆ BKE_keyblock_data_get()

void BKE_keyblock_data_get ( const Key * key,
MutableSpan< float3 > arr )

Definition at line 1669 of file key.cc.

References BKE_keyblock_data_get_from_shape().

◆ BKE_keyblock_data_get_from_shape()

void BKE_keyblock_data_get_from_shape ( const Key * key,
MutableSpan< float3 > arr,
const int shape_index )

◆ BKE_keyblock_data_set()

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

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

Definition at line 1719 of file key.cc.

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

Referenced by blender::ed::object::data_xform_restore().

◆ BKE_keyblock_data_set_with_mat4()

void BKE_keyblock_data_set_with_mat4 ( Key * key,
const int shape_index,
const Span< float3 > coords,
const float4x4 & transform )

◆ BKE_keyblock_duplicate()

KeyBlock * BKE_keyblock_duplicate ( Key * key,
KeyBlock * kb_src )

◆ BKE_keyblock_element_calc_size()

size_t BKE_keyblock_element_calc_size ( const Key * key)

Definition at line 1640 of file key.cc.

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,
int shape_index )
Parameters
shape_indexThe index to use or all (when -1).

Definition at line 1635 of file key.cc.

References BKE_keyblock_element_count_from_shape(), and Key::elemsize.

Referenced by BKE_keyblock_element_calc_size(), and blender::ed::object::data_xform_create_ex().

◆ BKE_keyblock_element_count()

int BKE_keyblock_element_count ( const Key * key)

Definition at line 1630 of file key.cc.

References BKE_keyblock_element_count_from_shape().

◆ BKE_keyblock_element_count_from_shape()

int BKE_keyblock_element_count_from_shape ( const Key * key,
int shape_index )
Parameters
shape_indexThe index to use or all (when -1).

Definition at line 1616 of file key.cc.

References Key::block, ELEM, ListBase::first, KeyBlock::next, and result.

Referenced by BKE_keyblock_element_calc_size_from_shape(), and BKE_keyblock_element_count().

◆ BKE_keyblock_find_by_index()

KeyBlock * BKE_keyblock_find_by_index ( Key * key,
int index )

◆ BKE_keyblock_find_name()

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

◆ BKE_keyblock_find_uid()

KeyBlock * BKE_keyblock_find_uid ( Key * key,
const int uid )

Definition at line 1921 of file key.cc.

References Key::block, and LISTBASE_FOREACH.

Referenced by keyblock_ensure_from_uid().

◆ BKE_keyblock_from_object()

◆ BKE_keyblock_from_object_reference()

KeyBlock * BKE_keyblock_from_object_reference ( Object * ob)

Definition at line 1896 of file key.cc.

References BKE_key_from_object(), and Key::refkey.

◆ BKE_keyblock_get_dependent_keys()

std::optional< blender::Array< bool > > BKE_keyblock_get_dependent_keys ( const Key * key,
int index )

Returns a newly allocated array containing true for every key that has this one as basis. If none are found, returns null.

Definition at line 2371 of file key.cc.

References BLI_listbase_count(), Key::block, count, i, KEY_RELATIVE, LISTBASE_FOREACH_INDEX, KeyBlock::relative, and Key::type.

Referenced by bm_to_mesh_shape(), calc_shapeKeys(), and blender::ed::sculpt_paint::ShapeKeyData::from_object().

◆ BKE_keyblock_is_basis()

bool BKE_keyblock_is_basis ( const Key * key,
int index )

Check if given key-block (as index) is used as basis by others in given key.

Definition at line 2355 of file key.cc.

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

◆ BKE_keyblock_mesh_calc_normals()

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

Computes normals (vertices, faces and/or loops ones) of given mesh for given shape key.

Parameters
kbthe KeyBlock to use to compute normals.
meshthe Mesh to apply key-block to.
r_vert_normalsif non-NULL, an array of vectors, same length as number of vertices.
r_face_normalsif non-NULL, an array of vectors, same length as number of faces.
r_loop_normalsif non-NULL, an array of vectors, same length as number of loops.

Definition at line 2193 of file key.cc.

References BKE_keyblock_convert_to_mesh(), blender::bke::Corner, blender::bke::Edge, blender::bke::Face, faces, float, blender::bke::AttributeAccessor::lookup(), MEM_freeN(), MEM_malloc_arrayN(), blender::bke::mesh::normals_calc_corners(), blender::bke::mesh::normals_calc_faces(), and blender::bke::mesh::normals_calc_verts().

◆ BKE_keyblock_move()

bool BKE_keyblock_move ( 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 shape-key to move.
Returns
true if something was done, else false.

Definition at line 2274 of file key.cc.

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

Referenced by blender::ed::object::shapekey::ShapeKeyDropTarget::on_drop(), blender::ed::object::shape_key_make_basis_exec(), and blender::ed::object::shape_key_move_exec().

◆ BKE_keyblock_update_from_curve()

◆ 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 * mesh,
KeyBlock * kb )

◆ cp_cu_key()

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

◆ do_cu_key()

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

◆ do_curve_key()

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

◆ do_key()

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

◆ do_mesh_key()

◆ do_rel_cu_key()

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

◆ flerp()

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 571 of file key.cc.

References in.

Referenced by do_key().

◆ get_weights_array()

◆ key_block_get_data()

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],
KeyInterpolationType type )

Second derivative.

Definition at line 391 of file key.cc.

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

◆ key_curve_position_weights()

◆ key_curve_tangent_weights()

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

First derivative.

Definition at line 351 of file key.cc.

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

Referenced by BKE_where_on_path().

◆ key_evaluate_relative()

◆ key_pointer_size()

bool key_pointer_size ( const Key * key,
const int mode,
int * r_poinsize,
int * r_ofs,
int * r_step )
static

◆ keyblock_data_convert_to_curve()

◆ keyblock_data_convert_to_lattice()

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

Definition at line 1993 of file key.cc.

References copy_v3_v3(), i, and BPoint::vec.

Referenced by BKE_key_evaluate_object_ex(), and BKE_keyblock_convert_to_lattice().

◆ keyblock_free_per_block_weights()

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

◆ keyblock_get_per_block_weights()

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

◆ rel_flerp()

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

Definition at line 586 of file key.cc.

References in, and out.

Referenced by cp_key(), and key_evaluate_relative().

◆ setkeys()

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

◆ shapekey_blend_read_after_liblink()

void shapekey_blend_read_after_liblink ( BlendLibReader * ,
ID * id )
static

Definition at line 163 of file key.cc.

References BLI_assert, ID_TAG_EXTERN, ID::tag, and UNUSED_VARS_NDEBUG.

◆ shapekey_blend_read_data()

void shapekey_blend_read_data ( BlendDataReader * reader,
ID * id )
static

◆ shapekey_blend_write()

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

◆ shapekey_copy_data()

void shapekey_copy_data ( Main * ,
std::optional< Library * > ,
ID * id_dst,
const ID * id_src,
const int  )
static

◆ shapekey_foreach_id()

void shapekey_foreach_id ( ID * id,
LibraryForeachIDData * data )
static

Definition at line 100 of file key.cc.

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

◆ shapekey_free_data()

void shapekey_free_data ( ID * id)
static

Definition at line 89 of file key.cc.

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

◆ shapekey_owner_pointer_get()

ID ** shapekey_owner_pointer_get ( ID * id,
const bool debug_relationship_assert )
static

Definition at line 106 of file key.cc.

References BKE_key_from_id(), BLI_assert, and Key::from.

Variable Documentation

◆ IDType_ID_KE

IDTypeInfo IDType_ID_KE

Definition at line 171 of file key.cc.