Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "BLT_translation.h"
#include "BKE_action.h"
#include "BKE_anim_data.h"
#include "BKE_animsys.h"
#include "BKE_armature.h"
#include "BKE_constraint.h"
#include "BKE_context.h"
#include "BKE_fcurve_driver.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_armature.h"
#include "ED_object.h"
#include "ED_outliner.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "armature_intern.h"
Go to the source code of this file.
Classes | |
struct | tJoinArmature_AdtFixData |
Functions | |
Edit Armature Separate | |
static void | separated_armature_fix_links (Main *bmain, Object *origArm, Object *newArm) |
static void | separate_armature_bones (Main *bmain, Object *ob, const bool is_select) |
static int | separate_armature_exec (bContext *C, wmOperator *op) |
void | ARMATURE_OT_separate (wmOperatorType *ot) |
Edit Armature Parenting | |
#define | ARM_PAR_CONNECT 1 |
#define | ARM_PAR_OFFSET 2 |
#define | ARM_PAR_CLEAR 1 |
#define | ARM_PAR_CLEAR_DISCONNECT 2 |
static const EnumPropertyItem | prop_editarm_make_parent_types [] |
static const EnumPropertyItem | prop_editarm_clear_parent_types [] |
static void | bone_connect_to_existing_parent (EditBone *bone) |
static void | bone_connect_to_new_parent (ListBase *edbo, EditBone *selbone, EditBone *actbone, short mode) |
static int | armature_parent_set_exec (bContext *C, wmOperator *op) |
static int | armature_parent_set_invoke (bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) |
void | ARMATURE_OT_parent_set (wmOperatorType *ot) |
static void | editbone_clear_parent (EditBone *ebone, int mode) |
static int | armature_parent_clear_exec (bContext *C, wmOperator *op) |
static int | armature_parent_clear_invoke (bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) |
void | ARMATURE_OT_parent_clear (wmOperatorType *ot) |
Edit Armature Join | |
| |
typedef struct tJoinArmature_AdtFixData | tJoinArmature_AdtFixData |
static void | joined_armature_fix_links_constraints (Main *bmain, Object *ob, Object *tarArm, Object *srcArm, bPoseChannel *pchan, EditBone *curbone, ListBase *lb) |
static void | joined_armature_fix_animdata_cb (ID *id, FCurve *fcu, void *user_data) |
static void | joined_armature_fix_links (Main *bmain, Object *tarArm, Object *srcArm, bPoseChannel *pchan, EditBone *curbone) |
int | ED_armature_join_objects_exec (bContext *C, wmOperator *op) |
Operators for relations between bones and for transferring bones between armature objects.
Definition in file armature_relations.c.
#define ARM_PAR_CLEAR 1 |
Definition at line 731 of file armature_relations.c.
#define ARM_PAR_CLEAR_DISCONNECT 2 |
Definition at line 732 of file armature_relations.c.
#define ARM_PAR_CONNECT 1 |
Definition at line 727 of file armature_relations.c.
#define ARM_PAR_OFFSET 2 |
Definition at line 728 of file armature_relations.c.
typedef struct tJoinArmature_AdtFixData tJoinArmature_AdtFixData |
void ARMATURE_OT_parent_clear | ( | wmOperatorType * | ot | ) |
Definition at line 1059 of file armature_relations.c.
References armature_parent_clear_exec(), armature_parent_clear_invoke(), 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_editarm_clear_parent_types, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
void ARMATURE_OT_parent_set | ( | wmOperatorType * | ot | ) |
Definition at line 937 of file armature_relations.c.
References armature_parent_set_exec(), armature_parent_set_invoke(), wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, prop_editarm_make_parent_types, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
void ARMATURE_OT_separate | ( | wmOperatorType * | ot | ) |
Definition at line 704 of file armature_relations.c.
References wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, separate_armature_exec(), and WM_operator_confirm().
Referenced by ED_operatortypes_armature().
|
static |
Definition at line 975 of file armature_relations.c.
References BKE_view_layer_array_from_objects_in_edit_mode_unique_data, C, CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_view_layer(), CTX_wm_view3d(), Object::data, EBONE_EDITABLE, ED_armature_edit_sync_selection(), bArmature::edbo, editbone_clear_parent(), LISTBASE_FOREACH, MEM_freeN, NC_OBJECT, ND_BONE_SELECT, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), and WM_event_add_notifier().
Referenced by ARMATURE_OT_parent_clear().
|
static |
Definition at line 1014 of file armature_relations.c.
References ARM_PAR_CLEAR, ARM_PAR_CLEAR_DISCONNECT, BLT_I18NCONTEXT_OPERATOR_DEFAULT, BONE_CONNECTED, BONE_SELECTED, C, CTX_data_edit_object(), CTX_IFACE_, Object::data, EBONE_EDITABLE, bArmature::edbo, LISTBASE_FOREACH, NULL, OPERATOR_INTERFACE, UI_popup_menu_begin(), UI_popup_menu_end(), UI_popup_menu_layout(), uiItemEnumO(), uiLayoutRow(), and uiLayoutSetEnabled().
Referenced by ARMATURE_OT_parent_clear().
|
static |
Definition at line 800 of file armature_relations.c.
References ARM_MIRROR_EDIT, BKE_report(), bone_connect_to_existing_parent(), bone_connect_to_new_parent(), BONE_SELECTED, C, CTX_data_active_bone(), CTX_data_edit_object(), Object::data, DEG_id_tag_update(), EBONE_EDITABLE, ED_armature_ebone_get_mirrored(), bArmature::edbo, EditBone::flag, bArmature::flag, Object::id, ID_RECALC_SELECT, LISTBASE_FOREACH, NC_OBJECT, ND_BONE_SELECT, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, EditBone::parent, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), RPT_ERROR, and WM_event_add_notifier().
Referenced by ARMATURE_OT_parent_set().
|
static |
Definition at line 889 of file armature_relations.c.
References bArmature::act_edbone, ARM_PAR_CONNECT, ARM_PAR_OFFSET, BLT_I18NCONTEXT_OPERATOR_DEFAULT, BONE_CONNECTED, BONE_SELECTED, C, CTX_data_edit_object(), CTX_IFACE_, Object::data, EBONE_EDITABLE, bArmature::edbo, LISTBASE_FOREACH, NULL, OPERATOR_INTERFACE, UI_popup_menu_begin(), UI_popup_menu_end(), UI_popup_menu_layout(), uiItemEnumO(), uiLayoutRow(), and uiLayoutSetEnabled().
Referenced by ARMATURE_OT_parent_set().
Definition at line 735 of file armature_relations.c.
References BONE_CONNECTED, copy_v3_v3(), EditBone::flag, EditBone::head, EditBone::parent, EditBone::rad_head, EditBone::rad_tail, and EditBone::tail.
Referenced by armature_parent_set_exec().
|
static |
Definition at line 742 of file armature_relations.c.
References add_v3_v3(), ARM_PAR_CONNECT, BONE_CONNECTED, BONE_TIPSEL, copy_v3_v3(), ListBase::first, EditBone::flag, EditBone::head, EditBone::next, NULL, offset, EditBone::parent, EditBone::rad_head, EditBone::rad_tail, sub_v3_v3v3(), and EditBone::tail.
Referenced by armature_parent_set_exec().
int ED_armature_join_objects_exec | ( | struct bContext * | C, |
struct wmOperator * | op | ||
) |
Join armature exec is exported for use in object->join objects operator.
Definition at line 256 of file armature_relations.c.
References bArmature::adt, Object::adt, ADT_MERGECOPY_KEEP_DST, atan2f, BKE_animdata_copy(), BKE_animdata_merge_copy(), BKE_fcurves_main_cb(), BKE_pose_channels_hash_free(), BKE_report(), BLI_addtail(), BLI_assert, BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_str_new(), BLI_remlink(), BLI_strdup(), BLI_strncpy(), tJoinArmature_AdtFixData::bmain, C, copy_m4_m3(), CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_main(), CTX_data_scene(), Object::data, DEG_id_tag_update(), DEG_id_tag_update_ex(), DEG_relations_tag_update(), ED_armature_ebone_find_name(), ED_armature_ebone_to_mat3(), ED_armature_ebone_unique_name(), ED_armature_edit_free(), ED_armature_from_edit(), ED_armature_to_edit(), ED_object_base_free_and_unlink(), bArmature::edbo, bArmature::id, Object::id, Scene::id, ID_RECALC_GEOMETRY, ID_RECALC_SELECT, if(), invert_m4_m4(), invert_m4_m4_safe_ortho(), joined_armature_fix_animdata_cb(), joined_armature_fix_links(), MEM_freeN, Object::mode, mul_m4_m3m4(), mul_m4_m4m4(), mul_m4_v3(), tJoinArmature_AdtFixData::names_map, NC_SCENE, ND_LAYER_CONTENT, ND_OB_ACTIVE, NULL, OB_ARMATURE, OB_MODE_POSE, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, Object::pose, wmOperator::reports, RPT_WARNING, scene, tJoinArmature_AdtFixData::srcArm, tJoinArmature_AdtFixData::tarArm, Object::type, unit_m4(), and WM_event_add_notifier().
Referenced by object_join_exec().
Definition at line 962 of file armature_relations.c.
References BONE_CONNECTED, BONE_TIPSEL, EditBone::flag, NULL, and EditBone::parent.
Referenced by armature_parent_clear_exec().
Definition at line 126 of file armature_relations.c.
References BKE_animsys_fix_rna_path_rename(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), BLI_strncpy(), tJoinArmature_AdtFixData::bmain, DEG_id_tag_update_ex(), FCurve::driver, DRIVER_FLAG_INVALID, DRIVER_TARGETS_LOOPER_END, DRIVER_TARGETS_USED_LOOPER_BEGIN, FCURVE_DISABLED, ListBase::first, ChannelDriver::flag, FCurve::flag, GHASH_ITER, Object::id, ID_RECALC_COPY_ON_WRITE, tJoinArmature_AdtFixData::names_map, DriverVar::next, FCurve::rna_path, tJoinArmature_AdtFixData::srcArm, STREQ, tJoinArmature_AdtFixData::tarArm, user_data, and ChannelDriver::variables.
Referenced by ED_armature_join_objects_exec().
|
static |
Definition at line 214 of file armature_relations.c.
References BLI_strncpy(), bPose::chanbase, bPoseChannel::constraints, Object::constraints, DEG_id_tag_update_ex(), ListBase::first, Object::id, ID_RECALC_COPY_ON_WRITE, joined_armature_fix_links_constraints(), EditBone::name, bPoseChannel::name, bPoseChannel::next, ID::next, OB_ARMATURE, Main::objects, PARBONE, Object::parent, Object::parsubstr, Object::partype, Object::pose, STREQ, and Object::type.
Referenced by ED_armature_join_objects_exec().
|
static |
Definition at line 59 of file armature_relations.c.
References BKE_action_fix_paths_rename(), BKE_constraint_targets_flush(), BKE_constraint_targets_get(), BLI_strncpy(), CONSTRAINT_TYPE_ACTION, data, bConstraint::data, DEG_id_tag_update_ex(), ListBase::first, Object::id, ID_RECALC_COPY_ON_WRITE, EditBone::name, bPoseChannel::name, bConstraint::next, bConstraintTarget::next, NULL, STREQ, bConstraintTarget::subtarget, bConstraintTarget::tar, and bConstraint::type.
Referenced by joined_armature_fix_links().
Helper function for armature separating - remove certain bones from the given armature.
ob | Armature object (must not be is not in edit-mode). |
is_select | remove selected bones from the armature, otherwise the unselected bones are removed. |
Definition at line 544 of file armature_relations.c.
References BKE_pose_channel_free(), BKE_pose_channels_hash_free(), BLI_freelinkN(), BONE_CONNECTED, bone_free(), BONE_SELECTED, bPose::chanbase, Object::data, EBONE_VISIBLE, ED_armature_ebone_find_name(), ED_armature_edit_deselect_all(), ED_armature_edit_free(), ED_armature_from_edit(), ED_armature_to_edit(), bArmature::edbo, ListBase::first, LISTBASE_FOREACH, bPoseChannel::name, bPoseChannel::next, NULL, and Object::pose.
Referenced by separate_armature_exec().
|
static |
Definition at line 601 of file armature_relations.c.
References BKE_report(), BKE_view_layer_array_from_bases_in_edit_mode_unique_data, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), Object::data, DEG_id_tag_update(), DEG_relations_tag_update(), EBONE_VISIBLE, ED_armature_edit_deselect_all(), ED_armature_edit_free(), ED_armature_edit_refresh_layer_used(), ED_armature_from_edit(), ED_armature_to_edit(), ED_object_add_duplicate(), ED_outliner_select_sync_from_object_tag(), bArmature::edbo, Object::id, ID_RECALC_GEOMETRY, LISTBASE_FOREACH, MEM_freeN, Object::mode, NC_OBJECT, ND_POSE, OB_MODE_POSE, Base::object, OPERATOR_FINISHED, wmOperator::reports, RPT_INFO, scene, separate_armature_bones(), separated_armature_fix_links(), USER_DUP_ACT, USER_DUP_ARM, WM_cursor_wait(), and WM_event_add_notifier().
Referenced by ARMATURE_OT_separate().
Definition at line 445 of file armature_relations.c.
References BKE_constraint_targets_flush(), BKE_constraint_targets_get(), BLI_findstring(), bPose::chanbase, bPoseChannel::constraints, Object::constraints, ListBase::first, Object::id, bPoseChannel::next, bConstraint::next, bConstraintTarget::next, ID::next, NULL, OB_ARMATURE, Main::objects, PARBONE, Object::parent, Object::parsubstr, Object::partype, Object::pose, bConstraintTarget::subtarget, bConstraintTarget::tar, and Object::type.
Referenced by separate_armature_exec().
|
static |
Definition at line 956 of file armature_relations.c.
Referenced by ARMATURE_OT_parent_clear().
|
static |
Definition at line 794 of file armature_relations.c.
Referenced by ARMATURE_OT_parent_set().