|
Blender V4.5
|
#include <algorithm>#include <cmath>#include <cstddef>#include <cstring>#include <optional>#include "MEM_guardedalloc.h"#include "BLI_endian_switch.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 |
| #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 | switch_endian_keyblock (Key *key, KeyBlock *kb) |
| 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) |
| Key * | BKE_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 float * | get_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) |
| 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_duplicate (Key *key, KeyBlock *kb_src) |
| 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_find_by_index (Key *key, int index) |
| KeyBlock * | BKE_keyblock_find_name (Key *key, const char name[]) |
| KeyBlock * | BKE_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 |
| #define IPO_BEZTRIPLE 100 |
Definition at line 151 of file key.cc.
Referenced by cp_key(), do_key(), key_evaluate_relative(), and switch_endian_keyblock().
| #define IPO_BPOINT 101 |
Definition at line 152 of file key.cc.
Referenced by BKE_key_add(), cp_key(), do_key(), key_evaluate_relative(), and switch_endian_keyblock().
| #define IPO_FLOAT 4 |
Definition at line 150 of file key.cc.
Referenced by BKE_key_add(), cp_key(), do_key(), key_evaluate_relative(), and switch_endian_keyblock().
| #define KEY_MODE_BEZTRIPLE 2 |
Definition at line 240 of file key.cc.
Referenced by cp_cu_key(), cp_key(), do_cu_key(), do_key(), do_rel_cu_key(), and key_evaluate_relative().
| #define KEY_MODE_BPOINT 1 |
Definition at line 239 of file key.cc.
Referenced by cp_cu_key(), do_cu_key(), do_rel_cu_key(), and key_pointer_size().
| #define KEY_MODE_DUMMY 0 |
Definition at line 238 of file key.cc.
Referenced by do_latt_key(), and do_mesh_key().
| using blender::float3 |
Definition at line 619 of file BLI_math_vector_types.hh.
| using blender::float4x4 |
Definition at line 1012 of file BLI_math_matrix_types.hh.
Definition at line 258 of file key.cc.
References BKE_id_new(), BKE_key_add(), Key::elemsize, Key::elemstr, Key::from, GS, ID_CU_LEGACY, 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 BKE_key_add(), ED_mesh_join_objects_exec(), ED_mesh_shapes_join_objects_exec(), blender::io::fbx::import_blend_shapes(), blender::io::usd::import_blendshapes(), insert_curvekey(), insert_lattkey(), insert_meshkey(), ArmatureImporter::make_shape_keys(), and blender::ed::object::modifier_apply_shape().
| float * BKE_key_evaluate_object | ( | Object * | ob, |
| int * | r_totelem ) |
Definition at line 1644 of file key.cc.
References BKE_key_evaluate_object(), and BKE_key_evaluate_object_ex().
Referenced by BKE_curve_calc_modifiers_pre(), BKE_key_evaluate_object(), insert_curvekey(), insert_lattkey(), and insert_meshkey().
| float * BKE_key_evaluate_object_ex | ( | Object * | ob, |
| int * | r_totelem, | ||
| float * | arr, | ||
| size_t | arr_size, | ||
| 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 1521 of file key.cc.
References BKE_key_evaluate_object_ex(), 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(), 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_MUTE, KEYELEM_ELEM_SIZE_CURVE, KEYELEM_FLOAT_LEN_COORD, MEM_calloc_arrayN(), MEM_freeN(), min_ii(), ID::name, Curve::nurb, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_SHAPE_LOCK, OB_SURF, OB_TYPE_SUPPORT_VGROUP, out, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, Key::refkey, Object::shapeflag, Object::shapenr, Object::type, Mesh::verts_num, and KeyBlock::vgroup.
Referenced by BKE_key_evaluate_object(), BKE_key_evaluate_object_ex(), deform_verts(), and blender::ed::object::shape_key_remove_exec().
| void BKE_key_free_nolib | ( | Key * | key | ) |
Definition at line 248 of file key.cc.
References BKE_key_free_nolib(), BLI_pophead(), Key::block, and MEM_freeN().
Referenced by BKE_key_free_nolib().
Definition at line 1804 of file key.cc.
References BKE_key_from_id(), and BKE_key_from_id_p().
Referenced by BKE_blendfile_library_relocate(), BKE_id_copy_for_duplicate(), BKE_id_newptr_and_tag_clear(), BKE_key_from_id(), 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_main_operations_create(), BKE_lib_override_library_make_local(), BKE_lib_override_library_update(), blendfile_library_relocate_id_remap(), blendfile_relocate_postprocess_cleanup(), BLO_main_validate_shapekeys(), blender::deg::DepsgraphNodeBuilder::build_object_data_geometry_datablock(), blender::deg::DepsgraphRelationBuilder::build_object_data_geometry_datablock(), blender::animrig::find_related_ids(), id_delete(), id_free(), lib_override_library_create_from(), lib_override_library_resync(), lib_override_prefill_newid_from_existing_overrides(), lib_override_remapper_overrides_add(), and shapekey_owner_pointer_get().
Definition at line 1779 of file key.cc.
References BKE_key_from_id_p(), GS, ID_CU_LEGACY, ID_LT, ID_ME, Curve::key, Lattice::key, Mesh::key, ID::name, OB_FONT, and Curve::ob_type.
Referenced by BKE_id_copy_for_use_in_bmain(), BKE_key_from_id(), BKE_key_from_id_p(), BKE_key_from_object_p(), BKE_lib_override_library_update(), blendfile_library_relocate_id_remap(), and lib_override_library_resync().
Definition at line 1824 of file key.cc.
References BKE_key_from_object(), and BKE_key_from_object_p().
Referenced by actedit_get_shapekeys(), action_new_poll(), animdata_filter_dopesheet_ob(), bc_has_animations(), BKE_key_evaluate_object_ex(), BKE_key_from_object(), 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(), 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_shapekey_remove(), ControllerExporter::operator()(), GeometryExporter::operator()(), 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_move_exec(), blender::ed::object::shape_key_move_poll(), blender::ed::object::shape_key_retime_exec(), and blender::ed::transform::special_aftertrans_update__actedit().
Definition at line 1815 of file key.cc.
References BKE_key_from_id_p(), BKE_key_from_object_p(), and Object::data.
Referenced by BKE_key_from_object(), BKE_key_from_object_p(), and BKE_object_shapekey_free().
| bool BKE_key_idtype_support | ( | const short | id_type | ) |
Definition at line 1767 of file key.cc.
References BKE_key_idtype_support(), ID_CU_LEGACY, ID_LT, and ID_ME.
Referenced by BKE_key_idtype_support(), and BLO_main_validate_shapekeys().
| 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 310 of file key.cc.
References BKE_key_sort(), BLI_insertlinkafter(), BLI_remlink(), Key::block, ListBase::first, LISTBASE_FOREACH, KeyBlock::next, KeyBlock::pos, and Key::refkey.
Referenced by BKE_key_sort(), BKE_keyblock_add_ctime(), and ED_mesh_join_objects_exec().
Definition at line 1835 of file key.cc.
References BKE_keyblock_add(), BLI_addtail(), BLI_listbase_count(), BLI_uniquename(), Key::block, DATA_, KEY_LINEAR, ListBase::last, MEM_callocN(), KeyBlock::name, offsetof, KeyBlock::pos, Key::refkey, KeyBlock::slidermax, KeyBlock::slidermin, SNPRINTF, STRNCPY(), STRNCPY_UTF8, Key::totkey, KeyBlock::type, KeyBlock::uid, and Key::uidgen.
Referenced by BKE_keyblock_add(), BKE_keyblock_add_ctime(), BKE_keyblock_duplicate(), bm_to_mesh_shape(), ED_mesh_join_objects_exec(), ED_mesh_shapes_join_objects_exec(), blender::io::fbx::import_blend_shapes(), blender::io::usd::import_blendshapes(), keyblock_ensure_from_uid(), and blender::ed::object::modifier_apply_shape().
| 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 1895 of file key.cc.
References BKE_key_sort(), BKE_keyblock_add(), BKE_keyblock_add_ctime(), Key::block, compare_ff(), Key::ctime, KEY_RELATIVE, LISTBASE_FOREACH, KeyBlock::pos, and Key::type.
Referenced by BKE_keyblock_add_ctime(), insert_curvekey(), insert_lattkey(), insert_meshkey(), and ArmatureImporter::make_shape_keys().
Definition at line 2134 of file key.cc.
References BKE_keyblock_convert_from_curve(), BKE_keyblock_curve_element_count(), BKE_keyblock_update_from_curve(), KeyBlock::data, Key::elemsize, Curve::key, MEM_malloc_arrayN(), MEM_SAFE_FREE, and KeyBlock::totelem.
Referenced by BKE_keyblock_convert_from_curve(), and insert_curvekey().
Definition at line 2009 of file key.cc.
References BKE_keyblock_convert_from_lattice(), BKE_keyblock_update_from_lattice(), KeyBlock::data, Key::elemsize, Lattice::key, MEM_malloc_arrayN(), MEM_SAFE_FREE, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, and KeyBlock::totelem.
Referenced by BKE_keyblock_convert_from_lattice(), and insert_lattkey().
Definition at line 2203 of file key.cc.
References BKE_keyblock_convert_from_mesh(), BKE_keyblock_update_from_mesh(), KeyBlock::data, Key::elemsize, len(), MEM_malloc_arrayN(), MEM_SAFE_FREE, KeyBlock::totelem, and Mesh::verts_num.
Referenced by BKE_keyblock_convert_from_mesh(), ED_mesh_shapes_join_objects_exec(), blender::io::fbx::import_blend_shapes(), blender::io::usd::import_blendshapes(), insert_meshkey(), ArmatureImporter::make_shape_keys(), and blender::ed::object::modifier_apply_shape().
Definition at line 2180 of file key.cc.
References BKE_keyblock_convert_to_curve(), BKE_keyblock_curve_element_count(), KeyBlock::data, keyblock_data_convert_to_curve(), min_ii(), and KeyBlock::totelem.
Referenced by BKE_keyblock_convert_to_curve(), BKE_object_shapekey_remove(), and ED_curve_editnurb_make().
Definition at line 2035 of file key.cc.
References BKE_keyblock_convert_to_lattice(), KeyBlock::data, Lattice::def, keyblock_data_convert_to_lattice(), min_ii(), Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, and KeyBlock::totelem.
Referenced by BKE_editlattice_make(), BKE_keyblock_convert_to_lattice(), and BKE_object_shapekey_remove().
| void BKE_keyblock_convert_to_mesh | ( | const KeyBlock * | kb, |
| blender::MutableSpan< blender::float3 > | vert_positions ) |
Definition at line 2219 of file key.cc.
References BKE_keyblock_convert_to_mesh(), blender::MutableSpan< T >::copy_from(), KeyBlock::data, blender::MutableSpan< T >::take_front(), and KeyBlock::totelem.
Referenced by BKE_keyblock_convert_to_mesh(), BKE_keyblock_mesh_calc_normals(), BKE_object_shapekey_remove(), blender::ed::object::create_applied_mesh_for_modifier(), blender::io::usd::get_shape_key_basis_mesh(), and GeometryExporter::operator()().
copy shape-key attributes, but not key data or name/UID.
Definition at line 1964 of file key.cc.
References BKE_keyblock_copy_settings(), KeyBlock::curval, KeyBlock::pos, KeyBlock::relative, KeyBlock::slidermax, KeyBlock::slidermin, STRNCPY(), KeyBlock::type, and KeyBlock::vgroup.
Referenced by BKE_keyblock_copy_settings(), BKE_keyblock_duplicate(), and ED_mesh_join_objects_exec().
| 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.
Definition at line 1975 of file key.cc.
References BKE_keyblock_curval_rnapath_get(), ELEM, Key::id, 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(), BKE_keyblock_curval_rnapath_get(), and make_new_animlistelem().
| 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 1734 of file key.cc.
References BKE_keyblock_curve_data_set_with_mat4(), BKE_keyblock_curve_data_transform(), Key::block, data, ELEM, Key::elemsize, ListBase::first, KeyBlock::next, and transform().
Referenced by BKE_keyblock_curve_data_set_with_mat4(), BKE_keyblock_data_set_with_mat4(), and blender::ed::object::data_xform_by_mat4().
| void BKE_keyblock_curve_data_transform | ( | const ListBase * | nurb, |
| const float | mat[4][4], | ||
| const void * | src_data, | ||
| void * | dst_data ) |
Definition at line 2103 of file key.cc.
References BKE_keyblock_curve_data_transform(), i, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, LISTBASE_FOREACH, and mul_v3_m4v3().
Referenced by BKE_keyblock_curve_data_set_with_mat4(), and BKE_keyblock_curve_data_transform().
| int BKE_keyblock_curve_element_count | ( | const ListBase * | nurb | ) |
Definition at line 2046 of file key.cc.
References Nurb::bezt, BKE_keyblock_curve_element_count(), Nurb::bp, ListBase::first, KEYELEM_ELEM_LEN_BEZTRIPLE, KEYELEM_ELEM_LEN_BPOINT, Nurb::next, Nurb::pntsu, and Nurb::pntsv.
Referenced by BKE_curve_calc_modifiers_pre(), BKE_key_evaluate_object_ex(), BKE_keyblock_convert_from_curve(), BKE_keyblock_convert_to_curve(), BKE_keyblock_curve_element_count(), BKE_keyblock_update_from_curve(), calc_shapeKeys(), and do_versions_after_linking_280().
| void BKE_keyblock_data_get | ( | const Key * | key, |
| MutableSpan< float3 > | arr ) |
Definition at line 1702 of file key.cc.
References BKE_keyblock_data_get(), and BKE_keyblock_data_get_from_shape().
| void BKE_keyblock_data_get_from_shape | ( | const Key * | key, |
| MutableSpan< float3 > | arr, | ||
| const int | shape_index ) |
Definition at line 1685 of file key.cc.
References BKE_keyblock_data_get_from_shape(), Key::block, blender::MutableSpan< T >::data(), ELEM, Key::elemsize, ListBase::first, and KeyBlock::next.
| 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 1752 of file key.cc.
References BKE_keyblock_data_set(), Key::block, data, ELEM, Key::elemsize, ListBase::first, and KeyBlock::next.
Referenced by BKE_keyblock_data_set(), BKE_keyblock_data_set_with_mat4(), and blender::ed::object::data_xform_restore().
| void BKE_keyblock_data_set_with_mat4 | ( | Key * | key, |
| const int | shape_index, | ||
| const Span< float3 > | coords, | ||
| const float4x4 & | transform ) |
Definition at line 1707 of file key.cc.
References BKE_keyblock_data_set_with_mat4(), BLI_assert_msg, Key::block, blender::Span< T >::data(), ELEM, Key::elemsize, ListBase::first, mul_v3_m4v3(), KeyBlock::next, and transform().
Add a copy of the source key-block with a copy of its data array.
Definition at line 1882 of file key.cc.
References BKE_keyblock_add(), BKE_keyblock_copy_settings(), BKE_keyblock_duplicate(), BLI_assert, BLI_findindex(), BLI_insertlinkafter(), BLI_remlink(), Key::block, KeyBlock::data, KeyBlock::flag, MEM_dupallocN(), KeyBlock::name, and KeyBlock::totelem.
Referenced by BKE_keyblock_duplicate(), and blender::ed::object::shape_key_copy_exec().
| size_t BKE_keyblock_element_calc_size | ( | const Key * | key | ) |
Definition at line 1673 of file key.cc.
References BKE_keyblock_element_calc_size(), and BKE_keyblock_element_calc_size_from_shape().
Referenced by BKE_keyblock_element_calc_size().
| size_t BKE_keyblock_element_calc_size_from_shape | ( | const Key * | key, |
| int | shape_index ) |
| shape_index | The index to use or all (when -1). |
Definition at line 1668 of file key.cc.
References BKE_keyblock_element_calc_size_from_shape(), BKE_keyblock_element_count_from_shape(), and Key::elemsize.
Referenced by BKE_keyblock_element_calc_size(), BKE_keyblock_element_calc_size_from_shape(), and blender::ed::object::data_xform_create_ex().
| int BKE_keyblock_element_count | ( | const Key * | key | ) |
Definition at line 1663 of file key.cc.
References BKE_keyblock_element_count(), and BKE_keyblock_element_count_from_shape().
Referenced by BKE_keyblock_element_count().
| int BKE_keyblock_element_count_from_shape | ( | const Key * | key, |
| int | shape_index ) |
| shape_index | The index to use or all (when -1). |
Definition at line 1649 of file key.cc.
References BKE_keyblock_element_count_from_shape(), Key::block, ELEM, ListBase::first, KeyBlock::next, and result.
Referenced by BKE_keyblock_element_calc_size_from_shape(), BKE_keyblock_element_count(), and BKE_keyblock_element_count_from_shape().
Get the appropriate KeyBlock given an index (0 refers to the basis key). Key may be null.
Definition at line 1940 of file key.cc.
References BKE_keyblock_find_by_index(), BLI_findlink(), and Key::block.
Referenced by BKE_keyblock_find_by_index(), BKE_keyblock_from_object(), deform_verts(), ED_curve_get_edit_shape_key(), ED_lattice_get_edit_shape_key(), ED_mesh_get_edit_shape_key(), blender::ed::sculpt_paint::ShapeKeyData::from_object(), blender::bke::get_orco_coords(), and shapekey_adrcodes_to_paths().
Get the appropriate KeyBlock given a name to search for.
Definition at line 1949 of file key.cc.
References BKE_keyblock_find_name(), BLI_findstring(), Key::block, and offsetof.
Referenced by BKE_keyblock_find_name(), ED_mesh_join_objects_exec(), ED_mesh_shapes_join_objects_exec(), edbm_blend_from_shape_exec(), blender::io::fbx::import_blend_shape_full_weights(), join_mesh_single(), and blender::ed::sculpt_paint::undo::restore_active_shape_key().
Definition at line 1954 of file key.cc.
References BKE_keyblock_find_uid(), Key::block, and LISTBASE_FOREACH.
Referenced by BKE_keyblock_find_uid(), and keyblock_ensure_from_uid().
Only the active key-block.
Definition at line 1922 of file key.cc.
References BKE_key_from_object(), BKE_keyblock_find_by_index(), BKE_keyblock_from_object(), and Object::shapenr.
Referenced by BKE_editlattice_make(), BKE_key_evaluate_object_ex(), BKE_keyblock_from_object(), deform_matrices(), deform_matrices_EM(), do_curve_key(), do_latt_key(), do_mesh_key(), ED_curve_editnurb_make(), get_stats_string(), blender::ed::sculpt_paint::undo::save_common_data(), sculpt_update_object(), blender::ed::object::shape_key_copy_exec(), blender::ed::object::shape_key_exists_poll(), blender::ed::object::shape_key_mode_exists_poll(), and blender::ed::object::shape_key_report_if_active_locked().
Definition at line 1929 of file key.cc.
References BKE_key_from_object(), BKE_keyblock_from_object_reference(), and Key::refkey.
Referenced by BKE_keyblock_from_object_reference().
| 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 2404 of file key.cc.
References BKE_keyblock_get_dependent_keys(), BLI_listbase_count(), Key::block, i, KEY_RELATIVE, LISTBASE_FOREACH_INDEX, KeyBlock::relative, and Key::type.
Referenced by BKE_keyblock_get_dependent_keys(), bm_to_mesh_shape(), calc_shapeKeys(), and blender::ed::sculpt_paint::ShapeKeyData::from_object().
| 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 2388 of file key.cc.
References BKE_keyblock_is_basis(), Key::block, ListBase::first, i, KEY_RELATIVE, KeyBlock::next, KeyBlock::relative, and Key::type.
Referenced by BKE_keyblock_is_basis().
| 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.
| kb | the KeyBlock to use to compute normals. |
| mesh | the Mesh to apply key-block to. |
| r_vert_normals | if non-NULL, an array of vectors, same length as number of vertices. |
| r_face_normals | if non-NULL, an array of vectors, same length as number of faces. |
| r_loop_normals | if non-NULL, an array of vectors, same length as number of loops. |
Definition at line 2226 of file key.cc.
References BKE_keyblock_convert_to_mesh(), BKE_keyblock_mesh_calc_normals(), blender::bke::Corner, blender::bke::Edge, blender::bke::Face, blender::bke::AttributeAccessor::lookup(), MEM_freeN(), MEM_malloc_arrayN(), blender::bke::mesh::normals_calc_corners(), blender::bke::mesh::normals_calc_faces(), blender::bke::mesh::normals_calc_verts(), and blender::offset_indices::OffsetIndices< T >::size().
Referenced by BKE_keyblock_mesh_calc_normals().
| 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).
| org_index | if < 0, current object's active shape will be used as shape-key to move. |
Definition at line 2307 of file key.cc.
References BKE_key_from_object(), BKE_keyblock_move(), 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 BKE_keyblock_move(), and blender::ed::object::shape_key_move_exec().
Definition at line 2065 of file key.cc.
References BKE_keyblock_curve_element_count(), BKE_keyblock_update_from_curve(), BLI_assert, copy_v3_v3(), KeyBlock::data, i, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, LISTBASE_FOREACH, BezTriple::radius, BPoint::radius, BezTriple::tilt, BPoint::tilt, KeyBlock::totelem, BezTriple::vec, and BPoint::vec.
Referenced by BKE_keyblock_convert_from_curve(), and BKE_keyblock_update_from_curve().
Definition at line 1989 of file key.cc.
References BKE_keyblock_update_from_lattice(), BLI_assert, copy_v3_v3(), KeyBlock::data, Lattice::def, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, KeyBlock::totelem, and BPoint::vec.
Referenced by BKE_keyblock_convert_from_lattice(), and BKE_keyblock_update_from_lattice().
Definition at line 2190 of file key.cc.
References BKE_keyblock_update_from_mesh(), BLI_assert, blender::Span< T >::data(), KeyBlock::data, KeyBlock::totelem, and Mesh::verts_num.
Referenced by BKE_keyblock_convert_from_mesh(), BKE_keyblock_update_from_mesh(), and ED_mesh_shapes_join_objects_exec().
|
static |
Definition at line 835 of file key.cc.
References Nurb::bezt, Nurb::bp, cp_cu_key(), cp_key(), ListBase::first, KEY_MODE_BEZTRIPLE, KEY_MODE_BPOINT, KEYELEM_ELEM_LEN_BEZTRIPLE, KEYELEM_ELEM_LEN_BPOINT, max_ii(), min_ii(), Nurb::next, Curve::nurb, out, Nurb::pntsu, Nurb::pntsv, and step.
Referenced by BKE_key_evaluate_object_ex(), cp_cu_key(), and do_curve_key().
|
static |
Definition at line 700 of file key.cc.
References BLI_assert_msg, cp_key(), Key::elemsize, Key::elemstr, 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(), step, and KeyBlock::totelem.
Referenced by BKE_key_evaluate_object_ex(), cp_cu_key(), cp_key(), do_latt_key(), do_mesh_key(), and key_evaluate_relative().
|
static |
Definition at line 1420 of file key.cc.
References Nurb::bezt, Nurb::bp, do_cu_key(), do_key(), ListBase::first, KEY_MODE_BEZTRIPLE, KEY_MODE_BPOINT, KEYELEM_ELEM_LEN_BEZTRIPLE, KEYELEM_ELEM_LEN_BPOINT, Nurb::next, Curve::nurb, out, Nurb::pntsu, Nurb::pntsv, and step.
Referenced by do_cu_key(), and do_curve_key().
Definition at line 1461 of file key.cc.
References BKE_keyblock_from_object(), Key::block, cp_cu_key(), Key::ctime, Object::data, do_cu_key(), do_curve_key(), do_rel_cu_key(), Curve::key, KEY_RELATIVE, out, setkeys(), and Key::type.
Referenced by BKE_key_evaluate_object_ex(), and do_curve_key().
|
static |
Definition at line 1007 of file key.cc.
References BLI_assert_msg, do_key(), Key::elemsize, Key::elemstr, flerp(), 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(), step, and KeyBlock::totelem.
Referenced by do_cu_key(), do_key(), do_latt_key(), and do_mesh_key().
Definition at line 1485 of file key.cc.
References BKE_keyblock_from_object(), Key::block, cp_key(), Key::ctime, Object::data, do_key(), do_latt_key(), Lattice::flag, key_evaluate_relative(), KEY_MODE_DUMMY, KEY_RELATIVE, keyblock_free_per_block_weights(), keyblock_get_per_block_weights(), LT_OUTSIDE, out, outside_lattice(), setkeys(), and Key::type.
Referenced by BKE_key_evaluate_object_ex(), and do_latt_key().
Definition at line 1393 of file key.cc.
References BKE_keyblock_from_object(), Key::block, cp_key(), Key::ctime, do_key(), do_mesh_key(), key_evaluate_relative(), KEY_MODE_DUMMY, KEY_RELATIVE, keyblock_free_per_block_weights(), keyblock_get_per_block_weights(), out, setkeys(), and Key::type.
Referenced by BKE_key_evaluate_object_ex(), and do_mesh_key().
Definition at line 1441 of file key.cc.
References Nurb::bezt, Nurb::bp, do_rel_cu_key(), ListBase::first, key_evaluate_relative(), KEY_MODE_BEZTRIPLE, KEY_MODE_BPOINT, KEYELEM_ELEM_LEN_BEZTRIPLE, KEYELEM_ELEM_LEN_BPOINT, Nurb::next, Curve::nurb, out, Nurb::pntsu, Nurb::pntsv, and step.
Referenced by do_curve_key(), and do_rel_cu_key().
|
static |
|
static |
Definition at line 1272 of file key.cc.
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, get_weights_array(), i, MEM_calloc_arrayN(), MEM_malloc_arrayN(), WeightsArrayCache::num_defgroup_weights, OB_LATTICE, OB_MESH, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, Mesh::runtime, Object::type, BMesh::vdata, and Mesh::verts_num.
Referenced by BKE_key_evaluate_object_ex(), get_weights_array(), and keyblock_get_per_block_weights().
Definition at line 628 of file key.cc.
References BM_ITER_MESH, BM_VERTS_OF_MESH, BMVert::co, copy_v3_v3(), KeyBlock::data, Key::from, GS, ID_ME, key_block_get_data(), MEM_malloc_arrayN(), ID::name, Mesh::runtime, and KeyBlock::totelem.
Referenced by cp_key(), do_key(), key_block_get_data(), and key_evaluate_relative().
| void key_curve_normal_weights | ( | float | t, |
| float | data[4], | ||
| KeyInterpolationType | type ) |
Second derivative.
Definition at line 424 of file key.cc.
References data, KEY_BSPLINE, KEY_CARDINAL, KEY_CATMULL_ROM, key_curve_normal_weights(), and KEY_LINEAR.
Referenced by key_curve_normal_weights().
| void key_curve_position_weights | ( | float | t, |
| float | data[4], | ||
| KeyInterpolationType | type ) |
Definition at line 341 of file key.cc.
References data, KEY_BSPLINE, KEY_CARDINAL, KEY_CATMULL_ROM, key_curve_position_weights(), and KEY_LINEAR.
Referenced by BKE_colorband_evaluate(), BKE_lattice_deform_data_eval_co(), BKE_where_on_path(), key_curve_position_weights(), blender::bke::subdiv::mesh_interpolate_position_on_edge(), psys_interpolate_particle(), setkeys(), and tilt_bezpart().
| void key_curve_tangent_weights | ( | float | t, |
| float | data[4], | ||
| KeyInterpolationType | type ) |
First derivative.
Definition at line 384 of file key.cc.
References data, KEY_BSPLINE, KEY_CARDINAL, KEY_CATMULL_ROM, key_curve_tangent_weights(), and KEY_LINEAR.
Referenced by BKE_where_on_path(), and key_curve_tangent_weights().
|
static |
Definition at line 875 of file key.cc.
References b, BLI_assert_msg, BLI_findlink(), Key::block, cp_key(), KeyBlock::curval, KeyBlock::data, Key::elemsize, Key::elemstr, ListBase::first, KeyBlock::flag, IPO_BEZTRIPLE, IPO_BPOINT, IPO_FLOAT, key_block_get_data(), key_evaluate_relative(), KEY_MODE_BEZTRIPLE, key_pointer_size(), KEYBLOCK_MUTE, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, KEYELEM_FLOAT_LEN_COORD, MEM_freeN(), KeyBlock::next, Key::refkey, rel_flerp(), KeyBlock::relative, step, and KeyBlock::totelem.
Referenced by do_latt_key(), do_mesh_key(), do_rel_cu_key(), and key_evaluate_relative().
|
static |
Definition at line 663 of file key.cc.
References BLI_assert_msg, Key::from, GS, ID_CU_LEGACY, ID_LT, ID_ME, KEY_MODE_BPOINT, key_pointer_size(), KEYELEM_ELEM_LEN_BEZTRIPLE, KEYELEM_ELEM_LEN_BPOINT, KEYELEM_ELEM_SIZE_CURVE, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, KEYELEM_FLOAT_LEN_COORD, and ID::name.
Referenced by cp_key(), do_key(), key_evaluate_relative(), and key_pointer_size().
|
static |
Definition at line 2152 of file key.cc.
References copy_v3_v3(), ListBase::first, i, keyblock_data_convert_to_curve(), KEYELEM_ELEM_LEN_BEZTRIPLE, KEYELEM_ELEM_LEN_BPOINT, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, Nurb::next, BezTriple::radius, BPoint::radius, BezTriple::tilt, BPoint::tilt, BezTriple::vec, and BPoint::vec.
Referenced by BKE_key_evaluate_object_ex(), BKE_keyblock_convert_to_curve(), and keyblock_data_convert_to_curve().
|
static |
Definition at line 2026 of file key.cc.
References copy_v3_v3(), i, keyblock_data_convert_to_lattice(), and BPoint::vec.
Referenced by BKE_key_evaluate_object_ex(), BKE_keyblock_convert_to_lattice(), and keyblock_data_convert_to_lattice().
|
static |
Definition at line 1365 of file key.cc.
References WeightsArrayCache::defgroup_weights, keyblock_free_per_block_weights(), MEM_freeN(), WeightsArrayCache::num_defgroup_weights, and Key::totkey.
Referenced by do_latt_key(), do_mesh_key(), and keyblock_free_per_block_weights().
|
static |
Definition at line 1348 of file key.cc.
References Key::block, ListBase::first, get_weights_array(), keyblock_get_per_block_weights(), MEM_malloc_arrayN(), KeyBlock::next, Key::totkey, and KeyBlock::vgroup.
Referenced by do_latt_key(), do_mesh_key(), and keyblock_get_per_block_weights().
|
static |
Definition at line 619 of file key.cc.
References in, out, and rel_flerp().
Referenced by cp_key(), key_evaluate_relative(), and rel_flerp().
Definition at line 460 of file key.cc.
References ListBase::first, interp_v4_v4v4(), KEY_BSPLINE, key_curve_position_weights(), ListBase::last, KeyBlock::next, KeyBlock::pos, and setkeys().
Referenced by do_curve_key(), do_latt_key(), do_mesh_key(), and setkeys().
|
static |
Definition at line 197 of file key.cc.
References BLI_assert, ID_TAG_EXTERN, shapekey_blend_read_after_liblink(), ID::tag, and UNUSED_VARS_NDEBUG.
Referenced by shapekey_blend_read_after_liblink().
|
static |
Definition at line 181 of file key.cc.
References BLO_read_data_address, BLO_read_requires_endian_switch(), BLO_read_struct, BLO_read_struct_list, Key::block, LISTBASE_FOREACH, Key::refkey, shapekey_blend_read_data(), and switch_endian_keyblock().
Referenced by shapekey_blend_read_data().
|
static |
Definition at line 125 of file key.cc.
References 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, shapekey_blend_write(), and KeyBlock::totelem.
Referenced by shapekey_blend_write().
|
static |
Definition at line 65 of file key.cc.
References BLI_duplicatelist(), Key::block, KeyBlock::data, ListBase::first, MEM_dupallocN(), KeyBlock::next, Key::refkey, and shapekey_copy_data().
Referenced by shapekey_copy_data().
|
static |
Definition at line 101 of file key.cc.
References BKE_LIB_FOREACHID_PROCESS_ID, BKE_LIB_FOREACHID_PROCESS_ID_NOCHECK, BKE_lib_query_foreachid_process_flags_get(), data, Key::from, IDWALK_CB_LOOPBACK, IDWALK_CB_USER, IDWALK_DO_DEPRECATED_POINTERS, and shapekey_foreach_id().
Referenced by shapekey_foreach_id().
|
static |
Definition at line 90 of file key.cc.
References BLI_pophead(), Key::block, MEM_freeN(), and shapekey_free_data().
Referenced by shapekey_free_data().
Definition at line 113 of file key.cc.
References BKE_key_from_id(), BLI_assert, Key::from, and shapekey_owner_pointer_get().
Referenced by shapekey_owner_pointer_get().
Definition at line 154 of file key.cc.
References b, BLI_endian_switch_float_array(), data, KeyBlock::data, Key::elemsize, Key::elemstr, IPO_BEZTRIPLE, IPO_BPOINT, IPO_FLOAT, switch_endian_keyblock(), and KeyBlock::totelem.
Referenced by shapekey_blend_read_data(), and switch_endian_keyblock().
| IDTypeInfo IDType_ID_KE |