|
Blender V5.0
|
#include "DNA_armature_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "MEM_guardedalloc.h"#include "BLT_translation.hh"#include "BLI_ghash.h"#include "BLI_listbase.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_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_armature.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 wmOperatorStatus | armature_calc_roll_exec (bContext *C, wmOperator *op) |
| void | ARMATURE_OT_calculate_roll (wmOperatorType *ot) |
| static wmOperatorStatus | 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 232 of file armature_edit.cc.
|
static |
Definition at line 1077 of file armature_edit.cc.
References ARM_MIRROR_EDIT, BKE_report(), BKE_reportf(), bone_align_to_bone(), BONE_SELECTED, C, 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 279 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, blender::animrig::bone_is_visible(), C, 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(), Scene::cursor, Object::data, DEG_id_tag_update(), EBONE_EDITABLE, 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, View3DCursor::location, 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 899 of file armature_edit.cc.
References BONE_TRANSFORM, bArmature::edbo, and LISTBASE_FOREACH.
Referenced by armature_switch_direction_exec().
|
static |
Definition at line 1227 of file armature_edit.cc.
References blender::animrig::bone_is_selected(), ED_armature_ebone_find_name(), and bArmature::edbo.
Referenced by armature_delete_selected_exec().
|
static |
Definition at line 1238 of file armature_edit.cc.
References bArmature::act_edbone, 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(), blender::animrig::bone_is_selected(), C, 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, 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 1289 of file armature_edit.cc.
References ALERT_ICON_NONE, armature_delete_selected_exec(), C, IFACE_, wmOperator::ptr, RNA_boolean_get(), and WM_operator_confirm_ex().
Referenced by ARMATURE_OT_delete().
|
static |
Definition at line 1322 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 1331 of file armature_edit.cc.
References 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, blender::animrig::bone_is_visible(), BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, C, 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 686 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, C, copy_v3_v3(), count, CTX_DATA_BEGIN_WITH_ID, CTX_DATA_END, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), Scene::cursor, DEG_id_tag_update(), ED_armature_edit_deselect_all(), ELEM, fill_add_joint(), ListBase::first, EditBone::flag, FOREACH_OBJECT_IN_EDIT_MODE_BEGIN, FOREACH_OBJECT_IN_EDIT_MODE_END, EditBonePoint::head_owner, bArmature::id, ID_RECALC_SYNC_TO_EVAL, invert_m4_m4(), len_squared_v3v3(), View3DCursor::location, 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 1502 of file armature_edit.cc.
References BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BONE_HIDDEN_A, blender::animrig::bone_is_visible(), BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, C, CTX_DATA_COUNT, 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, 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 1158 of file armature_edit.cc.
References armature_align_bones_exec(), ED_operator_editarmature(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
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, ED_operator_editarmature(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, prop_calc_roll_types, RNA_def_boolean(), RNA_def_enum(), and WM_menu_invoke().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_delete | ( | wmOperatorType * | ot | ) |
Definition at line 1305 of file armature_edit.cc.
References armature_delete_selected_exec(), armature_delete_selected_invoke(), ED_operator_editarmature(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and WM_operator_properties_confirm_or_exec().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_dissolve | ( | wmOperatorType * | ot | ) |
Definition at line 1481 of file armature_edit.cc.
References armature_dissolve_selected_exec(), ED_operator_editarmature(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_fill | ( | wmOperatorType * | ot | ) |
Definition at line 873 of file armature_edit.cc.
References armature_fill_bones_exec(), ED_operator_editarmature(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_hide | ( | wmOperatorType * | ot | ) |
Definition at line 1540 of file armature_edit.cc.
References armature_hide_exec(), ED_operator_editarmature(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and RNA_def_boolean().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_reveal | ( | wmOperatorType * | ot | ) |
Definition at line 1598 of file armature_edit.cc.
References armature_reveal_exec(), ED_operator_editarmature(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and RNA_def_boolean().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_roll_clear | ( | wmOperatorType * | ot | ) |
Definition at line 531 of file armature_edit.cc.
References armature_roll_clear_exec(), DEG2RADF, ED_operator_editarmature(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and RNA_def_float_rotation().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_split | ( | wmOperatorType * | ot | ) |
Definition at line 1206 of file armature_edit.cc.
References armature_split_exec(), ED_operator_editarmature(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_switch_direction | ( | wmOperatorType * | ot | ) |
Definition at line 1008 of file armature_edit.cc.
References armature_switch_direction_exec(), ED_operator_editarmature(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by ED_operatortypes_armature().
|
static |
Definition at line 1565 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, C, 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(), blender::animrig::bone_is_visible(), C, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), EBONE_EDITABLE, 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 1179 of file armature_edit.cc.
References BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BONE_CONNECTED, BONE_SELECTED, C, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), ED_armature_ebone_select_set(), bArmature::edbo, 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 906 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, blender::animrig::bone_is_visible(), BONE_TRANSFORM, C, chains_find_tips(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), EBONE_EDITABLE, 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 1057 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 574 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 61 of file armature_edit.cc.
References C, blender::ed::object::context_active_object(), CTX_data_pointer_get_type(), PointerRNA::data, OB_ARMATURE, and Object::type.
Referenced by active_bone_collection_poll(), armature_bone_select_poll(), bone_collection_add_exec(), bone_collection_add_poll(), bone_collection_assign_poll(), bone_collection_deselect_exec(), bone_collection_move_exec(), bone_collection_remove_exec(), bone_collection_select_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 191 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 blender::ed::transform::recalcData_edit_armature().
See BKE_armature_transform for object-mode transform.
Definition at line 78 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. |
Definition at line 124 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, max, 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 114 of file armature_edit.cc.
References BKE_armature_transform(), ED_armature_edit_transform(), and bArmature::edbo.
Definition at line 634 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 1030 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 1047 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 255 of file armature_edit.cc.
Referenced by ARMATURE_OT_calculate_roll().