|
Blender V5.0
|
#include "DNA_armature_types.h"#include "DNA_object_types.h"#include "MEM_guardedalloc.h"#include "BLI_listbase.h"#include "BLI_math_matrix.h"#include "BLI_math_vector.h"#include "BLI_string_utf8.h"#include "BLI_string_utils.hh"#include "BKE_armature.hh"#include "BKE_global.hh"#include "BKE_idprop.hh"#include "BKE_lib_id.hh"#include "BKE_main.hh"#include "DEG_depsgraph.hh"#include "ED_armature.hh"#include "ANIM_armature.hh"#include "ANIM_bone_collections.hh"#include "armature_intern.hh"#include <cstring>Go to the source code of this file.
Macros | |
| #define | EBONE_TEMP_UINT(ebone) |
| #define EBONE_TEMP_UINT | ( | ebone | ) |
Referenced by ED_armature_ebone_find_shared_parent().
This function:
Definition at line 593 of file armature_utils.cc.
References armature_finalize_restpose(), atan2(), atan2f, BKE_armature_where_is_bone(), copy_m3_m4(), copy_v3_v3(), ED_armature_ebone_to_mat3(), invert_m3_m3(), invert_m4_m4(), LISTBASE_FOREACH, mul_m3_m3m3(), mul_mat3_m4_v3(), print_m4(), printf, RAD2DEGF, and sub_v3_v3v3().
Referenced by armature_finalize_restpose(), and ED_armature_from_edit().
| void armature_select_mirrored | ( | bArmature * | arm | ) |
Definition at line 296 of file armature_utils.cc.
References armature_select_mirrored_ex(), and BONE_SELECTED.
Referenced by armature_delete_selected_exec().
| void armature_select_mirrored_ex | ( | bArmature * | arm, |
| int | flag ) |
Helper function for tools to work on mirrored parts. it leaves mirrored bones selected then too, which is a good indication of what happened.
Definition at line 278 of file armature_utils.cc.
References ARM_MIRROR_EDIT, BLI_assert, blender::animrig::bone_is_visible(), BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, ED_armature_ebone_get_mirrored(), bArmature::edbo, bArmature::flag, EditBone::flag, flag, and LISTBASE_FOREACH.
Referenced by armature_dissolve_selected_exec(), and armature_select_mirrored().
| void armature_tag_select_mirrored | ( | bArmature * | arm | ) |
Definition at line 301 of file armature_utils.cc.
References ARM_MIRROR_EDIT, BONE_DONE, blender::animrig::bone_is_visible(), BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, ED_armature_ebone_get_mirrored(), bArmature::edbo, bArmature::flag, EditBone::flag, and LISTBASE_FOREACH.
Referenced by armature_switch_direction_exec().
| void armature_tag_unselect | ( | bArmature * | arm | ) |
Only works when tagged.
Definition at line 330 of file armature_utils.cc.
References BONE_DONE, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, bArmature::edbo, and LISTBASE_FOREACH.
Referenced by armature_switch_direction_exec().
Definition at line 103 of file armature_utils.cc.
References bArmature::act_edbone, BLI_freelinkN(), BLI_freelistN(), EditBone::bone_collections, bArmature::edbo, IDP_FreeProperty(), LISTBASE_FOREACH, EditBone::prop, and EditBone::system_properties.
Referenced by ED_armature_ebone_remove_ex(), and separate_armature_bones().
| int bone_looper | ( | Object * | ob, |
| Bone * | bone, | ||
| void * | data, | ||
| int(* | bone_func )(Object *, Bone *, void *) ) |
XXX: bone_looper is only to be used when we want to access settings (i.e. editability/visibility/selected) that context doesn't offer.
Definition at line 71 of file armature_utils.cc.
References bone_looper(), Bone::childbase, count, data, ListBase::first, and Bone::next.
Referenced by add_verts_to_dgroups(), bone_looper(), and ED_object_vgroup_calc_from_armature().
Copy the bone collection membership info from the bones to the edit-bones.
Operations on edit-bones (like subdividing, extruding, etc.) will have to deal with collection assignments of those edit-bones as well.
Definition at line 438 of file armature_utils.cc.
References BLI_assert, BLI_duplicatelist(), BLI_listbase_is_empty(), EditBone::bone_collections, Bone_Runtime::collections, and Bone::runtime.
Referenced by make_boneList_recursive().
Return a pointer to the bone of the given name
Definition at line 248 of file armature_utils.cc.
References BLI_findstring(), name, and offsetof.
Referenced by apply_armature_pose2bones_exec(), applyarmature_adjust_edit_position(), applyarmature_process_selected_recursive(), armature_delete_ebone_cb(), armature_dissolve_ebone_cb(), armature_duplicate_selected_exec(), armature_symmetrize_exec(), bone_collection_assign_named_mode_specific(), ED_armature_bone_rename(), ED_armature_ebone_get_mirrored(), ED_armature_join_objects_exec(), editbone_unique_check(), blender::ed::object::jump_to_bone(), separate_armature_bones(), and update_duplicate_subtarget().
| EditBone * ED_armature_ebone_find_shared_parent | ( | EditBone * | ebone_child[], |
| unsigned int | ebone_child_tot ) |
Finds the first parent shared by ebone_child
| ebone_child | Children bones to search |
| ebone_child_tot | Size of the ebone_child array |
Definition at line 160 of file armature_utils.cc.
References EBONE_TEMP_UINT, i, and EditBone::parent.
Referenced by armature_shortest_path_pick_invoke().
Definition at line 223 of file armature_utils.cc.
References EditBone::head, len, len_v3v3(), madd_v3_v3v3fl(), mat3_to_vec_roll(), EditBone::roll, and EditBone::tail.
Referenced by ED_armature_ebone_from_mat4().
Definition at line 234 of file armature_utils.cc.
References add_v3_v3(), BLI_ASSERT_UNIT_M3, copy_m3_m4(), copy_v3_v3(), ED_armature_ebone_from_mat3(), EditBone::head, sub_v3_v3(), and EditBone::tail.
Referenced by blender::io::fbx::ArmatureImportContext::create_armature_bones(), and blender::io::usd::import_skeleton().
Definition at line 259 of file armature_utils.cc.
References BLI_string_flip_side_name(), ED_armature_ebone_find_name(), MAXBONENAME, EditBone::name, and STREQ.
Referenced by armature_align_bones_exec(), armature_autoside_names_exec(), armature_calc_roll_exec(), armature_click_extrude_exec(), armature_duplicate_selected_exec(), armature_extrude_exec(), armature_flip_names_exec(), armature_parent_set_exec(), armature_roll_clear_exec(), armature_select_mirror_exec(), armature_select_mirrored_ex(), armature_tag_select_mirrored(), blender::ed::transform::createTransArmatureVerts(), ED_armature_ebone_transform_mirror_update(), get_symmetrized_bone(), post_edit_bone_duplicate(), screen_ctx_selected_bones_(), and screen_ctx_visible_or_editable_bones_().
Definition at line 150 of file armature_utils.cc.
References EditBone::parent.
Referenced by armature_shortest_path_pick_invoke(), blender::ed::outliner::do_outliner_ebone_select_recursive(), and blender::ed::outliner::restrictbutton_recursive_ebone().
| void ED_armature_ebone_listbase_copy | ( | ListBase * | lb_dst, |
| ListBase * | lb_src, | ||
| const bool | do_id_user ) |
Definition at line 897 of file armature_utils.cc.
References BLI_addtail(), BLI_assert, BLI_duplicatelist(), BLI_listbase_is_empty(), EditBone::ebone, IDP_CopyProperty_ex(), LIB_ID_CREATE_NO_USER_REFCOUNT, LISTBASE_FOREACH, MEM_dupallocN(), EditBone::prop, EditBone::system_properties, and EditBone::temp.
Referenced by undoarm_from_editarm(), and undoarm_to_editarm().
| void ED_armature_ebone_listbase_free | ( | ListBase * | lb, |
| bool | do_id_user ) |
Free list of bones and their properties.
Definition at line 875 of file armature_utils.cc.
References BLI_freelistN(), BLI_listbase_clear(), EditBone::bone_collections, ListBase::first, IDP_FreeProperty_ex(), MEM_freeN(), EditBone::next, EditBone::prop, and EditBone::system_properties.
Referenced by undoarm_free_data(), and undoarm_to_editarm().
| void ED_armature_ebone_listbase_temp_clear | ( | ListBase * | lb | ) |
Definition at line 931 of file armature_utils.cc.
References LISTBASE_FOREACH.
Referenced by do_armature_box_select(), do_lasso_select_armature(), pre_edit_bone_duplicate(), undoarm_from_editarm(), and undoarm_to_editarm().
Definition at line 145 of file armature_utils.cc.
References ED_armature_ebone_remove_ex().
Referenced by armature_delete_selected_exec().
| clear_connected | When false caller is responsible for keeping the flag in a valid state. |
Definition at line 130 of file armature_utils.cc.
References BONE_CONNECTED, bone_free(), bArmature::edbo, LISTBASE_FOREACH, and EditBone::parent.
Referenced by armature_dissolve_selected_exec(), and ED_armature_ebone_remove().
| void ED_armature_ebone_select_set | ( | EditBone * | ebone, |
| bool | select ) |
Definition at line 986 of file armature_utils.cc.
References BLI_assert, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, BONE_UNSELECTABLE, ED_armature_ebone_selectflag_set(), EditBone::flag, flag, and select.
Referenced by armature_select_hierarchy_exec(), armature_select_less(), armature_select_linked_impl(), armature_select_more(), armature_select_more_less(), armature_split_exec(), armature_symmetrize_exec(), bone_collection_select(), blender::ed::object::jump_to_bone(), blender::ed::outliner::outliner_select_sync_to_edit_bone(), select_similar_bone_collection(), select_similar_bone_color(), select_similar_children(), select_similar_children_immediate(), select_similar_data_pchan(), select_similar_direction(), select_similar_length(), select_similar_prefix(), select_similar_siblings(), select_similar_suffix(), and blender::ed::outliner::tree_element_active_ebone__sel().
| void ED_armature_ebone_selectflag_disable | ( | EditBone * | ebone, |
| int | flag ) |
Definition at line 980 of file armature_utils.cc.
References BLI_assert, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, ED_armature_ebone_selectflag_set(), EditBone::flag, and flag.
Referenced by armature_select_less().
| void ED_armature_ebone_selectflag_enable | ( | EditBone * | ebone, |
| int | flag ) |
Definition at line 974 of file armature_utils.cc.
References BLI_assert, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, ED_armature_ebone_selectflag_set(), EditBone::flag, and flag.
Referenced by armature_select_more().
| int ED_armature_ebone_selectflag_get | ( | const EditBone * | ebone | ) |
Definition at line 948 of file armature_utils.cc.
References BONE_CONNECTED, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, EditBone::flag, and EditBone::parent.
Referenced by armature_dissolve_selected_exec(), armature_select_mirror_exec(), armature_select_more_less(), and ED_armature_edit_select_pick_bone().
| void ED_armature_ebone_selectflag_set | ( | EditBone * | ebone, |
| int | flag ) |
Definition at line 957 of file armature_utils.cc.
References BONE_CONNECTED, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, EditBone::flag, flag, and EditBone::parent.
Referenced by armature_select_mirror_exec(), armature_shortest_path_select(), ED_armature_ebone_select_set(), ED_armature_ebone_selectflag_disable(), and ED_armature_ebone_selectflag_enable().
Definition at line 193 of file armature_utils.cc.
References EditBone::head, normalize_v3(), EditBone::parent, EditBone::roll, sub_v3_v3v3(), EditBone::tail, and vec_roll_to_mat3_normalized().
Referenced by armature_calc_roll_exec(), armature_finalize_restpose(), blender::ed::transform::createTransArmatureVerts(), ED_armature_ebone_to_mat4(), ED_armature_edit_transform(), ED_armature_join_objects_exec(), and blender::ed::transform::getTransformOrientation_ex().
Definition at line 213 of file armature_utils.cc.
References copy_m4_m3(), copy_v3_v3(), ED_armature_ebone_to_mat3(), and EditBone::head.
Referenced by draw_bone_update_disp_matrix_bbone(), draw_bone_update_disp_matrix_default(), and ebone_spline_preview().
| void ED_armature_ebone_transform_mirror_update | ( | bArmature * | arm, |
| EditBone * | ebo, | ||
| bool | check_select ) |
Definition at line 341 of file armature_utils.cc.
References BONE_CONNECTED, blender::animrig::bone_is_visible(), BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, copy_v3_v3(), EditBone::curve_in_x, EditBone::curve_in_z, EditBone::curve_out_x, EditBone::curve_out_z, EditBone::dist, EditBone::ease1, EditBone::ease2, ED_armature_ebone_get_mirrored(), bArmature::edbo, EditBone::flag, EditBone::head, LISTBASE_FOREACH, EditBone::parent, EditBone::rad_head, EditBone::rad_tail, EditBone::roll, EditBone::roll1, EditBone::roll2, EditBone::scale_in, EditBone::scale_out, EditBone::segments, EditBone::tail, EditBone::weight, EditBone::xwidth, and EditBone::zwidth.
Referenced by ED_armature_edit_transform_mirror_update().
| void ED_armature_edit_free | ( | bArmature * | arm | ) |
Definition at line 839 of file armature_utils.cc.
References bArmature::act_edbone, BLI_freelistN(), bArmature::edbo, ListBase::first, IDP_FreeProperty(), LISTBASE_FOREACH, and MEM_freeN().
Referenced by apply_armature_pose2bones_exec(), ED_armature_join_objects_exec(), ED_armature_origin_set(), ED_armature_to_edit(), blender::ed::object::editmode_load_free_ex(), blender::io::fbx::ArmatureImportContext::find_armatures(), blender::io::usd::import_skeleton(), blender::ed::object::modifier_skin_armature_create(), separate_armature_bones(), and separate_armature_exec().
| void ED_armature_edit_sync_selection | ( | ListBase * | edbo | ) |
Sync selection to parent for connected children.
Definition at line 41 of file armature_utils.cc.
References BONE_CONNECTED, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, BONE_UNSELECTABLE, and LISTBASE_FOREACH.
Referenced by armature_circle_select(), armature_click_extrude_exec(), armature_delete_selected_exec(), armature_dissolve_selected_exec(), armature_duplicate_selected_exec(), armature_extrude_exec(), armature_hide_exec(), armature_parent_clear_exec(), armature_reveal_exec(), armature_select_hierarchy_exec(), armature_select_linked_impl(), armature_select_mirror_exec(), armature_select_more_less(), armature_shortest_path_pick_invoke(), armature_symmetrize_exec(), bone_collection_assign_editbones(), bone_collection_assign_named_mode_specific(), ED_armature_edit_deselect_all_visible(), ED_armature_edit_select_op_from_tagged(), ED_armature_edit_select_pick_bone(), and blender::ed::object::jump_to_bone().
| void ED_armature_edit_transform_mirror_update | ( | Object * | obedit | ) |
If edit-bone (partial) selected, copy data. context; edit-mode armature, with mirror editing enabled.
Definition at line 418 of file armature_utils.cc.
References Object::data, ED_armature_ebone_transform_mirror_update(), bArmature::edbo, and LISTBASE_FOREACH.
Referenced by armature_symmetrize_exec(), ED_transverts_update_obedit(), blender::ed::transform::recalcData_edit_armature(), and blender::ed::transform::recalcData_pose().
Put edit-mode back in Object.
Definition at line 658 of file armature_utils.cc.
References bArmature::act_bone, bArmature::act_edbone, add_v3_v3v3(), ANIM_armature_bonecoll_reconstruct(), Bone::arm_head, Bone::arm_roll, Bone::arm_tail, armature_finalize_restpose(), Bone::bbone_flag, Bone::bbone_mapping_mode, Bone::bbone_next, Bone::bbone_next_flag, Bone::bbone_next_type, Bone::bbone_prev, Bone::bbone_prev_flag, Bone::bbone_prev_type, BKE_armature_bone_hash_free(), BKE_armature_bone_hash_make(), BKE_armature_bonelist_free(), BKE_pose_rebuild(), BLI_addtail(), BONE_CONNECTED, bArmature::bonebase, Bone::childbase, Bone_Runtime::collections, Bone::color, copy_v3_v3(), Bone::curve_in_x, Bone::curve_in_z, Bone::curve_out_x, Bone::curve_out_z, Object::data, DEG_id_tag_update(), Bone::dist, Bone::drawtype, Bone::ease1, Bone::ease2, bArmature::edbo, ListBase::first, Bone::flag, G, G_DEBUG, bArmature::id, Object::id, IDP_CopyProperty(), Bone::inherit_scale_mode, Bone::layer, len_squared_v3v3(), LISTBASE_FOREACH, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_default(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), MEM_callocN(), MEM_dupallocN(), Bone::name, ID::next, normalize_v3_length(), Main::objects, Bone::parent, printf, Bone::prop, Bone::rad_head, Bone::rad_tail, Bone::roll, Bone::roll1, Bone::roll2, Bone::runtime, Bone::scale_in, Bone::scale_out, Bone::segments, STRNCPY_UTF8, sub_v3_v3v3(), Bone::system_properties, Bone::weight, Bone::xwidth, and Bone::zwidth.
Referenced by apply_armature_pose2bones_exec(), ED_armature_join_objects_exec(), ED_armature_origin_set(), blender::ed::object::editmode_load_free_ex(), blender::io::fbx::ArmatureImportContext::find_armatures(), blender::io::usd::import_skeleton(), blender::ed::object::modifier_skin_armature_create(), separate_armature_bones(), and separate_armature_exec().
| void ED_armature_to_edit | ( | bArmature * | arm | ) |
Put armature in edit-mode.
Definition at line 862 of file armature_utils.cc.
References bArmature::act_bone, bArmature::act_edbone, bArmature::bonebase, ED_armature_edit_free(), bArmature::edbo, make_boneList(), and MEM_callocN().
Referenced by apply_armature_pose2bones_exec(), ED_armature_join_objects_exec(), ED_armature_origin_set(), blender::ed::object::editmode_enter_ex(), blender::io::fbx::ArmatureImportContext::find_armatures(), blender::io::usd::import_skeleton(), separate_armature_bones(), and separate_armature_exec().
Definition at line 551 of file armature_utils.cc.
References LISTBASE_FOREACH.
Referenced by make_boneList().
Definition at line 564 of file armature_utils.cc.
References active, Bone::bbone_next, Bone::bbone_prev, BLI_assert, find_ebone_link(), ListBase::first, ListBase::last, LISTBASE_FOREACH, and make_boneList_recursive().
Referenced by ED_armature_to_edit().
|
static |
Definition at line 445 of file armature_utils.cc.
References EditBone::bbone_flag, EditBone::bbone_mapping_mode, EditBone::bbone_next_flag, EditBone::bbone_next_type, EditBone::bbone_prev_flag, EditBone::bbone_prev_type, BLI_addtail(), EditBone::bone, BONE_CONNECTED, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, EditBone::color, copy_bonecollection_membership(), copy_v3_v3(), EditBone::curve_in_x, EditBone::curve_in_z, EditBone::curve_out_x, EditBone::curve_out_z, EditBone::dist, EditBone::drawtype, EditBone::ease1, EditBone::ease2, EditBone::flag, EditBone::head, IDP_CopyProperty(), EditBone::inherit_scale_mode, EditBone::layer, EditBone::length, LISTBASE_FOREACH, make_boneList_recursive(), MEM_callocN(), EditBone::name, EditBone::parent, EditBone::prop, EditBone::rad_head, EditBone::rad_tail, EditBone::roll, EditBone::roll1, EditBone::roll2, EditBone::scale_in, EditBone::scale_out, EditBone::segments, STRNCPY_UTF8, EditBone::system_properties, EditBone::tail, EditBone::temp, EditBone::weight, EditBone::xwidth, and EditBone::zwidth.
Referenced by make_boneList(), and make_boneList_recursive().