Blender
V3.3
|
Go to the source code of this file.
Functions | |
void | BKE_key_free_data (struct Key *key) |
void | BKE_key_free_nolib (struct Key *key) |
struct Key * | BKE_key_add (struct Main *bmain, struct ID *id) |
void | BKE_key_sort (struct 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) |
float * | BKE_key_evaluate_object_ex (struct Object *ob, int *r_totelem, float *arr, size_t arr_size, struct ID *obdata) |
float * | BKE_key_evaluate_object (struct Object *ob, int *r_totelem) |
int | BKE_keyblock_element_count_from_shape (const struct Key *key, int shape_index) |
int | BKE_keyblock_element_count (const struct Key *key) |
size_t | BKE_keyblock_element_calc_size_from_shape (const struct Key *key, int shape_index) |
size_t | BKE_keyblock_element_calc_size (const struct Key *key) |
bool | BKE_key_idtype_support (short id_type) |
struct Key ** | BKE_key_from_id_p (struct ID *id) |
struct Key * | BKE_key_from_id (struct ID *id) |
struct Key ** | BKE_key_from_object_p (struct Object *ob) |
struct Key * | BKE_key_from_object (struct Object *ob) |
struct KeyBlock * | BKE_keyblock_from_object (struct Object *ob) |
struct KeyBlock * | BKE_keyblock_from_object_reference (struct Object *ob) |
struct KeyBlock * | BKE_keyblock_add (struct Key *key, const char *name) |
struct KeyBlock * | BKE_keyblock_add_ctime (struct Key *key, const char *name, bool do_force) |
struct KeyBlock * | BKE_keyblock_from_key (struct Key *key, int index) |
struct KeyBlock * | BKE_keyblock_find_name (struct Key *key, const char name[]) |
void | BKE_keyblock_copy_settings (struct KeyBlock *kb_dst, const struct KeyBlock *kb_src) |
copy shape-key attributes, but not key data or name/UID. More... | |
char * | BKE_keyblock_curval_rnapath_get (const struct Key *key, const struct KeyBlock *kb) |
void | BKE_keyblock_update_from_lattice (const struct Lattice *lt, struct KeyBlock *kb) |
void | BKE_keyblock_convert_from_lattice (const struct Lattice *lt, struct KeyBlock *kb) |
void | BKE_keyblock_convert_to_lattice (const struct KeyBlock *kb, struct Lattice *lt) |
int | BKE_keyblock_curve_element_count (const struct ListBase *nurb) |
void | BKE_keyblock_curve_data_transform (const struct ListBase *nurb, const float mat[4][4], const void *src, void *dst) |
void | BKE_keyblock_update_from_curve (const struct Curve *cu, struct KeyBlock *kb, const struct ListBase *nurb) |
void | BKE_keyblock_convert_from_curve (const struct Curve *cu, struct KeyBlock *kb, const struct ListBase *nurb) |
void | BKE_keyblock_convert_to_curve (struct KeyBlock *kb, struct Curve *cu, struct ListBase *nurb) |
void | BKE_keyblock_update_from_mesh (const struct Mesh *me, struct KeyBlock *kb) |
void | BKE_keyblock_convert_from_mesh (const struct Mesh *me, const struct Key *key, struct KeyBlock *kb) |
void | BKE_keyblock_convert_to_mesh (const struct KeyBlock *kb, struct MVert *mvert, int totvert) |
void | BKE_keyblock_mesh_calc_normals (const struct KeyBlock *kb, const struct Mesh *mesh, float(*r_vertnors)[3], float(*r_polynors)[3], float(*r_loopnors)[3]) |
void | BKE_keyblock_update_from_vertcos (const struct Object *ob, struct KeyBlock *kb, const float(*vertCos)[3]) |
void | BKE_keyblock_convert_from_vertcos (const struct Object *ob, struct KeyBlock *kb, const float(*vertCos)[3]) |
float(* | BKE_keyblock_convert_to_vertcos (const struct Object *ob, const struct KeyBlock *kb))[3] |
void | BKE_keyblock_update_from_offset (const struct Object *ob, struct KeyBlock *kb, const float(*ofs)[3]) |
bool | BKE_keyblock_move (struct Object *ob, int org_index, int new_index) |
bool | BKE_keyblock_is_basis (const struct Key *key, int index) |
Key-Block Data Access | |
void | BKE_keyblock_data_get_from_shape (const struct Key *key, float(*arr)[3], int shape_index) |
void | BKE_keyblock_data_get (const struct Key *key, float(*arr)[3]) |
void | BKE_keyblock_data_set_with_mat4 (struct Key *key, int shape_index, const float(*coords)[3], const float mat[4][4]) |
void | BKE_keyblock_curve_data_set_with_mat4 (struct Key *key, const struct ListBase *nurb, int shape_index, const void *data, const float mat[4][4]) |
void | BKE_keyblock_data_set (struct Key *key, int shape_index, const void *data) |
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 | ( | 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().
void BKE_keyblock_convert_from_curve | ( | const struct Curve * | cu, |
struct KeyBlock * | kb, | ||
const struct ListBase * | nurb | ||
) |
Referenced by insert_curvekey().
Referenced by insert_lattkey().
void BKE_keyblock_convert_from_vertcos | ( | const struct Object * | ob, |
struct KeyBlock * | kb, | ||
const float(*) | vertCos[3] | ||
) |
void BKE_keyblock_convert_to_curve | ( | struct KeyBlock * | kb, |
struct Curve * | cu, | ||
struct ListBase * | nurb | ||
) |
Referenced by BKE_object_shapekey_remove(), and ED_curve_editnurb_make().
Referenced by BKE_editlattice_make(), and BKE_object_shapekey_remove().
float(* BKE_keyblock_convert_to_vertcos | ( | const struct Object * | ob, |
const struct KeyBlock * | kb | ||
) | )[3] |
Referenced by sculpt_undo_restore_coords(), sculpt_update_object(), and SCULPT_vertcos_to_key().
copy shape-key attributes, but not key data or name/UID.
Referenced by ED_mesh_join_objects_exec().
Get RNA-Path for 'value' setting of the given shape-key.
Referenced by achannel_setting_slider_shapekey_cb(), ANIM_channel_draw_widgets(), and make_new_animlistelem().
void BKE_keyblock_curve_data_set_with_mat4 | ( | struct Key * | key, |
const struct ListBase * | nurb, | ||
int | shape_index, | ||
const void * | data, | ||
const float | mat[4][4] | ||
) |
Set the data for all key-blocks (or shape_index if != -1), transforming by mat.
Referenced by ED_object_data_xform_by_mat4().
void BKE_keyblock_curve_data_transform | ( | const struct ListBase * | nurb, |
const float | mat[4][4], | ||
const void * | src, | ||
void * | dst | ||
) |
int BKE_keyblock_curve_element_count | ( | const struct ListBase * | nurb | ) |
Referenced by BKE_curve_calc_modifiers_pre(), calc_shapeKeys(), and do_versions_after_linking_280().
shape_index | The index to use or all (when -1). |
Referenced by ED_object_data_xform_create_ex().
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 struct Key * | key | ) |
size_t BKE_keyblock_element_calc_size_from_shape | ( | const struct Key * | key, |
int | shape_index | ||
) |
shape_index | The index to use or all (when -1). |
Referenced by ED_object_data_xform_create_ex().
int BKE_keyblock_element_count | ( | const struct Key * | key | ) |
int BKE_keyblock_element_count_from_shape | ( | const struct Key * | key, |
int | shape_index | ||
) |
shape_index | The index to use or all (when -1). |
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.
Check if given key-block (as index) is used as basis by others in given key.
Referenced by bm_to_mesh_shape(), calc_shapeKeys(), and SCULPT_vertcos_to_key().
void BKE_keyblock_mesh_calc_normals | ( | const struct KeyBlock * | kb, |
const struct Mesh * | mesh, | ||
float(*) | r_vertnors[3], | ||
float(*) | r_polynors[3], | ||
float(*) | r_loopnors[3] | ||
) |
Computes normals (vertices, polygons and/or loops ones) of given mesh for given shape key.
kb | the KeyBlock to use to compute normals. |
mesh | the Mesh to apply key-block to. |
r_vertnors | if non-NULL, an array of vectors, same length as number of vertices. |
r_polynors | if non-NULL, an array of vectors, same length as number of polygons. |
r_loopnors | if non-NULL, an array of vectors, same length as number of loops. |
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 struct Curve * | cu, |
struct KeyBlock * | kb, | ||
const struct ListBase * | nurb | ||
) |
void BKE_keyblock_update_from_offset | ( | const struct Object * | ob, |
struct KeyBlock * | kb, | ||
const float(*) | ofs[3] | ||
) |
Referenced by SCULPT_vertcos_to_key().
void BKE_keyblock_update_from_vertcos | ( | const struct Object * | ob, |
struct KeyBlock * | kb, | ||
const float(*) | vertCos[3] | ||
) |
Referenced by SCULPT_vertcos_to_key().
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().