Blender
V3.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.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "BKE_action.h"
#include "BKE_armature.h"
#include "BKE_constraint.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_armature.h"
#include "ED_outliner.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "DEG_depsgraph.h"
#include "armature_intern.h"
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 } |
typedef enum eCalcRollTypes | eCalcRollTypes |
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) |
Chain-Based Tool Utilities | |
typedef struct EditBonePoint | EditBonePoint |
static void | chains_find_tips (ListBase *edbo, ListBase *list) |
Armature EditMode tools - transforms, chain based editing, and other settings.
Definition in file armature_edit.c.
typedef enum eCalcRollTypes eCalcRollTypes |
typedef struct EditBonePoint EditBonePoint |
enum eCalcRollTypes |
Definition at line 208 of file armature_edit.c.
|
static |
Definition at line 1058 of file armature_edit.c.
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, NC_OBJECT, ND_BONE_SELECT, NULL, 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 255 of file armature_edit.c.
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, 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, EBONE_VISIBLE, ED_armature_ebone_get_mirrored(), ED_armature_ebone_roll_to_vector(), ED_armature_ebone_to_mat3(), bArmature::edbo, ELEM, ListBase::first, bArmature::flag, EditBone::head, bArmature::id, ID_RECALC_SELECT, if(), Object::imat, invert_m3(), invert_m4_m4(), View3DCursor::location, MEM_freeN, mul_m3_v3(), mul_m4_v3(), NC_OBJECT, ND_BONE_SELECT, negate_v3(), EditBone::next, normalize_v3(), NULL, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, EditBone::parent, wmOperator::ptr, wmOperator::reports, ret, RNA_boolean_get(), RNA_enum_get(), EditBone::roll, RPT_ERROR, scene, sub_v3_v3v3(), EditBone::tail, type, RegionView3D::viewinv, and WM_event_add_notifier().
Referenced by ARMATURE_OT_calculate_roll().
Definition at line 876 of file armature_edit.c.
References BONE_TRANSFORM, bArmature::edbo, ListBase::first, EditBone::flag, and EditBone::next.
Referenced by armature_switch_direction_exec().
Definition at line 1208 of file armature_edit.c.
References BONE_SELECTED, ED_armature_ebone_find_name(), bArmature::edbo, EditBone::flag, EditBone::layer, and bArmature::layer.
Referenced by armature_delete_selected_exec().
|
static |
Definition at line 1219 of file armature_edit.c.
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, BONE_SELECTED, C, CTX_DATA_COUNT, CTX_data_main(), CTX_data_view_layer(), CTX_wm_view3d(), Object::data, DEG_id_tag_update(), ED_armature_ebone_remove(), ED_armature_edit_refresh_layer_used(), ED_armature_edit_sync_selection(), ED_outliner_select_sync_from_edit_bone_tag(), bArmature::edbo, ListBase::first, EditBone::flag, bArmature::id, ID_RECALC_SELECT, EditBone::layer, bArmature::layer, MEM_freeN, NC_OBJECT, ND_BONE_SELECT, EditBone::next, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, Object::pose, and WM_event_add_notifier().
Referenced by ARMATURE_OT_delete().
Definition at line 1291 of file armature_edit.c.
References BONE_DONE, ED_armature_ebone_find_name(), bArmature::edbo, and EditBone::flag.
Referenced by armature_dissolve_selected_exec().
|
static |
Definition at line 1300 of file armature_edit.c.
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, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, C, copy_v3_v3(), CTX_data_view_layer(), CTX_wm_view3d(), Object::data, DEG_id_tag_update(), EditBone::ebone, ED_armature_ebone_remove_ex(), ED_armature_ebone_selectflag_get(), ED_armature_edit_refresh_layer_used(), ED_armature_edit_sync_selection(), ED_outliner_select_sync_from_edit_bone_tag(), bArmature::edbo, ListBase::first, EditBone::flag, bArmature::flag, GHASH_ITER, bArmature::id, ID_RECALC_SELECT, EditBone::layer, bArmature::layer, MEM_freeN, NC_OBJECT, ND_BONE_SELECT, EditBone::next, NULL, 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 663 of file armature_edit.c.
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(), ED_armature_edit_refresh_layer_used(), ELEM, fill_add_joint(), ListBase::first, EditBone::flag, FOREACH_OBJECT_IN_EDIT_MODE_BEGIN, FOREACH_OBJECT_IN_MODE_END, EditBonePoint::head_owner, bArmature::id, ID_RECALC_COPY_ON_WRITE, if(), Object::imat, invert_m4_m4(), len_squared_v3v3(), View3DCursor::location, mul_v3_m4v3(), NC_OBJECT, ND_POSE, EditBonePoint::next, NULL, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, EditBone::parent, wmOperator::reports, RPT_ERROR, scene, EditBonePoint::tail_owner, EditBonePoint::vec, and WM_event_add_notifier().
Referenced by ARMATURE_OT_fill().
|
static |
Definition at line 1472 of file armature_edit.c.
References BKE_view_layer_array_from_objects_in_edit_mode_unique_data, BONE_HIDDEN_A, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, C, CTX_DATA_COUNT, CTX_data_view_layer(), CTX_wm_view3d(), Object::data, DEG_id_tag_update(), EBONE_VISIBLE, ED_armature_edit_sync_selection(), ED_armature_edit_validate_active(), bArmature::edbo, bArmature::id, ID_RECALC_SELECT, invert(), LISTBASE_FOREACH, MEM_freeN, 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 1137 of file armature_edit.c.
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 439 of file armature_edit.c.
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 1275 of file armature_edit.c.
References armature_delete_selected_exec(), 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_confirm().
Referenced by ED_operatortypes_armature().
void ARMATURE_OT_dissolve | ( | wmOperatorType * | ot | ) |
Definition at line 1451 of file armature_edit.c.
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 850 of file armature_edit.c.
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 1513 of file armature_edit.c.
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 1573 of file armature_edit.c.
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 508 of file armature_edit.c.
References armature_roll_clear_exec(), DEG2RADF, wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, NULL, 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 1187 of file armature_edit.c.
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 988 of file armature_edit.c.
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 1537 of file armature_edit.c.
References 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_view_layer(), CTX_wm_view3d(), Object::data, DEG_id_tag_update(), ED_armature_edit_sync_selection(), ED_armature_edit_validate_active(), bArmature::edbo, bArmature::id, ID_RECALC_SELECT, bArmature::layer, LISTBASE_FOREACH, MEM_freeN, 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 464 of file armature_edit.c.
References ARM_MIRROR_EDIT, BKE_view_layer_array_from_objects_in_edit_mode_unique_data, C, CTX_data_view_layer(), CTX_wm_view3d(), Object::data, DEG_id_tag_update(), EBONE_EDITABLE, EBONE_VISIBLE, ED_armature_ebone_get_mirrored(), bArmature::edbo, bArmature::flag, bArmature::id, ID_RECALC_SELECT, LISTBASE_FOREACH, MEM_freeN, 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 1158 of file armature_edit.c.
References BKE_view_layer_array_from_objects_in_edit_mode_unique_data, BONE_CONNECTED, BONE_SELECTED, C, CTX_data_view_layer(), CTX_wm_view3d(), Object::data, DEG_id_tag_update(), ED_armature_ebone_select_set(), bArmature::edbo, bArmature::id, ID_RECALC_SELECT, LISTBASE_FOREACH, MEM_freeN, NC_OBJECT, ND_BONE_SELECT, NULL, OPERATOR_FINISHED, and WM_event_add_notifier().
Referenced by ARMATURE_OT_split().
|
static |
Definition at line 885 of file armature_edit.c.
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, C, chains_find_tips(), CTX_data_view_layer(), CTX_wm_view3d(), LinkData::data, Object::data, DEG_id_tag_update(), EBONE_EDITABLE, EBONE_VISIBLE, bArmature::edbo, equals_v3v3(), ListBase::first, EditBone::flag, EditBone::head, bArmature::id, ID_RECALC_SELECT, MEM_freeN, NC_OBJECT, ND_BONE_SELECT, LinkData::next, NULL, OPERATOR_FINISHED, EditBone::parent, swap_v3_v3(), EditBone::tail, and WM_event_add_notifier().
Referenced by ARMATURE_OT_switch_direction().
Definition at line 1038 of file armature_edit.c.
References add_v3_v3v3(), fix_editbone_connected_children(), EditBone::head, len_v3(), blender::math::length(), mul_v3_fl(), normalize_v3(), EditBone::roll, sub_v3_v3v3(), and EditBone::tail.
Referenced by armature_align_bones_exec().
Definition at line 551 of file armature_edit.c.
References BLI_addtail(), LinkData::data, ListBase::first, MEM_callocN, EditBone::next, LinkData::next, and EditBone::parent.
Referenced by armature_switch_direction_exec().
float ED_armature_ebone_roll_to_vector | ( | const EditBone * | bone, |
const float | align_axis[3], | ||
const bool | axis_only | ||
) |
Definition at line 168 of file armature_edit.c.
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 53 of file armature_edit.c.
References copy_m3_m4(), EditBone::dist, ED_armature_ebone_to_mat3(), bArmature::edbo, ListBase::first, EditBone::head, mat3_to_vec_roll(), mat4_to_scale(), mul_m3_m3m3(), mul_m4_v3(), EditBone::next, normalize_m3(), NULL, EditBone::rad_head, EditBone::rad_tail, EditBone::roll, EditBone::tail, EditBone::xwidth, and EditBone::zwidth.
Referenced by ED_armature_transform(), and edit_armature_coords_and_quats_apply_with_mat4().
void ED_armature_origin_set | ( | struct Main * | bmain, |
struct 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 100 of file armature_edit.c.
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, ListBase::first, EditBone::head, Object::imat, INIT_MINMAX, invert_m4_m4(), Object::loc, max, mid_v3_v3v3(), min, minmax_v3v3_v3(), mul_m4_v3(), mul_mat3_m4_v3(), mul_v3_fl(), EditBone::next, Object::obmat, sub_v3_v3(), EditBone::tail, V3D_AROUND_CENTER_BOUNDS, and zero_v3().
Referenced by object_origin_set_exec().
Definition at line 90 of file armature_edit.c.
References BKE_armature_transform(), ED_armature_edit_transform(), and bArmature::edbo.
Definition at line 611 of file armature_edit.c.
References BLI_addtail(), copy_v3_v3(), equals_v3v3(), ListBase::first, EditBone::head, EditBonePoint::head_owner, MEM_callocN, EditBonePoint::next, EditBone::parent, EditBone::tail, EditBonePoint::tail_owner, and EditBonePoint::vec.
Referenced by armature_fill_bones_exec().
Definition at line 1010 of file armature_edit.c.
References add_v3_v3(), BONE_CONNECTED, KDL::diff(), equals_v3v3(), EditBone::flag, EditBone::head, EditBone::parent, sub_v3_v3v3(), and EditBone::tail.
Referenced by fix_editbone_connected_children().
Definition at line 1026 of file armature_edit.c.
References BONE_CONNECTED, ListBase::first, fix_connected_bone(), EditBone::flag, EditBone::next, and EditBone::parent.
Referenced by bone_align_to_bone().
|
static |
Definition at line 231 of file armature_edit.c.
Referenced by ARMATURE_OT_calculate_roll().