70 for (con = lb->
first; con; con = con->
next) {
76 for (ct = targets.
first; ct; ct = ct->
next) {
77 if (ct->
tar == srcArm) {
99 &tarArm->
id,
data->act,
"pose.bones[", pchan->
name, curbone->
name, 0, 0,
false);
133 bool changed =
false;
136 if ((
id == src_id) && strstr(fcu->
rna_path,
"pose.bones[")) {
143 if (!
STREQ(old_name, new_name) && strstr(fcu->
rna_path, old_name)) {
145 id, fcu->
rna_path,
"pose.bones", old_name, new_name, 0, 0,
false);
172 if (dtar->id == src_id) {
181 if ((dtar->rna_path && strstr(dtar->rna_path,
"pose.bones[")) || (dtar->pchan_name[0])) {
187 if (!
STREQ(old_name, new_name)) {
188 if ((dtar->rna_path) && strstr(dtar->rna_path, old_name)) {
191 id, dtar->rna_path,
"pose.bones", old_name, new_name, 0, 0,
false);
194 if (
STREQ(dtar->pchan_name, old_name)) {
196 BLI_strncpy(dtar->pchan_name, new_name,
sizeof(dtar->pchan_name));
228 bmain, ob, tarArm, srcArm, pchan, curbone, &pchant->
constraints);
235 bmain, ob, tarArm, srcArm, pchan, curbone, &ob->
constraints);
265 float mat[4][4], oimat[4][4];
272 if (!arm || arm->
edbo) {
277 if (ob_iter == ob_active) {
298 pose = ob_active->
pose;
302 if ((ob_iter->type ==
OB_ARMATURE) && (ob_iter != ob_active)) {
319 opose = ob_iter->pose;
327 for (pchan = opose->chanbase.first; pchan; pchan = pchann) {
328 pchann = pchan->next;
360 curbone->roll -=
atan2f(difmat[2][0], difmat[2][2]);
367 BLI_strncpy(pchan->name, curbone->name,
sizeof(pchan->name));
467 for (ct = targets.
first; ct; ct = ct->
next) {
474 if (ct->
tar == origArm) {
479 else if (ct->
tar == newArm) {
501 for (ct = targets.
first; ct; ct = ct->
next) {
507 if (ct->
tar == origArm) {
512 else if (ct->
tar == newArm) {
555 pchann = pchan->
next;
563 if (ebo->parent == curbone) {
573 if (pchn->parent == pchan) {
576 if (pchn->bbone_next == pchan) {
577 pchn->bbone_next =
NULL;
579 if (pchn->bbone_prev == pchan) {
580 pchn->bbone_prev =
NULL;
615 for (
uint base_index = 0; base_index < bases_len; base_index++) {
616 Base *base_old = bases[base_index];
621 bool has_selected_bone =
false;
622 bool has_selected_any =
false;
626 has_selected_bone =
true;
630 has_selected_any =
true;
634 if (has_selected_bone ==
false) {
635 if (has_selected_any) {
707 ot->
name =
"Separate Bones";
708 ot->
idname =
"ARMATURE_OT_separate";
709 ot->
description =
"Isolate selected bones into a separate armature";
727 #define ARM_PAR_CONNECT 1
728 #define ARM_PAR_OFFSET 2
731 #define ARM_PAR_CLEAR 1
732 #define ARM_PAR_CLEAR_DISCONNECT 2
755 selbone->
parent = actbone;
758 for (ebone = actbone->
parent; ebone; ebone = ebone->
parent) {
759 if (ebone->
parent == selbone) {
776 for (ebone = edbo->
first; ebone; ebone = ebone->
next) {
780 if (par == selbone) {
809 if (actbone ==
NULL) {
822 if (actmirb ==
NULL) {
829 bool is_active_only_selected =
false;
831 is_active_only_selected =
true;
834 if (ebone != actbone) {
835 is_active_only_selected =
false;
842 if (is_active_only_selected) {
846 if (actbone->parent) {
866 if (ebone != actbone) {
873 if (ebone_mirror != actmirb) {
894 bool enable_offset =
false;
896 bool enable_connect =
false;
905 if (ebone == actbone) {
909 if (ebone->parent != actbone) {
910 enable_offset =
true;
911 enable_connect =
true;
915 enable_connect =
true;
941 ot->
idname =
"ARMATURE_OT_parent_set";
942 ot->
description =
"Set the active bone as the parent of the selected bones";
985 uint objects_len = 0;
988 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
989 Object *ob = objects[ob_index];
991 bool changed =
false;
1019 bool enable_disconnect =
false;
1021 bool enable_clear =
false;
1029 if (ebone->parent ==
NULL) {
1032 enable_clear =
true;
1035 enable_disconnect =
true;
1062 ot->
name =
"Clear Parent";
1063 ot->
idname =
"ARMATURE_OT_parent_clear";
1065 "Remove the parent-child relationship between selected bones and their parents";
1080 "What way to clear parenting");
Blender kernel action and pose functionality.
void BKE_pose_channels_hash_free(struct bPose *pose)
void BKE_pose_channel_free(struct bPoseChannel *pchan)
struct AnimData * BKE_animdata_copy(struct Main *bmain, struct AnimData *adt, int flag)
void BKE_animdata_merge_copy(struct Main *bmain, struct ID *dst_id, struct ID *src_id, eAnimData_MergeCopy_Modes action_mode, bool fix_drivers)
void BKE_fcurves_main_cb(struct Main *bmain, ID_FCurve_Edit_Callback func, void *user_data)
char * BKE_animsys_fix_rna_path_rename(struct ID *owner_id, char *old_path, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths)
void BKE_action_fix_paths_rename(struct ID *owner_id, struct bAction *act, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths)
void BKE_constraint_targets_flush(struct bConstraint *con, struct ListBase *targets, bool no_copy)
int BKE_constraint_targets_get(struct bConstraint *con, struct ListBase *r_targets)
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_edit_object(const bContext *C)
#define CTX_DATA_BEGIN(C, Type, instance, member)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct EditBone * CTX_data_active_bone(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
#define DRIVER_TARGETS_USED_LOOPER_BEGIN(dvar)
#define DRIVER_TARGETS_LOOPER_END
#define BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, v3d, r_len)
#define BKE_view_layer_array_from_bases_in_edit_mode_unique_data(view_layer, v3d, r_len)
void BKE_report(ReportList *reports, eReportType type, const char *message)
BLI_INLINE void * BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_str_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
#define GHASH_ITER(gh_iter_, ghash_)
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void invert_m4_m4_safe_ortho(float Ainv[4][4], const float A[4][4])
void unit_m4(float m[4][4])
void copy_m4_m3(float m1[4][4], const float m2[3][3])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
void mul_m4_m3m4(float R[4][4], const float A[3][3], const float B[4][4])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_COPY_ON_WRITE
Object is a sort of wrapper for general info.
#define EBONE_VISIBLE(arm, ebone)
#define EBONE_EDITABLE(ebone)
struct Base * ED_object_add_duplicate(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, struct Base *base, eDupli_ID_Flags dupflag)
void ED_object_base_free_and_unlink(struct Main *bmain, struct Scene *scene, struct Object *ob)
void ED_outliner_select_sync_from_object_tag(struct bContext *C)
bool ED_operator_editarmature(struct bContext *C)
Read Guarded memory(de)allocation.
void uiLayoutSetEnabled(uiLayout *layout, bool enabled)
struct uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void uiItemEnumO(uiLayout *layout, const char *opname, const char *name, int icon, const char *propname, int value)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL()
void bone_free(struct bArmature *arm, struct EditBone *bone)
void ED_armature_ebone_unique_name(ListBase *ebones, char *name, EditBone *bone)
static void separate_armature_bones(Main *bmain, Object *ob, const bool is_select)
static void joined_armature_fix_links(Main *bmain, Object *tarArm, Object *srcArm, bPoseChannel *pchan, EditBone *curbone)
static const EnumPropertyItem prop_editarm_clear_parent_types[]
void ARMATURE_OT_parent_clear(wmOperatorType *ot)
static int armature_parent_clear_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
#define ARM_PAR_CLEAR_DISCONNECT
static void joined_armature_fix_animdata_cb(ID *id, FCurve *fcu, void *user_data)
static int armature_parent_set_exec(bContext *C, wmOperator *op)
static void joined_armature_fix_links_constraints(Main *bmain, Object *ob, Object *tarArm, Object *srcArm, bPoseChannel *pchan, EditBone *curbone, ListBase *lb)
static int separate_armature_exec(bContext *C, wmOperator *op)
static int armature_parent_clear_exec(bContext *C, wmOperator *op)
int ED_armature_join_objects_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_parent_set(wmOperatorType *ot)
static void separated_armature_fix_links(Main *bmain, Object *origArm, Object *newArm)
static void bone_connect_to_new_parent(ListBase *edbo, EditBone *selbone, EditBone *actbone, short mode)
static int armature_parent_set_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
void ARMATURE_OT_separate(wmOperatorType *ot)
static void editbone_clear_parent(EditBone *ebone, int mode)
static const EnumPropertyItem prop_editarm_make_parent_types[]
struct tJoinArmature_AdtFixData tJoinArmature_AdtFixData
static void bone_connect_to_existing_parent(EditBone *bone)
bool ED_armature_edit_deselect_all(Object *obedit)
void ED_armature_edit_refresh_layer_used(bArmature *arm)
void ED_armature_edit_sync_selection(ListBase *edbo)
void ED_armature_ebone_to_mat3(EditBone *ebone, float r_mat[3][3])
void ED_armature_edit_free(struct bArmature *arm)
void ED_armature_from_edit(Main *bmain, bArmature *arm)
EditBone * ED_armature_ebone_find_name(const ListBase *edbo, const char *name)
void ED_armature_to_edit(bArmature *arm)
EditBone * ED_armature_ebone_get_mirrored(const ListBase *edbo, EditBone *ebo)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct EditBone * act_edbone
struct bConstraintTarget * next
struct bConstraint * next
struct bPoseChannel * next
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_cursor_wait(bool val)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))