|
Blender V4.3
|
#include "DNA_armature_types.h"#include "DNA_object_types.h"#include "MEM_guardedalloc.h"#include "BLI_blenlib.h"#include "BLI_math_matrix.h"#include "BLI_math_vector.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_bone_collections.hh"#include "armature_intern.hh"#include <cstring>Go to the source code of this file.
Macros | |
| #define | EBONE_TEMP_UINT(ebone) (*((uint *)(&((ebone)->temp)))) |
Referenced by ED_armature_ebone_find_shared_parent().
This function:
Definition at line 582 of file armature_utils.cc.
References armature_finalize_restpose(), 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 291 of file armature_utils.cc.
References armature_select_mirrored_ex(), and BONE_SELECTED.
Referenced by armature_delete_selected_exec().
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 273 of file armature_utils.cc.
References ANIM_bonecoll_is_visible_editbone(), ARM_MIRROR_EDIT, BLI_assert, 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 296 of file armature_utils.cc.
References ANIM_bonecoll_is_visible_editbone(), ARM_MIRROR_EDIT, BONE_DONE, 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 325 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 101 of file armature_utils.cc.
References bArmature::act_edbone, BLI_freelinkN(), BLI_freelistN(), EditBone::bone_collections, bArmature::edbo, IDP_FreeProperty(), LISTBASE_FOREACH, and EditBone::prop.
Referenced by ED_armature_ebone_remove_ex(), ED_armature_from_edit(), 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 69 of file armature_utils.cc.
References bone_looper(), Bone::childbase, count, ListBase::first, and Bone::next.
Referenced by add_verts_to_dgroups(), bone_looper(), ED_object_vgroup_calc_from_armature(), pose_hide_exec(), and pose_reveal_exec().
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 431 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 243 of file armature_utils.cc.
References BLI_findstring(), 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(), and separate_armature_bones().
| 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 155 of file armature_utils.cc.
References EBONE_TEMP_UINT, and EditBone::parent.
Referenced by armature_shortest_path_pick_invoke().
Definition at line 218 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 229 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::usd::import_skeleton().
Definition at line 254 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(), createTransArmatureVerts(), ED_armature_ebone_transform_mirror_update(), get_symmetrized_bone(), postEditBoneDuplicate(), screen_ctx_selected_bones_(), and screen_ctx_visible_or_editable_bones_().
Definition at line 145 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 837 of file armature_utils.cc.
References BLI_addtail(), BLI_assert, BLI_duplicatelist(), BLI_listbase_is_empty(), IDP_CopyProperty_ex(), LIB_ID_CREATE_NO_USER_REFCOUNT, LISTBASE_FOREACH, MEM_dupallocN, and EditBone::prop.
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 818 of file armature_utils.cc.
References BLI_freelistN(), BLI_listbase_clear(), EditBone::bone_collections, ListBase::first, IDP_FreeProperty_ex(), MEM_freeN(), EditBone::next, and EditBone::prop.
Referenced by undoarm_free_data(), and undoarm_to_editarm().
| void ED_armature_ebone_listbase_temp_clear | ( | ListBase * | lb | ) |
Definition at line 867 of file armature_utils.cc.
References LISTBASE_FOREACH.
Referenced by do_armature_box_select(), do_lasso_select_armature(), preEditBoneDuplicate(), undoarm_from_editarm(), and undoarm_to_editarm().
Definition at line 140 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 125 of file armature_utils.cc.
References bone_free(), bArmature::edbo, EditBone::flag, 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 922 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().
Definition at line 916 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().
Definition at line 910 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().
Definition at line 884 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().
Definition at line 893 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 188 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(), createTransArmatureVerts(), ED_armature_ebone_to_mat4(), ED_armature_edit_transform(), ED_armature_join_objects_exec(), and getTransformOrientation_ex().
Definition at line 208 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 336 of file armature_utils.cc.
References BONE_CONNECTED, 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 785 of file armature_utils.cc.
References bArmature::act_edbone, BLI_freelistN(), bArmature::edbo, ListBase::first, IDP_FreeProperty(), LISTBASE_FOREACH, and MEM_freeN().
Referenced by ArmatureExporter::add_armature_bones(), 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::usd::import_skeleton(), ArmatureImporter::make_armatures(), 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 39 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 411 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(), recalcData_edit_armature(), and recalcData_pose().
Put edit-mode back in Object.
Definition at line 647 of file armature_utils.cc.
References bArmature::act_bone, bArmature::act_edbone, ANIM_armature_bonecoll_reconstruct(), Bone::arm_head, Bone::arm_roll, Bone::arm_tail, armature_finalize_restpose(), Bone::bbone_flag, EditBone::bbone_flag, Bone::bbone_mapping_mode, EditBone::bbone_mapping_mode, Bone::bbone_next, EditBone::bbone_next, Bone::bbone_next_flag, EditBone::bbone_next_flag, Bone::bbone_next_type, EditBone::bbone_next_type, Bone::bbone_prev, EditBone::bbone_prev, Bone::bbone_prev_flag, EditBone::bbone_prev_flag, Bone::bbone_prev_type, EditBone::bbone_prev_type, BKE_armature_bone_hash_free(), BKE_armature_bone_hash_make(), BKE_armature_bonelist_free(), BKE_pose_rebuild(), BLI_addtail(), EditBone::bone, EditBone::bone_collections, bone_free(), bArmature::bonebase, Bone::childbase, Bone_Runtime::collections, Bone::color, EditBone::color, copy_v3_v3(), Bone::curve_in_x, EditBone::curve_in_x, Bone::curve_in_z, EditBone::curve_in_z, Bone::curve_out_x, EditBone::curve_out_x, Bone::curve_out_z, EditBone::curve_out_z, Object::data, DEG_id_tag_update(), Bone::dist, EditBone::dist, Bone::ease1, EditBone::ease1, Bone::ease2, EditBone::ease2, bArmature::edbo, ListBase::first, Bone::flag, EditBone::flag, G, G_DEBUG, EditBone::head, bArmature::id, Object::id, IDP_CopyProperty(), Bone::inherit_scale_mode, EditBone::inherit_scale_mode, Bone::layer, EditBone::layer, len_squared_v3v3(), LISTBASE_FOREACH, MEM_callocN, Bone::name, EditBone::name, EditBone::next, ID::next, Main::objects, Bone::parent, EditBone::parent, printf, Bone::prop, EditBone::prop, Bone::rad_head, EditBone::rad_head, Bone::rad_tail, EditBone::rad_tail, Bone::roll, EditBone::roll, Bone::roll1, EditBone::roll1, Bone::roll2, EditBone::roll2, Bone::runtime, Bone::scale_in, EditBone::scale_in, Bone::scale_out, EditBone::scale_out, Bone::segments, EditBone::segments, square_f(), STRNCPY, EditBone::tail, EditBone::temp, Bone::weight, EditBone::weight, Bone::xwidth, EditBone::xwidth, Bone::zwidth, and EditBone::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::usd::import_skeleton(), ArmatureImporter::make_armatures(), 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 805 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 ArmatureExporter::add_armature_bones(), apply_armature_pose2bones_exec(), ED_armature_join_objects_exec(), ED_armature_origin_set(), blender::ed::object::editmode_enter_ex(), blender::io::usd::import_skeleton(), ArmatureImporter::make_armatures(), separate_armature_bones(), and separate_armature_exec().
Definition at line 540 of file armature_utils.cc.
References LISTBASE_FOREACH.
Referenced by make_boneList().
Definition at line 553 of file armature_utils.cc.
References 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 438 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::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, EditBone::tail, EditBone::temp, EditBone::weight, EditBone::xwidth, and EditBone::zwidth.
Referenced by make_boneList(), and make_boneList_recursive().