Blender
V3.3
|
#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 ID * | shapekey_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) |
Key * | BKE_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 float * | get_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) |
float * | BKE_key_evaluate_object_ex (Object *ob, int *r_totelem, float *arr, size_t arr_size, ID *obdata) |
float * | BKE_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) |
Key * | BKE_key_from_id (ID *id) |
Key ** | BKE_key_from_object_p (Object *ob) |
Key * | BKE_key_from_object (Object *ob) |
KeyBlock * | BKE_keyblock_add (Key *key, const char *name) |
KeyBlock * | BKE_keyblock_add_ctime (Key *key, const char *name, const bool do_force) |
KeyBlock * | BKE_keyblock_from_object (Object *ob) |
KeyBlock * | BKE_keyblock_from_object_reference (Object *ob) |
KeyBlock * | BKE_keyblock_from_key (Key *key, int index) |
KeyBlock * | BKE_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 |
typedef struct WeightsArrayCache WeightsArrayCache |
Definition at line 252 of file key.c.
References BKE_id_new(), Key::elemsize, Key::elemstr, Key::from, GS, id, ID_CU_LEGACY, ID_KE, ID_LT, ID_ME, IPO_BPOINT, IPO_FLOAT, KEY_NORMAL, KEYELEM_ELEM_SIZE_CURVE, KEYELEM_FLOAT_LEN_COORD, ID::name, Key::type, and Key::uidgen.
Referenced by ED_mesh_join_objects_exec(), ED_mesh_shapes_join_objects_exec(), insert_curvekey(), insert_lattkey(), insert_meshkey(), ArmatureImporter::make_shape_keys(), and modifier_apply_shape().
Definition at line 1632 of file key.c.
References BKE_key_evaluate_object_ex(), and NULL.
Referenced by BKE_curve_calc_modifiers_pre(), insert_curvekey(), insert_lattkey(), and insert_meshkey().
float* BKE_key_evaluate_object_ex | ( | struct Object * | ob, |
int * | r_totelem, | ||
float * | arr, | ||
size_t | arr_size, | ||
struct ID * | obdata | ||
) |
Returns key coordinates (+ tilt) when key applied, NULL otherwise.
obdata | if given, also update that geometry with the result of the shape keys evaluation. |
Definition at line 1511 of file key.c.
References BKE_key_from_object(), BKE_keyblock_curve_element_count(), BKE_keyblock_from_object(), BLI_assert_unreachable, BLI_findlink(), BLI_listbase_is_empty(), Key::block, cp_cu_key(), cp_key(), curve, Object::data, Lattice::def, do_curve_key(), do_latt_key(), do_mesh_key(), ELEM, ListBase::first, KeyBlock::flag, get_weights_array(), GS, ID_CU_LEGACY, ID_LT, ID_ME, keyblock_data_convert_to_curve(), keyblock_data_convert_to_lattice(), keyblock_data_convert_to_mesh(), KEYBLOCK_MUTE, KEYELEM_ELEM_SIZE_CURVE, KEYELEM_FLOAT_LEN_COORD, lattice, MEM_callocN, MEM_freeN, mesh, min_ii(), Mesh::mvert, ID::name, NULL, Curve::nurb, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_SHAPE_LOCK, OB_SURF, OB_TYPE_SUPPORT_VGROUP, usdtokens::out(), Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, Key::refkey, Object::shapeflag, Object::shapenr, size(), Mesh::totvert, Object::type, and KeyBlock::vgroup.
Referenced by BKE_key_evaluate_object(), deformVerts(), and shape_key_remove_exec().
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().
Definition at line 240 of file key.c.
References BLI_pophead(), Key::block, KeyBlock::data, and MEM_freeN.
Definition at line 1783 of file key.c.
References BKE_key_from_id_p(), and NULL.
Referenced by BKE_blendfile_library_relocate(), BKE_id_copy_for_duplicate(), BKE_id_free_ex(), BKE_id_newptr_and_tag_clear(), BKE_lib_id_clear_library_data(), BKE_lib_id_make_local_generic(), BKE_lib_override_library_create_from_id(), BKE_lib_override_library_create_from_tag(), BKE_lib_override_library_make_local(), BKE_lib_override_library_update(), BLO_main_validate_shapekeys(), blender::deg::DepsgraphNodeBuilder::build_object_data_geometry_datablock(), blender::deg::DepsgraphRelationBuilder::build_object_data_geometry_datablock(), lib_override_library_create_from(), lib_override_library_resync(), lib_override_prefill_newid_from_existing_overrides(), and lib_override_remapper_overrides_add().
Definition at line 1758 of file key.c.
References GS, id, ID_CU_LEGACY, ID_LT, ID_ME, Curve::key, Lattice::key, Mesh::key, ID::name, NULL, and Curve::vfont.
Referenced by BKE_blendfile_library_relocate(), BKE_key_from_id(), BKE_key_from_object_p(), and BKE_lib_override_library_update().
Definition at line 1803 of file key.c.
References BKE_key_from_object_p(), and NULL.
Referenced by actedit_get_shapekeys(), action_new_poll(), animdata_filter_dopesheet_ob(), bc_has_animations(), 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::io::AbstractHierarchyWriter::check_is_animated(), deformMatrices(), deformMatricesEM(), deformVerts(), deformVertsEM(), draw_selected_name(), ED_actedit_animdata_from_context(), ED_object_shape_key_add(), get_orco_coords(), object_deforms_in_time(), object_frame_has_keyframe(), object_shape_key_mirror(), object_shapekey_remove(), ControllerExporter::operator()(), GeometryExporter::operator()(), sculpt_undo_restore_coords(), shape_key_clear_exec(), shape_key_move_exec(), shape_key_move_poll(), shape_key_retime_exec(), and special_aftertrans_update__actedit().
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().
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().
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().
Definition at line 1814 of file key.c.
References BLI_addtail(), BLI_listbase_count(), BLI_snprintf(), BLI_strncpy(), BLI_uniquename(), Key::block, DATA_, KEY_LINEAR, ListBase::last, MEM_callocN, KeyBlock::name, KeyBlock::pos, Key::refkey, KeyBlock::slidermax, KeyBlock::slidermin, Key::totkey, KeyBlock::type, KeyBlock::uid, and Key::uidgen.
Referenced by BKE_keyblock_add_ctime(), bm_to_mesh_shape(), ED_mesh_join_objects_exec(), ED_mesh_shapes_join_objects_exec(), modifier_apply_shape(), and shapekey_layers_to_keyblocks().
key | The key datablock to add to. |
name | Optional name for the new keyblock. |
do_force | always 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().
Definition at line 2115 of file key.c.
References BKE_keyblock_curve_element_count(), BKE_keyblock_update_from_curve(), KeyBlock::data, Key::elemsize, Curve::key, MEM_mallocN, MEM_SAFE_FREE, and KeyBlock::totelem.
Definition at line 1989 of file key.c.
References BKE_keyblock_update_from_lattice(), KeyBlock::data, Key::elemsize, Lattice::key, MEM_mallocN, MEM_SAFE_FREE, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, and KeyBlock::totelem.
Definition at line 2189 of file key.c.
References BKE_keyblock_update_from_mesh(), KeyBlock::data, Key::elemsize, len, MEM_malloc_arrayN, MEM_SAFE_FREE, KeyBlock::totelem, and Mesh::totvert.
void BKE_keyblock_convert_from_vertcos | ( | const Object * | ob, |
KeyBlock * | kb, | ||
const float(*) | vertCos[3] | ||
) |
Definition at line 2361 of file key.c.
References BKE_keyblock_curve_element_count(), BKE_keyblock_update_from_vertcos(), KeyBlock::data, Object::data, ELEM, Key::elemsize, Curve::key, Lattice::key, Mesh::key, MEM_mallocN, MEM_SAFE_FREE, Curve::nurb, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_SURF, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, Mesh::totvert, and Object::type.
Definition at line 2159 of file key.c.
References BKE_keyblock_curve_element_count(), KeyBlock::data, keyblock_data_convert_to_curve(), min_ii(), and KeyBlock::totelem.
Definition at line 2015 of file key.c.
References KeyBlock::data, Lattice::def, float(), keyblock_data_convert_to_lattice(), min_ii(), Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, and KeyBlock::totelem.
Definition at line 2212 of file key.c.
References KeyBlock::data, float(), keyblock_data_convert_to_mesh(), min_ii(), and KeyBlock::totelem.
Referenced by BKE_keyblock_mesh_calc_normals().
Definition at line 2394 of file key.c.
References Freestyle::a, BKE_nurbList_verts_count(), copy_v3_v3(), KeyBlock::data, Object::data, ELEM, ListBase::first, float(), KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, MEM_mallocN, NULL, Curve::nurb, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_SURF, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, Mesh::totvert, and Object::type.
Definition at line 1935 of file key.c.
References BLI_strncpy(), KeyBlock::curval, KeyBlock::pos, KeyBlock::relative, KeyBlock::slidermax, KeyBlock::slidermin, KeyBlock::type, and KeyBlock::vgroup.
Definition at line 1946 of file key.c.
References ELEM, Key::id, NULL, ptr, RNA_path_from_ID_to_property(), RNA_pointer_create(), and RNA_struct_find_property().
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] | ||
) |
Definition at line 1716 of file key.c.
References BKE_keyblock_curve_data_transform(), Key::block, data, ELEM, Key::elemsize, and ListBase::first.
void BKE_keyblock_curve_data_transform | ( | const ListBase * | nurb, |
const float | mat[4][4], | ||
const void * | src_data, | ||
void * | dst_data | ||
) |
Definition at line 2084 of file key.c.
References Freestyle::a, ListBase::first, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, mul_v3_m4v3(), and src.
Referenced by BKE_keyblock_curve_data_set_with_mat4().
int BKE_keyblock_curve_element_count | ( | const ListBase * | nurb | ) |
Definition at line 2026 of file key.c.
References Nurb::bezt, Nurb::bp, ListBase::first, KEYELEM_ELEM_LEN_BEZTRIPLE, KEYELEM_ELEM_LEN_BPOINT, Nurb::next, Nurb::pntsu, and Nurb::pntsv.
Referenced by BKE_key_evaluate_object_ex(), BKE_keyblock_convert_from_curve(), BKE_keyblock_convert_from_vertcos(), BKE_keyblock_convert_to_curve(), BKE_keyblock_update_from_curve(), and BKE_keyblock_update_from_vertcos().
Definition at line 1684 of file key.c.
References BKE_keyblock_data_get_from_shape().
Definition at line 1671 of file key.c.
References Key::block, ELEM, Key::elemsize, and ListBase::first.
Referenced by BKE_keyblock_data_get().
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().
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().
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().
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().
int BKE_keyblock_element_count | ( | const Key * | key | ) |
Definition at line 1649 of file key.c.
References BKE_keyblock_element_count_from_shape().
int BKE_keyblock_element_count_from_shape | ( | const Key * | key, |
const int | shape_index | ||
) |
Definition at line 1637 of file key.c.
References Key::block, ELEM, ListBase::first, and result.
Referenced by BKE_keyblock_element_calc_size_from_shape(), and BKE_keyblock_element_count().
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().
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().
Only the active key-block.
Definition at line 1890 of file key.c.
References BKE_key_from_object(), BLI_findlink(), Key::block, NULL, and Object::shapenr.
Referenced by BKE_editlattice_make(), BKE_key_evaluate_object_ex(), deformMatrices(), deformMatricesEM(), do_curve_key(), do_latt_key(), do_mesh_key(), ED_curve_editnurb_make(), get_stats_string(), sculpt_update_object(), shape_key_clear_exec(), shape_key_mode_exists_poll(), and shape_key_retime_exec().
Definition at line 1902 of file key.c.
References BKE_key_from_object(), NULL, and Key::refkey.
Definition at line 2570 of file key.c.
References Key::block, ListBase::first, KEY_RELATIVE, KeyBlock::next, KeyBlock::relative, and Key::type.
void BKE_keyblock_mesh_calc_normals | ( | const KeyBlock * | kb, |
const Mesh * | mesh, | ||
float(*) | r_vertnors[3], | ||
float(*) | r_polynors[3], | ||
float(*) | r_loopnors[3] | ||
) |
Definition at line 2220 of file key.c.
References BKE_keyblock_convert_to_mesh(), BKE_mesh_calc_normals_poly(), BKE_mesh_calc_normals_poly_and_vertex(), BKE_mesh_normals_loop_split(), CD_CUSTOMLOOPNORMAL, CustomData_get_layer(), Mesh::flag, float(), Mesh::ldata, ME_AUTOSMOOTH, Mesh::medge, MEM_dupallocN, MEM_freeN, MEM_malloc_arrayN, mesh, Mesh::mloop, Mesh::mpoly, Mesh::mvert, NULL, Mesh::smoothresh, Mesh::totedge, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.
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).
org_index | if < 0, current object's active shape will be used as skey to move. |
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().
void BKE_keyblock_update_from_curve | ( | const Curve * | UNUSEDcu, |
KeyBlock * | kb, | ||
const ListBase * | nurb | ||
) |
Definition at line 2045 of file key.c.
References Freestyle::a, Nurb::bezt, BKE_keyblock_curve_element_count(), BLI_assert, Nurb::bp, copy_v3_v3(), KeyBlock::data, ListBase::first, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, Nurb::next, Nurb::pntsu, Nurb::pntsv, BezTriple::radius, BPoint::radius, BezTriple::tilt, BPoint::tilt, KeyBlock::totelem, BezTriple::vec, and BPoint::vec.
Referenced by BKE_keyblock_convert_from_curve().
Definition at line 1969 of file key.c.
References Freestyle::a, BLI_assert, copy_v3_v3(), KeyBlock::data, Lattice::def, float(), Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, KeyBlock::totelem, and BPoint::vec.
Referenced by BKE_keyblock_convert_from_lattice().
Definition at line 2169 of file key.c.
References Freestyle::a, BLI_assert, MVert::co, copy_v3_v3(), KeyBlock::data, float(), Mesh::mvert, KeyBlock::totelem, and Mesh::totvert.
Referenced by BKE_keyblock_convert_from_mesh().
Definition at line 2455 of file key.c.
References Freestyle::a, add_v3_v3(), KeyBlock::data, Object::data, ELEM, ListBase::first, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, Curve::nurb, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_SURF, KeyBlock::totelem, and Object::type.
void BKE_keyblock_update_from_vertcos | ( | const Object * | ob, |
KeyBlock * | kb, | ||
const float(*) | vertCos[3] | ||
) |
Definition at line 2301 of file key.c.
References Freestyle::a, BKE_keyblock_curve_element_count(), BLI_assert, copy_v3_v3(), KeyBlock::data, Object::data, ELEM, ListBase::first, float(), KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, Curve::nurb, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_SURF, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, KeyBlock::totelem, Mesh::totvert, and Object::type.
Referenced by BKE_keyblock_convert_from_vertcos().
|
static |
Definition at line 820 of file key.c.
References Freestyle::a, Nurb::bezt, Nurb::bp, cp_key(), ListBase::first, KEY_MODE_BEZTRIPLE, KEY_MODE_BPOINT, KEYELEM_ELEM_LEN_BEZTRIPLE, KEYELEM_ELEM_LEN_BPOINT, max_ii(), min_ii(), Nurb::next, NULL, Curve::nurb, usdtokens::out(), Nurb::pntsu, and Nurb::pntsv.
Referenced by BKE_key_evaluate_object_ex(), and do_curve_key().
|
static |
Definition at line 683 of file key.c.
References Freestyle::a, BLI_assert_msg, Key::elemsize, Key::elemstr, float(), blender::math::floor(), IPO_BEZTRIPLE, IPO_BPOINT, IPO_FLOAT, key_block_get_data(), KEY_MODE_BEZTRIPLE, key_pointer_size(), KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, KEYELEM_FLOAT_LEN_COORD, MEM_freeN, Key::refkey, rel_flerp(), and KeyBlock::totelem.
Referenced by BKE_key_evaluate_object_ex(), cp_cu_key(), do_latt_key(), do_mesh_key(), and key_evaluate_relative().
|
static |
Definition at line 1408 of file key.c.
References Freestyle::a, Nurb::bezt, Nurb::bp, do_key(), ListBase::first, KEY_MODE_BEZTRIPLE, KEY_MODE_BPOINT, KEYELEM_ELEM_LEN_BEZTRIPLE, KEYELEM_ELEM_LEN_BPOINT, Nurb::next, Curve::nurb, usdtokens::out(), Nurb::pntsu, Nurb::pntsv, and t.
Referenced by do_curve_key().
Definition at line 1449 of file key.c.
References BKE_keyblock_from_object(), Key::block, cp_cu_key(), Key::ctime, Object::data, do_cu_key(), do_rel_cu_key(), Curve::key, KEY_RELATIVE, usdtokens::out(), setkeys(), t, and Key::type.
Referenced by BKE_key_evaluate_object_ex().
|
static |
Definition at line 992 of file key.c.
References Freestyle::a, BLI_assert_msg, Key::elemsize, Key::elemstr, flerp(), float(), blender::math::floor(), IPO_BEZTRIPLE, IPO_BPOINT, IPO_FLOAT, key_block_get_data(), KEY_MODE_BEZTRIPLE, key_pointer_size(), KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, KEYELEM_FLOAT_LEN_COORD, MEM_freeN, t, and KeyBlock::totelem.
Referenced by do_cu_key(), do_latt_key(), and do_mesh_key().
Definition at line 1473 of file key.c.
References BKE_keyblock_from_object(), Key::block, cp_key(), Key::ctime, Object::data, do_key(), Lattice::flag, key_evaluate_relative(), KEY_MODE_DUMMY, KEY_RELATIVE, keyblock_free_per_block_weights(), keyblock_get_per_block_weights(), LT_OUTSIDE, NULL, usdtokens::out(), outside_lattice(), setkeys(), t, and Key::type.
Referenced by BKE_key_evaluate_object_ex().
Definition at line 1380 of file key.c.
References BKE_keyblock_from_object(), Key::block, cp_key(), Key::ctime, do_key(), key_evaluate_relative(), KEY_MODE_DUMMY, KEY_RELATIVE, keyblock_free_per_block_weights(), keyblock_get_per_block_weights(), NULL, usdtokens::out(), setkeys(), t, and Key::type.
Referenced by BKE_key_evaluate_object_ex().
|
static |
Definition at line 1429 of file key.c.
References Freestyle::a, Nurb::bezt, Nurb::bp, ListBase::first, key_evaluate_relative(), KEY_MODE_BEZTRIPLE, KEY_MODE_BPOINT, KEYELEM_ELEM_LEN_BEZTRIPLE, KEYELEM_ELEM_LEN_BPOINT, Nurb::next, NULL, Curve::nurb, usdtokens::out(), Nurb::pntsu, and Nurb::pntsv.
Referenced by do_curve_key().
|
static |
Definition at line 1259 of file key.c.
References BKE_defvert_find_weight(), BKE_object_defgroup_count(), BKE_object_defgroup_name_index(), BMEditMesh::bm, BM_ELEM_CD_GET_VOID_P, BM_ITER_MESH_INDEX, BM_VERTS_OF_MESH, CD_MDEFORMVERT, CustomData_get_offset(), Object::data, WeightsArrayCache::defgroup_weights, Lattice::dvert, Mesh::dvert, Mesh::edit_mesh, MEM_callocN, MEM_mallocN, NULL, WeightsArrayCache::num_defgroup_weights, OB_LATTICE, OB_MESH, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, BMesh::totvert, Mesh::totvert, Object::type, and BMesh::vdata.
Referenced by BKE_key_evaluate_object_ex(), and keyblock_get_per_block_weights().
|
static |
Definition at line 613 of file key.c.
References Freestyle::a, BMEditMesh::bm, BM_ITER_MESH, BM_VERTS_OF_MESH, BMVert::co, copy_v3_v3(), KeyBlock::data, Mesh::edit_mesh, float(), Key::from, GS, ID_ME, if(), MEM_mallocN, ID::name, NULL, KeyBlock::totelem, and BMesh::totvert.
Referenced by cp_key(), do_key(), and key_evaluate_relative().
Second derivative.
Definition at line 415 of file key.c.
References data, KEY_BSPLINE, KEY_CARDINAL, KEY_CATMULL_ROM, KEY_LINEAR, t, and type.
Definition at line 336 of file key.c.
References data, KEY_BSPLINE, KEY_CARDINAL, KEY_CATMULL_ROM, KEY_LINEAR, t, and type.
Referenced by BKE_colorband_evaluate(), BKE_lattice_deform_data_eval_co(), BKE_subdiv_mesh_interpolate_position_on_edge(), BKE_where_on_path(), psys_interpolate_particle(), setkeys(), and tilt_bezpart().
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().
|
static |
Definition at line 860 of file key.c.
References usdtokens::b(), BLI_assert_msg, BLI_findlink(), Key::block, cp_key(), KeyBlock::curval, KeyBlock::data, Key::elemsize, Key::elemstr, ListBase::first, KeyBlock::flag, from, IPO_BEZTRIPLE, IPO_BPOINT, IPO_FLOAT, key_block_get_data(), KEY_MODE_BEZTRIPLE, key_pointer_size(), KEYBLOCK_MUTE, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, KEYELEM_FLOAT_LEN_COORD, MEM_freeN, KeyBlock::next, NULL, Key::refkey, rel_flerp(), KeyBlock::relative, and KeyBlock::totelem.
Referenced by do_latt_key(), do_mesh_key(), and do_rel_cu_key().
|
static |
Definition at line 647 of file key.c.
References BLI_assert_msg, Key::from, GS, ID_CU_LEGACY, ID_LT, ID_ME, KEY_MODE_BPOINT, KEYELEM_ELEM_LEN_BEZTRIPLE, KEYELEM_ELEM_LEN_BPOINT, KEYELEM_ELEM_SIZE_CURVE, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, KEYELEM_FLOAT_LEN_COORD, ID::name, and NULL.
Referenced by cp_key(), do_key(), and key_evaluate_relative().
|
static |
Definition at line 2133 of file key.c.
References copy_v3_v3(), ListBase::first, KEYELEM_ELEM_LEN_BEZTRIPLE, KEYELEM_ELEM_LEN_BPOINT, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, NULL, BezTriple::radius, BPoint::radius, BezTriple::tilt, BPoint::tilt, BezTriple::vec, and BPoint::vec.
Referenced by BKE_key_evaluate_object_ex(), and BKE_keyblock_convert_to_curve().
|
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().
|
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().
|
static |
Definition at line 1352 of file key.c.
References Freestyle::a, WeightsArrayCache::defgroup_weights, MEM_freeN, NULL, WeightsArrayCache::num_defgroup_weights, and Key::totkey.
Referenced by do_latt_key(), and do_mesh_key().
|
static |
Definition at line 1335 of file key.c.
References Key::block, ListBase::first, get_weights_array(), MEM_mallocN, KeyBlock::next, Key::totkey, and KeyBlock::vgroup.
Referenced by do_latt_key(), and do_mesh_key().
|
static |
Definition at line 604 of file key.c.
References Freestyle::a, and usdtokens::out().
Referenced by cp_key(), and key_evaluate_relative().
Definition at line 449 of file key.c.
References ListBase::first, interp_v4_v4v4(), KEY_BSPLINE, key_curve_position_weights(), ListBase::last, KeyBlock::next, NULL, pos, KeyBlock::pos, t, and type.
Referenced by do_curve_key(), do_latt_key(), and do_mesh_key().
|
static |
Definition at line 159 of file key.c.
References Key::adt, BKE_animdata_blend_read_data(), BLO_read_data_address, BLO_read_list(), BLO_read_requires_endian_switch(), Key::block, LISTBASE_FOREACH, Key::refkey, and switch_endian_keyblock().
|
static |
Definition at line 187 of file key.c.
References BLO_expand.
|
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.
|
static |
Definition at line 99 of file key.c.
References Key::adt, BKE_animdata_blend_write(), BKE_id_blend_write(), BLO_write_id_struct, BLO_write_is_undo(), BLO_write_raw(), BLO_write_struct_at_address, Key::block, KeyBlock::data, Key::elemsize, Key::id, ID_IS_OVERRIDE_LIBRARY, LISTBASE_FOREACH, NULL, and KeyBlock::totelem.
|
static |
Definition at line 54 of file key.c.
References BLI_duplicatelist(), Key::block, KeyBlock::data, ListBase::first, MEM_dupallocN, KeyBlock::next, and Key::refkey.
|
static |
Definition at line 88 of file key.c.
References BKE_LIB_FOREACHID_PROCESS_ID, data, Key::from, and IDWALK_CB_LOOPBACK.
Definition at line 75 of file key.c.
References BLI_pophead(), Key::block, KeyBlock::data, and MEM_freeN.
Referenced by BKE_key_free_data().
Definition at line 132 of file key.c.
References Freestyle::a, usdtokens::b(), BLI_endian_switch_float_array(), data, KeyBlock::data, Key::elemsize, Key::elemstr, float(), IPO_BEZTRIPLE, IPO_BPOINT, IPO_FLOAT, and KeyBlock::totelem.
Referenced by shapekey_blend_read_data().
IDTypeInfo IDType_ID_KE |