|
Blender V4.3
|
#include "DNA_armature_types.h"#include "DNA_constraint_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "MEM_guardedalloc.h"#include "BLT_translation.hh"#include "BLI_blenlib.h"#include "BLI_ghash.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BKE_action.hh"#include "BKE_armature.hh"#include "BKE_constraint.h"#include "BKE_context.hh"#include "BKE_global.hh"#include "BKE_layer.hh"#include "BKE_main.hh"#include "BKE_object.hh"#include "BKE_object_types.hh"#include "BKE_report.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "RNA_prototypes.hh"#include "UI_interface_icons.hh"#include "WM_api.hh"#include "WM_types.hh"#include "ED_armature.hh"#include "ED_object.hh"#include "ED_outliner.hh"#include "ED_screen.hh"#include "ED_view3d.hh"#include "ANIM_bone_collections.hh"#include "DEG_depsgraph.hh"#include "armature_intern.hh"Go to the source code of this file.
Classes | |
| struct | EditBonePoint |
Bone Roll Calculate Operator | |
| enum | eCalcRollTypes { CALC_ROLL_POS_X = 0 , CALC_ROLL_POS_Y , CALC_ROLL_POS_Z , CALC_ROLL_TAN_POS_X , CALC_ROLL_TAN_POS_Z , CALC_ROLL_NEG_X , CALC_ROLL_NEG_Y , CALC_ROLL_NEG_Z , CALC_ROLL_TAN_NEG_X , CALC_ROLL_TAN_NEG_Z , CALC_ROLL_ACTIVE , CALC_ROLL_VIEW , CALC_ROLL_CURSOR } |
| static const EnumPropertyItem | prop_calc_roll_types [] |
| float | ED_armature_ebone_roll_to_vector (const EditBone *bone, const float align_axis[3], const bool axis_only) |
| static int | armature_calc_roll_exec (bContext *C, wmOperator *op) |
| void | ARMATURE_OT_calculate_roll (wmOperatorType *ot) |
| static int | armature_roll_clear_exec (bContext *C, wmOperator *op) |
| void | ARMATURE_OT_roll_clear (wmOperatorType *ot) |
Armature EditMode tools - transforms, chain based editing, and other settings.
Definition in file armature_edit.cc.
| enum eCalcRollTypes |
Definition at line 234 of file armature_edit.cc.
|
static |
Definition at line 1073 of file armature_edit.cc.
References ARM_MIRROR_EDIT, BKE_report(), BKE_reportf(), bone_align_to_bone(), BONE_SELECTED, CTX_data_active_bone(), CTX_DATA_BEGIN, CTX_DATA_COUNT, CTX_data_edit_object(), CTX_DATA_END, Object::data, DEG_id_tag_update(), ED_armature_ebone_get_mirrored(), bArmature::edbo, ELEM, bArmature::flag, bArmature::id, ID_RECALC_SELECT, EditBone::name, NC_OBJECT, ND_BONE_SELECT, OPERATOR_CANCELLED, OPERATOR_FINISHED, EditBone::parent, wmOperator::reports, RPT_ERROR, RPT_INFO, and WM_event_add_notifier().
Referenced by ARMATURE_OT_align().
|
static |
Definition at line 281 of file armature_edit.cc.
References bArmature::act_edbone, add_v3_v3v3(), ARM_MIRROR_EDIT, BKE_report(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BLI_assert_unreachable, CALC_ROLL_ACTIVE, CALC_ROLL_CURSOR, CALC_ROLL_NEG_X, CALC_ROLL_TAN_NEG_X, CALC_ROLL_TAN_NEG_Z, CALC_ROLL_TAN_POS_X, CALC_ROLL_TAN_POS_Z, CALC_ROLL_VIEW, copy_m3_m4(), copy_v3_v3(), cross_v3_v3v3(), CTX_data_edit_object(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_region_view3d(), CTX_wm_view3d(), Object::data, DEG_id_tag_update(), EBONE_EDITABLE, EBONE_VISIBLE, ED_armature_ebone_get_mirrored(), ED_armature_ebone_roll_to_vector(), ED_armature_ebone_to_mat3(), bArmature::edbo, ELEM, bArmature::flag, EditBone::head, bArmature::id, ID_RECALC_SELECT, invert_m3(), invert_m4_m4(), LISTBASE_FOREACH, mul_m3_v3(), mul_m4_v3(), NC_OBJECT, ND_BONE_SELECT, negate_v3(), normalize_v3(), OPERATOR_CANCELLED, OPERATOR_FINISHED, EditBone::parent, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RNA_enum_get(), EditBone::roll, RPT_ERROR, sub_v3_v3v3(), EditBone::tail, RegionView3D::viewinv, and WM_event_add_notifier().
Referenced by ARMATURE_OT_calculate_roll().
|
static |
Definition at line 897 of file armature_edit.cc.
References bArmature::edbo, and LISTBASE_FOREACH.
Referenced by armature_switch_direction_exec().
|
static |
Definition at line 1221 of file armature_edit.cc.
References ANIM_bonecoll_is_visible_editbone(), BONE_SELECTED, ED_armature_ebone_find_name(), bArmature::edbo, and EditBone::flag.
Referenced by armature_delete_selected_exec().
|
static |
Definition at line 1232 of file armature_edit.cc.
References bArmature::act_edbone, ANIM_bonecoll_is_visible_editbone(), armature_delete_ebone_cb(), armature_select_mirrored(), BKE_pose_channels_remove(), BKE_pose_tag_recalc(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BONE_SELECTED, CTX_DATA_COUNT, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), ED_armature_ebone_remove(), ED_armature_edit_sync_selection(), ED_outliner_select_sync_from_edit_bone_tag(), bArmature::edbo, ListBase::first, EditBone::flag, bArmature::id, ID_RECALC_SELECT, NC_OBJECT, ND_BONE_SELECT, EditBone::next, OPERATOR_CANCELLED, OPERATOR_FINISHED, and WM_event_add_notifier().
Referenced by armature_delete_selected_invoke(), and ARMATURE_OT_delete().
|
static |
Definition at line 1285 of file armature_edit.cc.
References ALERT_ICON_NONE, armature_delete_selected_exec(), IFACE_, wmOperator::ptr, RNA_boolean_get(), and WM_operator_confirm_ex().
Referenced by ARMATURE_OT_delete().
|
static |
Definition at line 1316 of file armature_edit.cc.
References BONE_DONE, ED_armature_ebone_find_name(), bArmature::edbo, and EditBone::flag.
Referenced by armature_dissolve_selected_exec().
|
static |
Definition at line 1325 of file armature_edit.cc.
References ANIM_bonecoll_is_visible_editbone(), ARM_MIRROR_EDIT, armature_dissolve_ebone_cb(), armature_select_mirrored_ex(), BKE_pose_channels_remove(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_lookup_p(), BLI_ghash_ptr_new_ex(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue_p(), BONE_CONNECTED, BONE_DONE, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, copy_v3_v3(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), EditBone::ebone, ED_armature_ebone_remove_ex(), ED_armature_ebone_selectflag_get(), ED_armature_edit_sync_selection(), ED_outliner_select_sync_from_edit_bone_tag(), bArmature::edbo, ListBase::first, bArmature::flag, EditBone::flag, flag, GHASH_ITER, bArmature::id, ID_RECALC_SELECT, LISTBASE_FOREACH, NC_OBJECT, ND_BONE_SELECT, EditBone::next, OPERATOR_CANCELLED, OPERATOR_FINISHED, EditBone::p, EditBone::parent, EditBone::rad_head, EditBone::rad_tail, SET_FLAG_FROM_TEST, EditBone::tail, EditBone::temp, and WM_event_add_notifier().
Referenced by ARMATURE_OT_dissolve().
|
static |
Definition at line 684 of file armature_edit.cc.
References bArmature::act_edbone, add_points_bone(), BKE_report(), BKE_reportf(), BLI_assert, BLI_freelistN(), BLI_listbase_count(), BONE_CONNECTED, BONE_ROOTSEL, BONE_TIPSEL, copy_v3_v3(), count, CTX_DATA_BEGIN_WITH_ID, CTX_DATA_END, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), ED_armature_edit_deselect_all(), ELEM, fill_add_joint(), EditBone::flag, FOREACH_OBJECT_IN_EDIT_MODE_BEGIN, FOREACH_OBJECT_IN_MODE_END, EditBonePoint::head_owner, bArmature::id, ID_RECALC_SYNC_TO_EVAL, invert_m4_m4(), len_squared_v3v3(), mul_v3_m4v3(), NC_OBJECT, ND_POSE, EditBonePoint::next, OPERATOR_CANCELLED, OPERATOR_FINISHED, EditBone::parent, wmOperator::reports, RPT_ERROR, Object::runtime, EditBonePoint::tail_owner, EditBonePoint::vec, and WM_event_add_notifier().
Referenced by ARMATURE_OT_fill().
|
static |
Definition at line 1496 of file armature_edit.cc.
References BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BONE_HIDDEN_A, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, CTX_DATA_COUNT, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), EBONE_VISIBLE, ED_armature_edit_sync_selection(), bArmature::edbo, bArmature::flag, bArmature::id, ID_RECALC_SELECT, invert(), LISTBASE_FOREACH, NC_OBJECT, ND_BONE_SELECT, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), and WM_event_add_notifier().
Referenced by ARMATURE_OT_hide().
| void ARMATURE_OT_align | ( | wmOperatorType * | ot | ) |
Definition at line 1152 of file armature_edit.cc.
References armature_align_bones_exec(), wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_calculate_roll | ( | wmOperatorType * | ot | ) |
Definition at line 462 of file armature_edit.cc.
References armature_calc_roll_exec(), CALC_ROLL_TAN_POS_X, wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, prop_calc_roll_types, RNA_def_boolean(), RNA_def_enum(), wmOperatorType::srna, and WM_menu_invoke().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_delete | ( | wmOperatorType * | ot | ) |
Definition at line 1299 of file armature_edit.cc.
References armature_delete_selected_exec(), armature_delete_selected_invoke(), wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and WM_operator_properties_confirm_or_exec().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_dissolve | ( | wmOperatorType * | ot | ) |
Definition at line 1475 of file armature_edit.cc.
References armature_dissolve_selected_exec(), wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_fill | ( | wmOperatorType * | ot | ) |
Definition at line 871 of file armature_edit.cc.
References armature_fill_bones_exec(), wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_hide | ( | wmOperatorType * | ot | ) |
Definition at line 1534 of file armature_edit.cc.
References armature_hide_exec(), wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_reveal | ( | wmOperatorType * | ot | ) |
Definition at line 1592 of file armature_edit.cc.
References armature_reveal_exec(), wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_roll_clear | ( | wmOperatorType * | ot | ) |
Definition at line 529 of file armature_edit.cc.
References armature_roll_clear_exec(), DEG2RADF, wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_float_rotation(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_split | ( | wmOperatorType * | ot | ) |
Definition at line 1200 of file armature_edit.cc.
References armature_split_exec(), wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_switch_direction | ( | wmOperatorType * | ot | ) |
Definition at line 1004 of file armature_edit.cc.
References armature_switch_direction_exec(), wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_armature().
|
static |
Definition at line 1559 of file armature_edit.cc.
References ANIM_bonecoll_is_visible_editbone(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BONE_HIDDEN_A, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, BONE_UNSELECTABLE, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), ED_armature_edit_sync_selection(), bArmature::edbo, bArmature::id, ID_RECALC_SELECT, LISTBASE_FOREACH, NC_OBJECT, ND_BONE_SELECT, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), select(), SET_FLAG_FROM_TEST, and WM_event_add_notifier().
Referenced by ARMATURE_OT_reveal().
|
static |
Definition at line 487 of file armature_edit.cc.
References ARM_MIRROR_EDIT, BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), EBONE_EDITABLE, EBONE_VISIBLE, ED_armature_ebone_get_mirrored(), bArmature::edbo, bArmature::flag, bArmature::id, ID_RECALC_SELECT, LISTBASE_FOREACH, NC_OBJECT, ND_BONE_SELECT, OPERATOR_FINISHED, wmOperator::ptr, RNA_float_get(), EditBone::roll, and WM_event_add_notifier().
Referenced by ARMATURE_OT_roll_clear().
|
static |
Definition at line 1173 of file armature_edit.cc.
References BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BONE_SELECTED, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), ED_armature_ebone_select_set(), bArmature::edbo, bArmature::flag, bArmature::id, ID_RECALC_SELECT, LISTBASE_FOREACH, NC_OBJECT, ND_BONE_SELECT, OPERATOR_FINISHED, and WM_event_add_notifier().
Referenced by ARMATURE_OT_split().
|
static |
Definition at line 904 of file armature_edit.cc.
References armature_clear_swap_done_flags(), armature_tag_select_mirrored(), armature_tag_unselect(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BLI_freelistN(), BLI_listbase_is_empty(), BONE_CONNECTED, BONE_TRANSFORM, chains_find_tips(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), EBONE_EDITABLE, EBONE_VISIBLE, bArmature::edbo, equals_v3v3(), EditBone::flag, EditBone::head, bArmature::id, ID_RECALC_SELECT, LISTBASE_FOREACH, NC_OBJECT, ND_BONE_SELECT, OPERATOR_FINISHED, EditBone::parent, swap_v3_v3(), EditBone::tail, and WM_event_add_notifier().
Referenced by ARMATURE_OT_switch_direction().
Definition at line 1053 of file armature_edit.cc.
References add_v3_v3v3(), fix_editbone_connected_children(), EditBone::head, len_v3(), length(), mul_v3_fl(), normalize_v3(), EditBone::roll, sub_v3_v3v3(), and EditBone::tail.
Referenced by armature_align_bones_exec().
Definition at line 572 of file armature_edit.cc.
References BLI_addtail(), LinkData::data, LISTBASE_FOREACH, MEM_callocN, and EditBone::parent.
Referenced by armature_switch_direction_exec().
Get current armature from the context, including properties editor pinning.
Definition at line 63 of file armature_edit.cc.
References blender::ed::object::context_active_object(), CTX_data_pointer_get_type(), PointerRNA::data, and OB_ARMATURE.
Referenced by active_bone_collection_poll(), bone_collection_add_exec(), bone_collection_add_poll(), bone_collection_move_exec(), bone_collection_remove_exec(), and uiTemplateBoneCollectionTree().
| float ED_armature_ebone_roll_to_vector | ( | const EditBone * | bone, |
| const float | align_axis[3], | ||
| bool | axis_only ) |
Adjust bone roll to align Z axis with vector align_axis is in local space and is normalized.
Definition at line 193 of file armature_edit.cc.
References angle_v3v3(), BLI_ASSERT_UNIT_V3, cross_v3_v3v3(), dot_v3v3(), fabsf, EditBone::head, M_PI_2, negate_v3(), nor, normalize_v3(), project_v3_v3v3_normalized(), sub_v3_v3v3(), EditBone::tail, and vec_roll_to_mat3_normalized().
Referenced by armature_calc_roll_exec(), and recalcData_edit_armature().
See BKE_armature_transform for object-mode transform.
Definition at line 80 of file armature_edit.cc.
References copy_m3_m4(), ED_armature_ebone_to_mat3(), bArmature::edbo, LISTBASE_FOREACH, mat3_to_vec_roll(), mat4_to_scale(), mul_m3_m3m3(), mul_m4_v3(), and normalize_m3().
Referenced by ED_armature_transform(), and blender::ed::object::edit_armature_coords_and_quats_apply_with_mat4().
| void ED_armature_origin_set | ( | Main * | bmain, |
| Object * | ob, | ||
| const float | cursor[3], | ||
| int | centermode, | ||
| int | around ) |
| centermode | 0 == do center, 1 == center new, 2 == center cursor. |
editors/object/. Definition at line 126 of file armature_edit.cc.
References add_v3_v3(), BKE_object_is_in_editmode(), copy_v3_v3(), Object::data, ED_armature_edit_free(), ED_armature_from_edit(), ED_armature_to_edit(), bArmature::edbo, INIT_MINMAX, invert_m4_m4(), LISTBASE_FOREACH, Object::loc, mid_v3_v3v3(), min, minmax_v3v3_v3(), mul_m4_v3(), mul_mat3_m4_v3(), mul_v3_fl(), Object::runtime, sub_v3_v3(), V3D_AROUND_CENTER_BOUNDS, and zero_v3().
Referenced by blender::ed::object::object_origin_set_exec().
Definition at line 116 of file armature_edit.cc.
References BKE_armature_transform(), ED_armature_edit_transform(), and bArmature::edbo.
Definition at line 632 of file armature_edit.cc.
References BLI_addtail(), copy_v3_v3(), equals_v3v3(), EditBone::head, EditBonePoint::head_owner, LISTBASE_FOREACH, MEM_callocN, EditBone::parent, EditBone::tail, EditBonePoint::tail_owner, and EditBonePoint::vec.
Referenced by armature_fill_bones_exec().
|
static |
Definition at line 1026 of file armature_edit.cc.
References add_v3_v3(), BONE_CONNECTED, diff(), equals_v3v3(), EditBone::flag, EditBone::head, EditBone::parent, sub_v3_v3v3(), and EditBone::tail.
Referenced by fix_editbone_connected_children().
Definition at line 1043 of file armature_edit.cc.
References BONE_CONNECTED, fix_connected_bone(), fix_editbone_connected_children(), and LISTBASE_FOREACH.
Referenced by bone_align_to_bone(), and fix_editbone_connected_children().
|
static |
Definition at line 257 of file armature_edit.cc.
Referenced by ARMATURE_OT_calculate_roll().