|
Blender V4.3
|
Go to the source code of this file.
Definition at line 256 of file key.cc.
References BKE_id_new(), Key::elemsize, Key::elemstr, Key::from, GS, ID_CU_LEGACY, ID_KE, ID_LT, ID_ME, IPO_BPOINT, IPO_FLOAT, KEY_NORMAL, KEYELEM_ELEM_SIZE_CURVE, KEYELEM_FLOAT_LEN_COORD, Key::type, and Key::uidgen.
Referenced by ED_mesh_join_objects_exec(), ED_mesh_shapes_join_objects_exec(), blender::io::usd::import_blendshapes(), insert_curvekey(), insert_lattkey(), insert_meshkey(), ArmatureImporter::make_shape_keys(), and blender::ed::object::modifier_apply_shape().
Definition at line 1645 of file key.cc.
References BKE_key_evaluate_object_ex().
Referenced by BKE_curve_calc_modifiers_pre(), 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 1522 of file key.cc.
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(), 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, lattice, MEM_callocN, MEM_freeN(), min_ii(), ID::name, Curve::nurb, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_SHAPE_LOCK, OB_SURF, OB_TYPE_SUPPORT_VGROUP, 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(), deform_verts(), and blender::ed::object::shape_key_remove_exec().
| void BKE_key_free_data | ( | Key * | key | ) |
Free (or release) any data used by this shape-key (does not free the key itself).
Definition at line 241 of file key.cc.
References Key::id, and shapekey_free_data().
Referenced by undomesh_free_data().
| void BKE_key_free_nolib | ( | Key * | key | ) |
Definition at line 246 of file key.cc.
References BLI_pophead(), Key::block, and MEM_freeN().
Definition at line 1800 of file key.cc.
References BKE_key_from_id_p().
Referenced by BKE_blendfile_library_relocate(), BKE_id_copy_for_duplicate(), 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_main_operations_create(), 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(), 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 1775 of file key.cc.
References GS, ID_CU_LEGACY, ID_LT, ID_ME, Curve::key, Lattice::key, Mesh::key, and Curve::vfont.
Referenced by BKE_blendfile_library_relocate(), BKE_id_copy_for_use_in_bmain(), BKE_key_from_id(), BKE_key_from_object_p(), BKE_lib_override_library_update(), and lib_override_library_resync().
Definition at line 1820 of file key.cc.
References 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_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::ed::object::ED_object_shape_key_add(), blender::bke::get_orco_coords(), object_deforms_in_time(), blender::ed::object::object_is_any_shape_key_locked(), 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_lock_exec(), blender::ed::object::shape_key_move_exec(), blender::ed::object::shape_key_move_poll(), blender::ed::object::shape_key_retime_exec(), and special_aftertrans_update__actedit().
Definition at line 1811 of file key.cc.
References BKE_key_from_id_p(), and Object::data.
Referenced by BKE_key_from_object(), and BKE_object_shapekey_free().
| bool BKE_key_idtype_support | ( | short | id_type | ) |
Definition at line 1763 of file key.cc.
References ID_CU_LEGACY, ID_LT, and ID_ME.
Referenced by 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 308 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 ED_mesh_join_objects_exec().
Definition at line 1831 of file key.cc.
References BLI_addtail(), BLI_listbase_count(), BLI_uniquename(), Key::block, DATA_, KEY_LINEAR, ListBase::last, 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_ctime(), bm_to_mesh_shape(), ED_mesh_join_objects_exec(), ED_mesh_shapes_join_objects_exec(), 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 1878 of file key.cc.
References BKE_key_sort(), BKE_keyblock_add(), Key::block, compare_ff(), Key::ctime, KEY_RELATIVE, LISTBASE_FOREACH, KeyBlock::pos, and Key::type.
Referenced by insert_curvekey(), insert_lattkey(), insert_meshkey(), and ArmatureImporter::make_shape_keys().
Definition at line 2117 of file key.cc.
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.
Referenced by insert_curvekey().
Definition at line 1992 of file key.cc.
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.
Referenced by insert_lattkey().
Definition at line 2186 of file key.cc.
References BKE_keyblock_update_from_mesh(), KeyBlock::data, Key::elemsize, len, MEM_malloc_arrayN, MEM_SAFE_FREE, and KeyBlock::totelem.
Referenced by ED_mesh_shapes_join_objects_exec(), blender::io::usd::import_blendshapes(), insert_meshkey(), ArmatureImporter::make_shape_keys(), blender::bke::mesh_eval_to_meshkey(), and blender::ed::object::modifier_apply_shape().
| void BKE_keyblock_convert_from_vertcos | ( | const Object * | ob, |
| KeyBlock * | kb, | ||
| const float(*) | vertCos[3] ) |
Definition at line 2356 of file key.cc.
References BKE_keyblock_curve_element_count(), BKE_keyblock_update_from_vertcos(), KeyBlock::data, Object::data, ELEM, Key::elemsize, Curve::key, Lattice::key, MEM_mallocN, MEM_SAFE_FREE, Curve::nurb, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_SURF, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, and Object::type.
Definition at line 2163 of file key.cc.
References BKE_keyblock_curve_element_count(), KeyBlock::data, keyblock_data_convert_to_curve(), min_ii(), and KeyBlock::totelem.
Referenced by BKE_object_shapekey_remove(), and ED_curve_editnurb_make().
Definition at line 2018 of file key.cc.
References KeyBlock::data, Lattice::def, float, keyblock_data_convert_to_lattice(), min_ii(), Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, and KeyBlock::totelem.
Referenced by BKE_editlattice_make(), and BKE_object_shapekey_remove().
Definition at line 2202 of file key.cc.
References KeyBlock::data, min_ii(), and KeyBlock::totelem.
Referenced by 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()().
Definition at line 2389 of file key.cc.
References BKE_nurbList_verts_count(), copy_v3_v3(), KeyBlock::data, Object::data, ELEM, float, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, LISTBASE_FOREACH, MEM_mallocN, Curve::nurb, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_SURF, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, and Object::type.
Referenced by blender::ed::sculpt_paint::undo::restore_position_mesh(), and blender::ed::sculpt_paint::undo::update_shapekeys().
copy shape-key attributes, but not key data or name/UID.
Definition at line 1947 of file key.cc.
References KeyBlock::curval, KeyBlock::pos, KeyBlock::relative, KeyBlock::slidermax, KeyBlock::slidermin, STRNCPY, KeyBlock::type, and KeyBlock::vgroup.
Referenced by 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 1958 of file key.cc.
References ELEM, Key::id, ptr, RNA_path_from_ID_to_property(), RNA_pointer_create(), and RNA_struct_find_property().
Referenced by achannel_setting_slider_shapekey_cb(), ANIM_channel_draw_widgets(), and make_new_animlistelem().
| void BKE_keyblock_curve_data_set_with_mat4 | ( | Key * | key, |
| const 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.
Definition at line 1733 of file key.cc.
References BKE_keyblock_curve_data_transform(), Key::block, data, ELEM, Key::elemsize, ListBase::first, and KeyBlock::next.
Referenced by blender::ed::object::data_xform_by_mat4().
| void BKE_keyblock_curve_data_transform | ( | const ListBase * | nurb, |
| const float | mat[4][4], | ||
| const void * | src, | ||
| void * | dst ) |
Definition at line 2086 of file key.cc.
References KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, LISTBASE_FOREACH, and mul_v3_m4v3().
Referenced by BKE_keyblock_curve_data_set_with_mat4().
Definition at line 2029 of file key.cc.
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_curve_calc_modifiers_pre(), 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(), BKE_keyblock_update_from_vertcos(), calc_shapeKeys(), and do_versions_after_linking_280().
Definition at line 1701 of file key.cc.
References BKE_keyblock_data_get_from_shape().
| shape_index | The index to use or all (when -1). |
Definition at line 1686 of file key.cc.
References Key::block, ELEM, Key::elemsize, ListBase::first, and KeyBlock::next.
Referenced by BKE_keyblock_data_get(), and blender::ed::object::data_xform_create_ex().
Set the data for all key-blocks (or shape_index if != -1).
Definition at line 1748 of file key.cc.
References Key::block, data, ELEM, Key::elemsize, ListBase::first, and KeyBlock::next.
Referenced by blender::ed::object::data_xform_restore().
| void BKE_keyblock_data_set_with_mat4 | ( | 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 1706 of file key.cc.
References BLI_assert_msg, Key::block, ELEM, Key::elemsize, ListBase::first, float, and mul_v3_m4v3().
Referenced by blender::ed::object::data_xform_by_mat4().
| size_t BKE_keyblock_element_calc_size | ( | const Key * | key | ) |
Definition at line 1674 of file key.cc.
References BKE_keyblock_element_calc_size_from_shape().
| shape_index | The index to use or all (when -1). |
Definition at line 1669 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().
Definition at line 1664 of file key.cc.
References BKE_keyblock_element_count_from_shape().
| shape_index | The index to use or all (when -1). |
Definition at line 1650 of file key.cc.
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 an index (0 refers to the basis key). Key may be null.
Definition at line 1923 of file key.cc.
References BLI_findlink(), and Key::block.
Referenced by 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::bke::get_orco_coords(), blender::ed::sculpt_paint::PositionDeformData::PositionDeformData(), and shapekey_adrcodes_to_paths().
Get the appropriate KeyBlock given a name to search for.
Definition at line 1932 of file key.cc.
References BLI_findstring(), Key::block, and offsetof.
Referenced by ED_mesh_join_objects_exec(), edbm_blend_from_shape_exec(), join_mesh_single(), and blender::ed::sculpt_paint::undo::restore_active_shape_key().
Definition at line 1937 of file key.cc.
References Key::block, and LISTBASE_FOREACH.
Referenced by keyblock_ensure_from_uid().
Only the active key-block.
Definition at line 1905 of file key.cc.
References BKE_key_from_object(), BKE_keyblock_find_by_index(), and Object::shapenr.
Referenced by BKE_editlattice_make(), BKE_key_evaluate_object_ex(), 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::push_begin_ex(), blender::ed::sculpt_paint::undo::restore_position_from_undo_step(), sculpt_update_object(), 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 1912 of file key.cc.
References BKE_key_from_object(), and Key::refkey.
| 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 2578 of file key.cc.
References BLI_listbase_count(), Key::block, count, KEY_RELATIVE, LISTBASE_FOREACH_INDEX, KeyBlock::relative, and Key::type.
Referenced by bm_to_mesh_shape(), calc_shapeKeys(), blender::ed::sculpt_paint::PositionDeformData::PositionDeformData(), blender::ed::sculpt_paint::update_shape_keys(), and blender::ed::sculpt_paint::undo::update_shapekeys().
Check if given key-block (as index) is used as basis by others in given key.
Definition at line 2562 of file key.cc.
References Key::block, ListBase::first, KEY_RELATIVE, KeyBlock::next, and Key::type.
| 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 2210 of file key.cc.
References BKE_keyblock_convert_to_mesh(), CD_CUSTOMLOOPNORMAL, CustomData_get_layer(), float, MEM_freeN(), and MEM_malloc_arrayN.
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 2481 of file key.cc.
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, Key::totkey, and true.
Referenced by blender::ed::object::shape_key_move_exec().
Definition at line 2048 of file key.cc.
References BKE_keyblock_curve_element_count(), BLI_assert, copy_v3_v3(), KeyBlock::data, 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().
Definition at line 1972 of file key.cc.
References 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 2173 of file key.cc.
References BLI_assert, KeyBlock::data, and KeyBlock::totelem.
Referenced by BKE_keyblock_convert_from_mesh().
RAW coordinates offsets.
Definition at line 2447 of file key.cc.
References add_v3_v3(), KeyBlock::data, Object::data, ELEM, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, LISTBASE_FOREACH, Curve::nurb, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_SURF, KeyBlock::totelem, and Object::type.
Referenced by blender::ed::sculpt_paint::undo::update_shapekeys().
| void BKE_keyblock_update_from_vertcos | ( | const Object * | ob, |
| KeyBlock * | kb, | ||
| const float(*) | vertCos[3] ) |
Definition at line 2297 of file key.cc.
References BKE_keyblock_curve_element_count(), BLI_assert, copy_v3_v3(), KeyBlock::data, Object::data, ELEM, float, KEYELEM_FLOAT_LEN_BEZTRIPLE, KEYELEM_FLOAT_LEN_BPOINT, LISTBASE_FOREACH, Curve::nurb, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_SURF, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, KeyBlock::totelem, and Object::type.
Referenced by BKE_keyblock_convert_from_vertcos(), and blender::ed::sculpt_paint::undo::update_shapekeys().
Second derivative.
Definition at line 418 of file key.cc.
References KEY_BSPLINE, KEY_CARDINAL, KEY_CATMULL_ROM, and KEY_LINEAR.
Definition at line 339 of file key.cc.
References KEY_BSPLINE, KEY_CARDINAL, KEY_CATMULL_ROM, and KEY_LINEAR.
Referenced by BKE_colorband_evaluate(), BKE_lattice_deform_data_eval_co(), BKE_where_on_path(), blender::bke::subdiv::mesh_interpolate_position_on_edge(), psys_interpolate_particle(), setkeys(), and tilt_bezpart().
First derivative.
Definition at line 380 of file key.cc.
References KEY_BSPLINE, KEY_CARDINAL, KEY_CATMULL_ROM, and KEY_LINEAR.
Referenced by BKE_where_on_path().