diff options
Diffstat (limited to 'source')
32 files changed, 171 insertions, 168 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 034248df8d5..c06a1a8106c 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -499,7 +499,7 @@ bPoseChannel *BKE_pose_channel_active(Object *ob) } /** - * \see #ED_armature_bone_get_mirrored (edit-mode, matching function) + * \see #ED_armature_ebone_get_mirrored (edit-mode, matching function) */ bPoseChannel *BKE_pose_channel_get_mirrored(const bPose *pose, const char *name) { diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp index c62aa054176..7727eea793c 100644 --- a/source/blender/collada/ArmatureImporter.cpp +++ b/source/blender/collada/ArmatureImporter.cpp @@ -102,7 +102,7 @@ int ArmatureImporter::create_bone(SkinInfo *skin, COLLADAFW::Node *node, EditBon it = std::find(finished_joints.begin(), finished_joints.end(), node); if (it != finished_joints.end()) return chain_length; - EditBone *bone = ED_armature_edit_bone_add(arm, (char *)bc_get_joint_name(node)); + EditBone *bone = ED_armature_ebone_add(arm, (char *)bc_get_joint_name(node)); totbone++; /* diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 8b922082fe8..20904ed0263 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -2812,7 +2812,7 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, /* deselect all other channels */ ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, false, ACHANNEL_SETFLAG_CLEAR); - if (pchan) ED_pose_de_selectall(ob, SEL_DESELECT, false); + if (pchan) ED_pose_deselect_all(ob, SEL_DESELECT, false); /* only select channels in group and group itself */ for (fcu = agrp->channels.first; fcu && fcu->grp == agrp; fcu = fcu->next) @@ -2822,7 +2822,7 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, else { /* select group by itself */ ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, false, ACHANNEL_SETFLAG_CLEAR); - if (pchan) ED_pose_de_selectall(ob, SEL_DESELECT, false); + if (pchan) ED_pose_deselect_all(ob, SEL_DESELECT, false); agrp->flag |= AGRP_SELECTED; } diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c index bd3ddfe93c6..cb072bee345 100644 --- a/source/blender/editors/armature/armature_add.c +++ b/source/blender/editors/armature/armature_add.c @@ -63,12 +63,12 @@ /* default bone add, returns it selected, but without tail set */ /* XXX should be used everywhere, now it mallocs bones still locally in functions */ -EditBone *ED_armature_edit_bone_add(bArmature *arm, const char *name) +EditBone *ED_armature_ebone_add(bArmature *arm, const char *name) { EditBone *bone = MEM_callocN(sizeof(EditBone), "eBone"); BLI_strncpy(bone->name, name, sizeof(bone->name)); - unique_editbone_name(arm->edbo, bone->name, NULL); + ED_armature_ebone_unique_name(arm->edbo, bone->name, NULL); BLI_addtail(arm->edbo, bone); @@ -97,15 +97,15 @@ EditBone *ED_armature_edit_bone_add(bArmature *arm, const char *name) return bone; } -EditBone *ED_armature_edit_bone_add_primitive(Object *obedit_arm, float length, bool view_aligned) +EditBone *ED_armature_ebone_add_primitive(Object *obedit_arm, float length, bool view_aligned) { bArmature *arm = obedit_arm->data; EditBone *bone; - ED_armature_deselect_all(obedit_arm); + ED_armature_edit_deselect_all(obedit_arm); /* Create a bone */ - bone = ED_armature_edit_bone_add(arm, "Bone"); + bone = ED_armature_ebone_add(arm, "Bone"); arm->act_edbone = bone; @@ -157,12 +157,12 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op)) to_root = 1; } - ED_armature_deselect_all(obedit); + ED_armature_edit_deselect_all(obedit); /* we re-use code for mirror editing... */ flipbone = NULL; if (arm->flag & ARM_MIRROR_EDIT) - flipbone = ED_armature_bone_get_mirrored(arm->edbo, ebone); + flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone); for (a = 0; a < 2; a++) { if (a == 1) { @@ -173,7 +173,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op)) } } - newbone = ED_armature_edit_bone_add(arm, ebone->name); + newbone = ED_armature_ebone_add(arm, ebone->name); arm->act_edbone = newbone; if (to_root) { @@ -205,7 +205,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op)) } - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit); @@ -268,7 +268,7 @@ EditBone *add_points_bone(Object *obedit, float head[3], float tail[3]) { EditBone *ebo; - ebo = ED_armature_edit_bone_add(obedit->data, "Bone"); + ebo = ED_armature_ebone_add(obedit->data, "Bone"); copy_v3_v3(ebo->head, head); copy_v3_v3(ebo->tail, tail); @@ -333,7 +333,7 @@ void postEditBoneDuplicate(struct ListBase *editbones, Object *ob) for (EditBone *ebone_src = editbones->first; ebone_src; ebone_src = ebone_src->next) { EditBone *ebone_dst = ebone_src->temp.ebone; if (!ebone_dst) { - ebone_dst = ED_armature_bone_get_mirrored(editbones, ebone_src); + ebone_dst = ED_armature_ebone_get_mirrored(editbones, ebone_src); } if (ebone_dst) { BLI_ghash_insert(name_map, ebone_src->name, ebone_dst->name); @@ -438,7 +438,7 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase BLI_strncpy(eBone->name, name, sizeof(eBone->name)); } - unique_editbone_name(editbones, eBone->name, NULL); + ED_armature_ebone_unique_name(editbones, eBone->name, NULL); BLI_addtail(editbones, eBone); /* copy the ID property */ @@ -487,7 +487,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) const bool do_flip_names = RNA_boolean_get(op->ptr, "do_flip_names"); - ED_armature_sync_selection(arm->edbo); // XXX why is this needed? + ED_armature_edit_sync_selection(arm->edbo); // XXX why is this needed? preEditBoneDuplicate(arm->edbo); @@ -499,7 +499,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) { EditBone *ebone; - ebone = ED_armature_bone_get_mirrored(arm->edbo, ebone_iter); + ebone = ED_armature_ebone_get_mirrored(arm->edbo, ebone_iter); if (ebone) { ebone->flag |= BONE_SELECTED; } @@ -522,7 +522,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) /* Only use flipped name if not yet in use. Otherwise we'd get again inconsistent namings * (different numbers), better keep default behavior in this case. */ - if (ED_armature_bone_find_name(arm->edbo, new_bone_name_buff) == NULL) { + if (ED_armature_ebone_find_name(arm->edbo, new_bone_name_buff) == NULL) { new_bone_name = new_bone_name_buff; } } @@ -583,7 +583,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) postEditBoneDuplicate(arm->edbo, obedit); - ED_armature_validate_active(arm); + ED_armature_edit_validate_active(arm); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit); @@ -630,7 +630,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op) if (CTX_DATA_COUNT(C, selected_bones) == 0) return OPERATOR_CANCELLED; - ED_armature_sync_selection(arm->edbo); // XXX why is this needed? + ED_armature_edit_sync_selection(arm->edbo); // XXX why is this needed? preEditBoneDuplicate(arm->edbo); @@ -648,7 +648,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op) ebone_iter->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); } else { - EditBone *ebone = ED_armature_bone_find_name(arm->edbo, name_flip); + EditBone *ebone = ED_armature_ebone_find_name(arm->edbo, name_flip); if (ebone) { if ((ebone->flag & BONE_SELECTED) == 0) { @@ -738,7 +738,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op) /* the parent may have been duplicated, if not lookup the mirror parent */ EditBone *ebone_parent = (ebone_iter->parent->temp.ebone ? - ebone_iter->parent->temp.ebone : ED_armature_bone_get_mirrored(arm->edbo, ebone_iter->parent)); + ebone_iter->parent->temp.ebone : ED_armature_ebone_get_mirrored(arm->edbo, ebone_iter->parent)); if (ebone_parent == NULL) { /* If the mirror lookup failed, (but the current bone has a parent) @@ -759,7 +759,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op) } } - transform_armature_mirror_update(obedit); + ED_armature_edit_transform_mirror_update(obedit); /* Selected bones now have their 'temp' pointer set, * so we don't need this anymore */ @@ -786,7 +786,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op) postEditBoneDuplicate(arm->edbo, obedit); - ED_armature_validate_active(arm); + ED_armature_edit_validate_active(arm); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit); @@ -870,7 +870,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op) /* we re-use code for mirror editing... */ flipbone = NULL; if (arm->flag & ARM_MIRROR_EDIT) { - flipbone = ED_armature_bone_get_mirrored(arm->edbo, ebone); + flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone); if (flipbone) { forked = 0; // we extrude 2 different bones if (flipbone->flag & (BONE_TIPSEL | BONE_ROOTSEL | BONE_SELECTED)) @@ -944,7 +944,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op) else strcat(newbone->name, "_R"); } } - unique_editbone_name(arm->edbo, newbone->name, NULL); + ED_armature_ebone_unique_name(arm->edbo, newbone->name, NULL); /* Add the new bone to the list */ BLI_addtail(arm->edbo, newbone); @@ -974,7 +974,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op) } /* Transform the endpoints */ - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit); @@ -1027,10 +1027,10 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op) mul_m3_m3m3(totmat, obmat, viewmat); invert_m3_m3(imat, totmat); - ED_armature_deselect_all(obedit); + ED_armature_edit_deselect_all(obedit); /* Create a bone */ - bone = ED_armature_edit_bone_add(obedit->data, name); + bone = ED_armature_ebone_add(obedit->data, name); copy_v3_v3(bone->head, curs); @@ -1118,7 +1118,7 @@ static int armature_subdivide_exec(bContext *C, wmOperator *op) newbone->prop = NULL; - unique_editbone_name(arm->edbo, newbone->name, NULL); + ED_armature_ebone_unique_name(arm->edbo, newbone->name, NULL); /* correct parent bones */ for (tbone = arm->edbo->first; tbone; tbone = tbone->next) { diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index 9a4a0eecfcd..3879d67964c 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -66,7 +66,7 @@ /* ************************** Object Tools Exports ******************************* */ /* NOTE: these functions are exported to the Object module to be called from the tools there */ -void ED_armature_apply_transform(Object *ob, float mat[4][4], const bool do_props) +void ED_armature_transform_apply(Object *ob, float mat[4][4], const bool do_props) { bArmature *arm = ob->data; @@ -205,7 +205,7 @@ void ED_armature_origin_set(Scene *scene, Object *ob, float cursor[3], int cente /* adjust bone roll to align Z axis with vector * vec is in local space and is normalized */ -float ED_rollBoneToVector(EditBone *bone, const float align_axis[3], const bool axis_only) +float ED_armature_ebone_roll_to_vector(EditBone *bone, const float align_axis[3], const bool axis_only) { float mat[3][3], nor[3]; float vec[3], align_axis_proj[3], roll = 0.0f; @@ -331,7 +331,7 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op) sub_v3_v3v3(cursor_rel, cursor_local, ebone->head); if (axis_flip) negate_v3(cursor_rel); if (normalize_v3(cursor_rel) != 0.0f) { - ebone->roll = ED_rollBoneToVector(ebone, cursor_rel, axis_only); + ebone->roll = ED_armature_ebone_roll_to_vector(ebone, cursor_rel, axis_only); } } } @@ -370,13 +370,13 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op) if (axis_flip) negate_v3(vec); if (is_edit) { - ebone->roll = ED_rollBoneToVector(ebone, vec, axis_only); + ebone->roll = ED_armature_ebone_roll_to_vector(ebone, vec, axis_only); } /* parentless bones use cross product with child */ if (is_edit_parent) { if (ebone->parent->parent == NULL) { - ebone->parent->roll = ED_rollBoneToVector(ebone->parent, vec, axis_only); + ebone->parent->roll = ED_armature_ebone_roll_to_vector(ebone->parent, vec, axis_only); } } } @@ -420,7 +420,7 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op) for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { if (EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) { /* roll func is a callback which assumes that all is well */ - ebone->roll = ED_rollBoneToVector(ebone, vec, axis_only); + ebone->roll = ED_armature_ebone_roll_to_vector(ebone, vec, axis_only); } } } @@ -428,7 +428,7 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op) if (arm->flag & ARM_MIRROR_EDIT) { for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { if ((EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) == 0) { - EditBone *ebone_mirr = ED_armature_bone_get_mirrored(arm->edbo, ebone); + EditBone *ebone_mirr = ED_armature_ebone_get_mirrored(arm->edbo, ebone); if (ebone_mirr && (EBONE_VISIBLE(arm, ebone_mirr) && EBONE_EDITABLE(ebone_mirr))) { ebone->roll = -ebone_mirr->roll; } @@ -482,7 +482,7 @@ static int armature_roll_clear_exec(bContext *C, wmOperator *op) if (arm->flag & ARM_MIRROR_EDIT) { for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { if ((EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) == 0) { - EditBone *ebone_mirr = ED_armature_bone_get_mirrored(arm->edbo, ebone); + EditBone *ebone_mirr = ED_armature_ebone_get_mirrored(arm->edbo, ebone); if (ebone_mirr && (EBONE_VISIBLE(arm, ebone_mirr) && EBONE_EDITABLE(ebone_mirr))) { ebone->roll = -ebone_mirr->roll; } @@ -771,7 +771,7 @@ static int armature_fill_bones_exec(bContext *C, wmOperator *op) } if (newbone) { - ED_armature_deselect_all(obedit); + ED_armature_edit_deselect_all(obedit); arm->act_edbone = newbone; newbone->flag |= BONE_TIPSEL; } @@ -883,7 +883,7 @@ static void bones_merge(Object *obedit, EditBone *start, EditBone *end, EditBone } newbone->flag |= (BONE_ROOTSEL | BONE_TIPSEL | BONE_SELECTED); - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); } @@ -959,7 +959,7 @@ static int armature_merge_exec(bContext *C, wmOperator *op) } /* updates */ - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT | ND_POSE, obedit); return OPERATOR_FINISHED; @@ -1181,7 +1181,7 @@ static int armature_align_bones_exec(bContext *C, wmOperator *op) * - if there's no mirrored copy of actbone (i.e. actbone = "parent.C" or "parent") * then just use actbone. Useful when doing upper arm to spine. */ - actmirb = ED_armature_bone_get_mirrored(arm->edbo, actbone); + actmirb = ED_armature_ebone_get_mirrored(arm->edbo, actbone); if (actmirb == NULL) actmirb = actbone; } @@ -1293,7 +1293,7 @@ static bool armature_delete_ebone_cb(const char *bone_name, void *arm_p) bArmature *arm = arm_p; EditBone *ebone; - ebone = ED_armature_bone_find_name(arm->edbo, bone_name); + ebone = ED_armature_ebone_find_name(arm->edbo, bone_name); return (ebone && (ebone->flag & BONE_SELECTED) && (arm->layer & ebone->layer)); } @@ -1320,7 +1320,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op)) if (arm->layer & curBone->layer) { if (curBone->flag & BONE_SELECTED) { if (curBone == arm->act_edbone) arm->act_edbone = NULL; - ED_armature_edit_bone_remove(arm, curBone); + ED_armature_ebone_remove(arm, curBone); changed = true; } } @@ -1329,7 +1329,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op)) if (!changed) return OPERATOR_CANCELLED; - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); BKE_pose_tag_recalc(CTX_data_main(C), obedit->pose); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit); @@ -1358,7 +1358,7 @@ static bool armature_dissolve_ebone_cb(const char *bone_name, void *arm_p) bArmature *arm = arm_p; EditBone *ebone; - ebone = ED_armature_bone_find_name(arm->edbo, bone_name); + ebone = ED_armature_ebone_find_name(arm->edbo, bone_name); return (ebone && (ebone->flag & BONE_DONE)); } @@ -1460,7 +1460,7 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op)) ebone->parent->rad_tail = ebone->rad_tail; SET_FLAG_FROM_TEST(ebone->parent->flag, ebone->flag & BONE_TIPSEL, BONE_TIPSEL); - ED_armature_edit_bone_remove_ex(arm, ebone, false); + ED_armature_ebone_remove_ex(arm, ebone, false); changed = true; } } @@ -1493,7 +1493,7 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; } - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit); @@ -1538,8 +1538,8 @@ static int armature_hide_exec(bContext *C, wmOperator *op) } } } - ED_armature_validate_active(arm); - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_validate_active(arm); + ED_armature_edit_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit); @@ -1581,8 +1581,8 @@ static int armature_reveal_exec(bContext *C, wmOperator *op) } } } - ED_armature_validate_active(arm); - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_validate_active(arm); + ED_armature_edit_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit); diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c index 32635541a35..d5ed1380a7e 100644 --- a/source/blender/editors/armature/armature_naming.c +++ b/source/blender/editors/armature/armature_naming.c @@ -73,11 +73,11 @@ static bool editbone_unique_check(void *arg, const char *name) { struct {ListBase *lb; void *bone; } *data = arg; - EditBone *dupli = ED_armature_bone_find_name(data->lb, name); + EditBone *dupli = ED_armature_ebone_find_name(data->lb, name); return dupli && dupli != data->bone; } -void unique_editbone_name(ListBase *edbo, char *name, EditBone *bone) +void ED_armature_ebone_unique_name(ListBase *edbo, char *name, EditBone *bone) { struct {ListBase *lb; void *bone; } data; data.lb = edbo; @@ -152,10 +152,10 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n /* now check if we're in editmode, we need to find the unique name */ if (arm->edbo) { - EditBone *eBone = ED_armature_bone_find_name(arm->edbo, oldname); + EditBone *eBone = ED_armature_ebone_find_name(arm->edbo, oldname); if (eBone) { - unique_editbone_name(arm->edbo, newname, NULL); + ED_armature_ebone_unique_name(arm->edbo, newname, NULL); BLI_strncpy(eBone->name, newname, MAXBONENAME); } else { diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c index dfe7876175f..3c272d52d1c 100644 --- a/source/blender/editors/armature/armature_relations.c +++ b/source/blender/editors/armature/armature_relations.c @@ -309,10 +309,10 @@ int join_armature_exec(bContext *C, wmOperator *op) /* Copy bones and posechannels from the object to the edit armature */ for (pchan = opose->chanbase.first; pchan; pchan = pchann) { pchann = pchan->next; - curbone = ED_armature_bone_find_name(curarm->edbo, pchan->name); + curbone = ED_armature_ebone_find_name(curarm->edbo, pchan->name); /* Get new name */ - unique_editbone_name(arm->edbo, curbone->name, NULL); + ED_armature_ebone_unique_name(arm->edbo, curbone->name, NULL); BLI_ghash_insert(afd.names_map, BLI_strdup(pchan->name), curbone->name); /* Transform the bone */ @@ -525,7 +525,7 @@ static void separate_armature_bones(Object *ob, short sel) /* go through pose-channels, checking if a bone should be removed */ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchann) { pchann = pchan->next; - curbone = ED_armature_bone_find_name(arm->edbo, pchan->name); + curbone = ED_armature_ebone_find_name(arm->edbo, pchan->name); /* check if bone needs to be removed */ if ( (sel && (curbone->flag & BONE_SELECTED)) || @@ -632,7 +632,7 @@ static int separate_armature_exec(bContext *C, wmOperator *op) ED_armature_to_edit(obedit->data); /* parents tips remain selected when connected children are removed. */ - ED_armature_deselect_all(obedit); + ED_armature_edit_deselect_all(obedit); BKE_report(op->reports, RPT_INFO, "Separated bones"); @@ -752,7 +752,7 @@ static int armature_parent_set_exec(bContext *C, wmOperator *op) * - if there's no mirrored copy of actbone (i.e. actbone = "parent.C" or "parent") * then just use actbone. Useful when doing upper arm to spine. */ - actmirb = ED_armature_bone_get_mirrored(arm->edbo, actbone); + actmirb = ED_armature_ebone_get_mirrored(arm->edbo, actbone); if (actmirb == NULL) actmirb = actbone; } @@ -875,7 +875,7 @@ static int armature_parent_clear_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob); diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index 2e2c184e43d..d81e557dbfd 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -62,7 +62,7 @@ /* **************** PoseMode & EditMode Selection Buffer Queries *************************** */ /* only for opengl selection indices */ -Bone *get_indexed_bone(Object *ob, int index) +Bone *ED_armature_bone_find_index(Object *ob, int index) { bPoseChannel *pchan; if (ob->pose == NULL) return NULL; @@ -99,7 +99,7 @@ void *get_bone_from_selectbuffer( if (obedit == NULL || base->object != obedit) { /* no singular posemode, so check for correct object */ if (base->selcol == (hitresult & 0xFFFF)) { - bone = get_indexed_bone(base->object, hitresult); + bone = ED_armature_bone_find_index(base->object, hitresult); if (findunsel) sel = (bone->flag & BONE_SELECTED); @@ -244,7 +244,7 @@ static int armature_select_linked_invoke(bContext *C, wmOperator *op, const wmEv bone = NULL; } - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit); @@ -441,7 +441,7 @@ cache_end: return NULL; } -void ED_armature_deselect_all(Object *obedit) +void ED_armature_edit_deselect_all(Object *obedit) { bArmature *arm = obedit->data; EditBone *ebone; @@ -451,7 +451,7 @@ void ED_armature_deselect_all(Object *obedit) } } -void ED_armature_deselect_all_visible(Object *obedit) +void ED_armature_edit_deselect_all_visible(Object *obedit) { bArmature *arm = obedit->data; EditBone *ebone; @@ -463,7 +463,7 @@ void ED_armature_deselect_all_visible(Object *obedit) } } - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); } /* accounts for connected parents */ @@ -478,7 +478,7 @@ static int ebone_select_flag(EditBone *ebone) } /* context: editmode armature in view3d */ -bool ED_armature_select_pick(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle) +bool ED_armature_edit_select_pick(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle) { Object *obedit = CTX_data_edit_object(C); bArmature *arm = obedit->data; @@ -496,7 +496,7 @@ bool ED_armature_select_pick(bContext *C, const int mval[2], bool extend, bool d if (nearBone) { if (!extend && !deselect && !toggle) { - ED_armature_deselect_all(obedit); + ED_armature_edit_deselect_all(obedit); } /* by definition the non-root connected bones have no root point drawn, @@ -567,7 +567,7 @@ bool ED_armature_select_pick(bContext *C, const int mval[2], bool extend, bool d nearBone->flag |= selmask; } - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); if (nearBone) { /* then now check for active status */ @@ -711,7 +711,7 @@ static void armature_select_more_less(Object *ob, bool more) EditBone *ebone; /* XXX, eventually we shouldn't need this - campbell */ - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); /* count bones & store selection state */ for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { @@ -741,7 +741,7 @@ static void armature_select_more_less(Object *ob, bool more) ebone->temp.p = NULL; } - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); } static int armature_de_select_more_exec(bContext *C, wmOperator *UNUSED(op)) @@ -1146,7 +1146,7 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob); @@ -1202,7 +1202,7 @@ static int armature_select_mirror_exec(bContext *C, wmOperator *op) EditBone *ebone_mirror; int flag_new = extend ? EBONE_PREV_FLAG_GET(ebone) : 0; - if ((ebone_mirror = ED_armature_bone_get_mirrored(arm->edbo, ebone)) && + if ((ebone_mirror = ED_armature_ebone_get_mirrored(arm->edbo, ebone)) && (EBONE_VISIBLE(arm, ebone_mirror))) { const int flag_mirror = EBONE_PREV_FLAG_GET(ebone_mirror); @@ -1226,7 +1226,7 @@ static int armature_select_mirror_exec(bContext *C, wmOperator *op) arm->act_edbone = ebone_mirror_act; } - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit); @@ -1311,7 +1311,7 @@ static int armature_shortest_path_pick_invoke(bContext *C, wmOperator *op, const else if (ED_armature_ebone_is_child_recursive(ebone_dst, ebone_src)) { SWAP(EditBone *, ebone_src, ebone_dst); } - else if ((ebone_isect_parent = ED_armature_bone_find_shared_parent(ebone_isect_child, 2))) { + else if ((ebone_isect_parent = ED_armature_ebone_find_shared_parent(ebone_isect_child, 2))) { /* pass */ } else { @@ -1346,7 +1346,7 @@ static int armature_shortest_path_pick_invoke(bContext *C, wmOperator *op, const if (changed) { arm->act_edbone = ebone_dst; - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit); return OPERATOR_FINISHED; diff --git a/source/blender/editors/armature/armature_skinning.c b/source/blender/editors/armature/armature_skinning.c index e8d41f722d7..0458fc4ed1b 100644 --- a/source/blender/editors/armature/armature_skinning.c +++ b/source/blender/editors/armature/armature_skinning.c @@ -424,7 +424,7 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, MEM_freeN(verts); } -void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob, Object *par, +void ED_object_vgroup_calc_from_armature(ReportList *reports, Scene *scene, Object *ob, Object *par, const int mode, const bool mirror) { /* Lets try to create some vertex groups diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c index 03d1c5e3d4d..8867189baef 100644 --- a/source/blender/editors/armature/armature_utils.c +++ b/source/blender/editors/armature/armature_utils.c @@ -53,7 +53,7 @@ /* Validation */ /* Sync selection to parent for connected children */ -void ED_armature_sync_selection(ListBase *edbo) +void ED_armature_edit_sync_selection(ListBase *edbo) { EditBone *ebo; @@ -75,7 +75,7 @@ void ED_armature_sync_selection(ListBase *edbo) } } -void ED_armature_validate_active(struct bArmature *arm) +void ED_armature_edit_validate_active(struct bArmature *arm) { EditBone *ebone = arm->act_edbone; @@ -136,7 +136,7 @@ void bone_free(bArmature *arm, EditBone *bone) /** * \param clear_connected: When false caller is responsible for keeping the flag in a valid state. */ -void ED_armature_edit_bone_remove_ex(bArmature *arm, EditBone *exBone, bool clear_connected) +void ED_armature_ebone_remove_ex(bArmature *arm, EditBone *exBone, bool clear_connected) { EditBone *curBone; @@ -153,9 +153,9 @@ void ED_armature_edit_bone_remove_ex(bArmature *arm, EditBone *exBone, bool clea bone_free(arm, exBone); } -void ED_armature_edit_bone_remove(bArmature *arm, EditBone *exBone) +void ED_armature_ebone_remove(bArmature *arm, EditBone *exBone) { - ED_armature_edit_bone_remove_ex(arm, exBone, true); + ED_armature_ebone_remove_ex(arm, exBone, true); } bool ED_armature_ebone_is_child_recursive(EditBone *ebone_parent, EditBone *ebone_child) @@ -174,7 +174,7 @@ bool ED_armature_ebone_is_child_recursive(EditBone *ebone_parent, EditBone *ebon * \param ebone_child_tot Size of the ebone_child array * \return The shared parent or NULL. */ -EditBone *ED_armature_bone_find_shared_parent(EditBone *ebone_child[], const unsigned int ebone_child_tot) +EditBone *ED_armature_ebone_find_shared_parent(EditBone *ebone_child[], const unsigned int ebone_child_tot) { unsigned int i; EditBone *ebone_iter; @@ -254,7 +254,7 @@ void ED_armature_ebone_from_mat4(EditBone *ebone, float mat[4][4]) /** * Return a pointer to the bone of the given name */ -EditBone *ED_armature_bone_find_name(const ListBase *edbo, const char *name) +EditBone *ED_armature_ebone_find_name(const ListBase *edbo, const char *name) { return BLI_findstring(edbo, name, offsetof(EditBone, name)); } @@ -266,7 +266,7 @@ EditBone *ED_armature_bone_find_name(const ListBase *edbo, const char *name) /** * \see #BKE_pose_channel_get_mirrored (pose-mode, matching function) */ -EditBone *ED_armature_bone_get_mirrored(const ListBase *edbo, EditBone *ebo) +EditBone *ED_armature_ebone_get_mirrored(const ListBase *edbo, EditBone *ebo) { char name_flip[MAXBONENAME]; @@ -276,7 +276,7 @@ EditBone *ED_armature_bone_get_mirrored(const ListBase *edbo, EditBone *ebo) BLI_string_flip_side_name(name_flip, ebo->name, false, sizeof(name_flip)); if (!STREQ(name_flip, ebo->name)) { - return ED_armature_bone_find_name(edbo, name_flip); + return ED_armature_ebone_find_name(edbo, name_flip); } return NULL; @@ -296,7 +296,7 @@ void armature_select_mirrored_ex(bArmature *arm, const int flag) for (curBone = arm->edbo->first; curBone; curBone = curBone->next) { if (arm->layer & curBone->layer) { if (curBone->flag & flag) { - ebone_mirr = ED_armature_bone_get_mirrored(arm->edbo, curBone); + ebone_mirr = ED_armature_ebone_get_mirrored(arm->edbo, curBone); if (ebone_mirr) ebone_mirr->flag |= (curBone->flag & flag); } @@ -325,7 +325,7 @@ void armature_tag_select_mirrored(bArmature *arm) for (curBone = arm->edbo->first; curBone; curBone = curBone->next) { if (arm->layer & curBone->layer) { if (curBone->flag & (BONE_SELECTED | BONE_ROOTSEL | BONE_TIPSEL)) { - EditBone *ebone_mirr = ED_armature_bone_get_mirrored(arm->edbo, curBone); + EditBone *ebone_mirr = ED_armature_ebone_get_mirrored(arm->edbo, curBone); if (ebone_mirr && (ebone_mirr->flag & BONE_SELECTED) == 0) { ebone_mirr->flag |= BONE_DONE; } @@ -335,7 +335,7 @@ void armature_tag_select_mirrored(bArmature *arm) for (curBone = arm->edbo->first; curBone; curBone = curBone->next) { if (curBone->flag & BONE_DONE) { - EditBone *ebone_mirr = ED_armature_bone_get_mirrored(arm->edbo, curBone); + EditBone *ebone_mirr = ED_armature_ebone_get_mirrored(arm->edbo, curBone); curBone->flag |= ebone_mirr->flag & (BONE_SELECTED | BONE_ROOTSEL | BONE_TIPSEL); } } @@ -358,7 +358,7 @@ void armature_tag_unselect(bArmature *arm) /* if editbone (partial) selected, copy data */ /* context; editmode armature, with mirror editing enabled */ -void transform_armature_mirror_update(Object *obedit) +void ED_armature_edit_transform_mirror_update(Object *obedit) { bArmature *arm = obedit->data; EditBone *ebo, *eboflip; @@ -366,7 +366,7 @@ void transform_armature_mirror_update(Object *obedit) for (ebo = arm->edbo->first; ebo; ebo = ebo->next) { /* no layer check, correct mirror is more important */ if (ebo->flag & (BONE_TIPSEL | BONE_ROOTSEL)) { - eboflip = ED_armature_bone_get_mirrored(arm->edbo, ebo); + eboflip = ED_armature_ebone_get_mirrored(arm->edbo, ebo); if (eboflip) { /* we assume X-axis flipping for now */ @@ -436,7 +436,7 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone eBone = MEM_callocN(sizeof(EditBone), "make_editbone"); /* Copy relevant data from bone to eBone - * Keep selection logic in sync with ED_armature_sync_selection. + * Keep selection logic in sync with ED_armature_edit_sync_selection. */ eBone->parent = parent; BLI_strncpy(eBone->name, curBone->name, sizeof(eBone->name)); diff --git a/source/blender/editors/armature/editarmature_generate.c b/source/blender/editors/armature/editarmature_generate.c index 4eb9e3ecc79..57843265496 100644 --- a/source/blender/editors/armature/editarmature_generate.c +++ b/source/blender/editors/armature/editarmature_generate.c @@ -39,7 +39,7 @@ void setBoneRollFromNormal(EditBone *bone, const float no[3], float UNUSED(invma copy_v3_v3(normal, no); mul_m3_v3(tmat, normal); - bone->roll = ED_rollBoneToVector(bone, normal, false); + bone->roll = ED_armature_ebone_roll_to_vector(bone, normal, false); } } @@ -252,7 +252,7 @@ EditBone *subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *U IT_head(iter); - parent = ED_armature_edit_bone_add(arm, "Bone"); + parent = ED_armature_ebone_add(arm, "Bone"); copy_v3_v3(parent->head, iter->p); if (iter->size > FLT_EPSILON) { @@ -265,7 +265,7 @@ EditBone *subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *U while (index != -1) { IT_peek(iter, index); - child = ED_armature_edit_bone_add(arm, "Bone"); + child = ED_armature_ebone_add(arm, "Bone"); copy_v3_v3(child->head, parent->tail); child->parent = parent; child->flag |= BONE_CONNECTED; diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index 3dd41f25e09..bf6126658af 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -158,11 +158,11 @@ static float rollBoneByQuatAligned(EditBone *bone, float old_up_axis[3], float q if (angle_normalized_v3v3(x_axis, new_up_axis) < angle_normalized_v3v3(z_axis, new_up_axis)) { rotation_between_vecs_to_quat(qroll, new_up_axis, x_axis); /* set roll rotation quat */ - return ED_rollBoneToVector(bone, x_axis, false); + return ED_armature_ebone_roll_to_vector(bone, x_axis, false); } else { rotation_between_vecs_to_quat(qroll, new_up_axis, z_axis); /* set roll rotation quat */ - return ED_rollBoneToVector(bone, z_axis, false); + return ED_armature_ebone_roll_to_vector(bone, z_axis, false); } } @@ -207,7 +207,7 @@ static float rollBoneByQuatJoint(RigEdge *edge, RigEdge *previous, float qrot[4] /* real qroll between normal and up_axis */ rotation_between_vecs_to_quat(qroll, new_up_axis, normal); - return ED_rollBoneToVector(edge->bone, normal, false); + return ED_armature_ebone_roll_to_vector(edge->bone, normal, false); } } @@ -218,7 +218,7 @@ float rollBoneByQuat(EditBone *bone, float old_up_axis[3], float qrot[4]) copy_v3_v3(new_up_axis, old_up_axis); mul_qt_v3(qrot, new_up_axis); - return ED_rollBoneToVector(bone, new_up_axis, false); + return ED_armature_ebone_roll_to_vector(bone, new_up_axis, false); } /************************************ DESTRUCTORS ******************************************************/ @@ -424,7 +424,7 @@ static void renameTemplateBone(char *name, char *template_name, ListBase *editbo name[j] = '\0'; - unique_editbone_name(editbones, name, NULL); + ED_armature_ebone_unique_name(editbones, name, NULL); } static RigControl *cloneControl(RigGraph *rg, RigGraph *src_rg, RigControl *src_ctrl, GHash *ptr_hash, char *side_string, char *num_string) @@ -1435,7 +1435,7 @@ static EditBone *add_editbonetolist(char *name, ListBase *list) EditBone *bone = MEM_callocN(sizeof(EditBone), "eBone"); BLI_strncpy(bone->name, name, sizeof(bone->name)); - unique_editbone_name(list, bone->name, NULL); + ED_armature_ebone_unique_name(list, bone->name, NULL); BLI_addtail(list, bone); @@ -2626,7 +2626,7 @@ void BIF_retargetArc(bContext *C, ReebArc *earc, RigGraph *template_rigg) } RIG_freeRigGraph((BGraph *)rigg); - ED_armature_validate_active(armedit); + ED_armature_edit_validate_active(armedit); // XXX // allqueue(REDRAWVIEW3D, 0); diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 79b538b4f4a..a08898a37f6 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -1334,7 +1334,7 @@ static void sk_convertStroke(bContext *C, SK_Stroke *stk) } if (bone == NULL) { - bone = ED_armature_edit_bone_add(arm, "Bone"); + bone = ED_armature_ebone_add(arm, "Bone"); copy_v3_v3(bone->head, head->p); copy_v3_v3(bone->tail, pt->p); diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 9500fd59b8b..3c0bb4fe609 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -1633,7 +1633,7 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa free_bvhtree_from_mesh(&mdb->bvhdata); } -void mesh_deform_bind( +void ED_mesh_deform_bind_callback( Scene *scene, MeshDeformModifierData *mmd, DerivedMesh *cagedm, float *vertexcos, int totvert, float cagemat[4][4]) { diff --git a/source/blender/editors/armature/meshlaplacian.h b/source/blender/editors/armature/meshlaplacian.h index bba8c739abf..202ac8e9b70 100644 --- a/source/blender/editors/armature/meshlaplacian.h +++ b/source/blender/editors/armature/meshlaplacian.h @@ -67,7 +67,7 @@ void rigid_deform_end(int cancel); /* Harmonic Coordinates */ -/* mesh_deform_bind(...) defined in ED_armature.h */ +/* ED_mesh_deform_bind_callback(...) defined in ED_armature.h */ #endif diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c index 281f0428d19..4b62fd15c04 100644 --- a/source/blender/editors/armature/pose_select.c +++ b/source/blender/editors/armature/pose_select.c @@ -132,7 +132,7 @@ void ED_pose_bone_select(Object *ob, bPoseChannel *pchan, bool select) /* called from editview.c, for mode-less pose selection */ /* assumes scene obact and basact is still on old situation */ -bool ED_do_pose_selectbuffer( +bool ED_armature_pose_select_pick_with_buffer( Scene *scene, Base *base, const unsigned int *buffer, short hits, bool extend, bool deselect, bool toggle, bool do_nearest) { @@ -163,7 +163,7 @@ bool ED_do_pose_selectbuffer( } if (!extend && !deselect && !toggle) { - ED_pose_de_selectall(ob, SEL_DESELECT, true); + ED_pose_deselect_all(ob, SEL_DESELECT, true); nearBone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); arm->act_bone = nearBone; } @@ -217,7 +217,7 @@ bool ED_do_pose_selectbuffer( /* 'select_mode' is usual SEL_SELECT/SEL_DESELECT/SEL_TOGGLE/SEL_INVERT. * When true, 'ignore_visibility' makes this func also affect invisible bones (hidden or on hidden layers). */ -void ED_pose_de_selectall(Object *ob, int select_mode, const bool ignore_visibility) +void ED_pose_deselect_all(Object *ob, int select_mode, const bool ignore_visibility) { bArmature *arm = ob->data; bPoseChannel *pchan; diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c index a44accd1cea..446bab00b70 100644 --- a/source/blender/editors/armature/pose_transform.c +++ b/source/blender/editors/armature/pose_transform.c @@ -121,7 +121,7 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op) pose = ob->pose; for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) { - curbone = ED_armature_bone_find_name(arm->edbo, pchan->name); + curbone = ED_armature_ebone_find_name(arm->edbo, pchan->name); /* simply copy the head/tail values from pchan over to curbone */ copy_v3_v3(curbone->head, pchan->pose_head); diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index ae54dd802ee..fbaa65211e6 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -130,29 +130,30 @@ void ED_armature_from_edit(struct bArmature *arm); void ED_armature_to_edit(struct bArmature *arm); void ED_armature_edit_free(struct bArmature *arm); -void ED_armature_deselect_all(struct Object *obedit); -void ED_armature_deselect_all_visible(struct Object *obedit); +void ED_armature_edit_deselect_all(struct Object *obedit); +void ED_armature_edit_deselect_all_visible(struct Object *obedit); -bool ED_do_pose_selectbuffer( +bool ED_armature_pose_select_pick_with_buffer( struct Scene *scene, struct Base *base, const unsigned int *buffer, short hits, bool extend, bool deselect, bool toggle, bool do_nearest); -bool ED_armature_select_pick(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); +bool ED_armature_edit_select_pick( + struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); int join_armature_exec(struct bContext *C, struct wmOperator *op); -struct Bone *get_indexed_bone(struct Object *ob, int index); -float ED_rollBoneToVector(EditBone *bone, const float new_up_axis[3], const bool axis_only); -EditBone *ED_armature_bone_find_name(const struct ListBase *edbo, const char *name); -EditBone *ED_armature_bone_get_mirrored(const struct ListBase *edbo, EditBone *ebo); -void ED_armature_sync_selection(struct ListBase *edbo); -void ED_armature_validate_active(struct bArmature *arm); +struct Bone *ED_armature_bone_find_index(struct Object *ob, int index); +float ED_armature_ebone_roll_to_vector(EditBone *bone, const float new_up_axis[3], const bool axis_only); +EditBone *ED_armature_ebone_find_name(const struct ListBase *edbo, const char *name); +EditBone *ED_armature_ebone_get_mirrored(const struct ListBase *edbo, EditBone *ebo); +void ED_armature_edit_sync_selection(struct ListBase *edbo); +void ED_armature_edit_validate_active(struct bArmature *arm); -EditBone *ED_armature_edit_bone_add_primitive(struct Object *obedit_arm, float length, bool view_aligned); -EditBone *ED_armature_edit_bone_add(struct bArmature *arm, const char *name); +EditBone *ED_armature_ebone_add_primitive(struct Object *obedit_arm, float length, bool view_aligned); +EditBone *ED_armature_ebone_add(struct bArmature *arm, const char *name); -void ED_armature_edit_bone_remove_ex(struct bArmature *arm, EditBone *exBone, bool clear_connected); -void ED_armature_edit_bone_remove(struct bArmature *arm, EditBone *exBone); +void ED_armature_ebone_remove_ex(struct bArmature *arm, EditBone *exBone, bool clear_connected); +void ED_armature_ebone_remove(struct bArmature *arm, EditBone *exBone); bool ED_armature_ebone_is_child_recursive(EditBone *ebone_parent, EditBone *ebone_child); -EditBone *ED_armature_bone_find_shared_parent(EditBone *ebone_child[], const unsigned int ebone_child_tot); +EditBone *ED_armature_ebone_find_shared_parent(EditBone *ebone_child[], const unsigned int ebone_child_tot); void ED_armature_ebone_to_mat3(EditBone *ebone, float mat[3][3]); void ED_armature_ebone_to_mat4(EditBone *ebone, float mat[4][4]); @@ -160,22 +161,22 @@ void ED_armature_ebone_to_mat4(EditBone *ebone, float mat[4][4]); void ED_armature_ebone_from_mat3(EditBone *ebone, float mat[3][3]); void ED_armature_ebone_from_mat4(EditBone *ebone, float mat[4][4]); -void transform_armature_mirror_update(struct Object *obedit); +void ED_armature_edit_transform_mirror_update(struct Object *obedit); void ED_armature_origin_set(struct Scene *scene, struct Object *ob, float cursor[3], int centermode, int around); void ED_armature_transform_bones(struct bArmature *arm, float mat[4][4], const bool do_props); -void ED_armature_apply_transform(struct Object *ob, float mat[4][4], const bool do_props); +void ED_armature_transform_apply(struct Object *ob, float mat[4][4], const bool do_props); void ED_armature_transform(struct bArmature *arm, float mat[4][4], const bool do_props); #define ARM_GROUPS_NAME 1 #define ARM_GROUPS_ENVELOPE 2 #define ARM_GROUPS_AUTO 3 -void create_vgroups_from_armature(struct ReportList *reports, struct Scene *scene, struct Object *ob, +void ED_object_vgroup_calc_from_armature(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct Object *par, const int mode, const bool mirror); /* if bone is already in list, pass it as param to ignore it */ -void unique_editbone_name(struct ListBase *ebones, char *name, EditBone *bone); +void ED_armature_ebone_unique_name(struct ListBase *ebones, char *name, EditBone *bone); void ED_armature_bone_rename(struct bArmature *arm, const char *oldnamep, const char *newnamep); void ED_armature_bones_flip_names(struct bArmature *arm, struct ListBase *bones_names, const bool do_strip_numbers); @@ -199,7 +200,7 @@ bool ED_object_posemode_exit_ex(struct Object *ob); bool ED_object_posemode_exit(struct bContext *C, struct Object *ob); bool ED_object_posemode_enter_ex(struct Object *ob); bool ED_object_posemode_enter(struct bContext *C, struct Object *ob); -void ED_pose_de_selectall(struct Object *ob, int select_mode, const bool ignore_visibility); +void ED_pose_deselect_all(struct Object *ob, int select_mode, const bool ignore_visibility); void ED_pose_bone_select(struct Object *ob, struct bPoseChannel *pchan, bool select); void ED_pose_recalculate_paths(struct Scene *scene, struct Object *ob); struct Object *ED_pose_object_from_context(struct bContext *C); @@ -225,7 +226,7 @@ void BDR_drawSketch(const struct bContext *vc); int BDR_drawSketchNames(struct ViewContext *vc); /* meshlaplacian.c */ -void mesh_deform_bind(struct Scene *scene, +void ED_mesh_deform_bind_callback(struct Scene *scene, struct MeshDeformModifierData *mmd, struct DerivedMesh *cagedm, float *vertexcos, int totvert, float cagemat[4][4]); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index c6820c83f95..461b71a8a05 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -753,7 +753,7 @@ static int object_armature_add_exec(bContext *C, wmOperator *op) } dia = RNA_float_get(op->ptr, "radius"); - ED_armature_edit_bone_add_primitive(obedit, dia, view_aligned); + ED_armature_ebone_add_primitive(obedit, dia, view_aligned); /* userdef */ if (newob && !enter_editmode) diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 81883725f64..bf99d1c52ac 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1660,7 +1660,7 @@ static void skin_armature_bone_create(Object *skin_ob, v = (e->v1 == parent_v ? e->v2 : e->v1); - bone = ED_armature_edit_bone_add(arm, "Bone"); + bone = ED_armature_ebone_add(arm, "Bone"); bone->parent = parent_bone; bone->flag |= BONE_CONNECTED; @@ -1733,7 +1733,7 @@ static Object *modifier_skin_armature_create(Main *bmain, Scene *scene, Object * * a fake root bone (have it going off in the Y direction * (arbitrary) */ if (emap[v].count > 1) { - bone = ED_armature_edit_bone_add(arm, "Bone"); + bone = ED_armature_ebone_add(arm, "Bone"); copy_v3_v3(bone->head, me->mvert[v].co); copy_v3_v3(bone->tail, me->mvert[v].co); @@ -1934,7 +1934,7 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op) int mode = mmd->modifier.mode; /* force modifier to run, it will call binding routine */ - mmd->bindfunc = mesh_deform_bind; + mmd->bindfunc = ED_mesh_deform_bind_callback; mmd->modifier.mode |= eModifierMode_Realtime; if (ob->type == OB_MESH) { diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 83d67cea2f0..4618d05133e 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -773,12 +773,12 @@ bool ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object } else if (pararm && (ob->type == OB_MESH) && (par->type == OB_ARMATURE)) { if (partype == PAR_ARMATURE_NAME) - create_vgroups_from_armature(reports, scene, ob, par, ARM_GROUPS_NAME, false); + ED_object_vgroup_calc_from_armature(reports, scene, ob, par, ARM_GROUPS_NAME, false); else if (partype == PAR_ARMATURE_ENVELOPE) - create_vgroups_from_armature(reports, scene, ob, par, ARM_GROUPS_ENVELOPE, xmirror); + ED_object_vgroup_calc_from_armature(reports, scene, ob, par, ARM_GROUPS_ENVELOPE, xmirror); else if (partype == PAR_ARMATURE_AUTO) { WM_cursor_wait(1); - create_vgroups_from_armature(reports, scene, ob, par, ARM_GROUPS_AUTO, xmirror); + ED_object_vgroup_calc_from_armature(reports, scene, ob, par, ARM_GROUPS_AUTO, xmirror); WM_cursor_wait(0); } /* get corrected inverse */ diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 9fea7bf5b89..05f98026e18 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -534,7 +534,7 @@ static int apply_objects_internal( BKE_mesh_calc_normals(me); } else if (ob->type == OB_ARMATURE) { - ED_armature_apply_transform(ob, mat, do_props); + ED_armature_transform_apply(ob, mat, do_props); } else if (ob->type == OB_LATTICE) { Lattice *lt = ob->data; diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 1190423e2f1..e714e095ef9 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -217,7 +217,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult * bones will be operated on twice. */ if (arm->flag & ARM_MIRROR_EDIT) - flipbone = ED_armature_bone_get_mirrored(arm->edbo, ebone); + flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone); /* if we're filtering for editable too, use the check for that instead, as it has selection check too */ if (editable_bones) { @@ -259,7 +259,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult * bones will be operated on twice. */ if (arm->flag & ARM_MIRROR_EDIT) - flipbone = ED_armature_bone_get_mirrored(arm->edbo, ebone); + flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone); /* if we're filtering for editable too, use the check for that instead, as it has selection check too */ if (selected_editable_bones) { diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c index 21435ef153a..957cb6a7389 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c @@ -130,7 +130,7 @@ static int weight_from_bones_exec(bContext *C, wmOperator *op) Mesh *me = ob->data; int type = RNA_enum_get(op->ptr, "type"); - create_vgroups_from_armature(op->reports, scene, ob, armob, type, (me->editflag & ME_EDIT_MIRROR_X)); + ED_object_vgroup_calc_from_armature(op->reports, scene, ob, armob, type, (me->editflag & ME_EDIT_MIRROR_X)); DAG_id_tag_update(&me->id, 0); WM_event_add_notifier(C, NC_GEOM | ND_DATA, me); diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 27c96bd0232..0b8724b4e28 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -622,7 +622,7 @@ static eOLDrawState tree_element_active_ebone( if (set != OL_SETSEL_NONE) { if (set == OL_SETSEL_NORMAL) { if (!(ebone->flag & BONE_HIDDEN_A)) { - ED_armature_deselect_all(scene->obedit); + ED_armature_edit_deselect_all(scene->obedit); tree_element_active_ebone__sel(C, scene, arm, ebone, true); status = OL_DRAWSEL_NORMAL; } diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index a52d4a1a69f..22ca3beae0a 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -681,14 +681,14 @@ static void do_lasso_select_armature(ViewContext *vc, const int mcords[][2], sho ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); if (extend == false && select) - ED_armature_deselect_all_visible(vc->obedit); + ED_armature_edit_deselect_all_visible(vc->obedit); armature_foreachScreenBone(vc, do_lasso_select_armature__doSelectBone, &data, V3D_PROJ_TEST_CLIP_DEFAULT); if (data.is_changed) { bArmature *arm = vc->obedit->data; - ED_armature_sync_selection(arm->edbo); - ED_armature_validate_active(arm); + ED_armature_edit_sync_selection(arm->edbo); + ED_armature_edit_validate_active(arm); WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, vc->obedit); } } @@ -1514,7 +1514,9 @@ static bool ed_object_select_pick( } } } - else if (ED_do_pose_selectbuffer(scene, basact, buffer, hits, extend, deselect, toggle, do_nearest)) { + else if (ED_armature_pose_select_pick_with_buffer( + scene, basact, buffer, hits, extend, deselect, toggle, do_nearest)) + { /* then bone is found */ /* we make the armature selected: @@ -1925,7 +1927,7 @@ static int do_armature_box_select(ViewContext *vc, rcti *rect, bool select, bool ebone->flag &= ~BONE_DONE; if (extend == false && select) - ED_armature_deselect_all_visible(vc->obedit); + ED_armature_edit_deselect_all_visible(vc->obedit); /* first we only check points inside the border */ for (a = 0; a < hits; a++) { @@ -1977,7 +1979,7 @@ static int do_armature_box_select(ViewContext *vc, rcti *rect, bool select, bool } } - ED_armature_sync_selection(arm->edbo); + ED_armature_edit_sync_selection(arm->edbo); return hits > 0 ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } @@ -2036,7 +2038,7 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, b if (BASE_SELECTABLE(vc->v3d, base)) { while (base->selcol == (*col & 0xFFFF)) { /* we got an object */ if (*col & 0xFFFF0000) { /* we got a bone */ - bone = get_indexed_bone(base->object, *col & ~(BONESEL_ANY)); + bone = ED_armature_bone_find_index(base->object, *col & ~(BONESEL_ANY)); if (bone) { if (select) { if ((bone->flag & BONE_UNSELECTABLE) == 0) { @@ -2273,7 +2275,7 @@ static int view3d_select_exec(bContext *C, wmOperator *op) if (obedit->type == OB_MESH) retval = EDBM_select_pick(C, location, extend, deselect, toggle); else if (obedit->type == OB_ARMATURE) - retval = ED_armature_select_pick(C, location, extend, deselect, toggle); + retval = ED_armature_edit_select_pick(C, location, extend, deselect, toggle); else if (obedit->type == OB_LATTICE) retval = ED_lattice_select_pick(C, location, extend, deselect, toggle); else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) @@ -2715,8 +2717,8 @@ static void armature_circle_select(ViewContext *vc, const bool select, const int armature_foreachScreenBone(vc, do_circle_select_armature__doSelectBone, &data, V3D_PROJ_TEST_CLIP_DEFAULT); if (data.is_changed) { - ED_armature_sync_selection(arm->edbo); - ED_armature_validate_active(arm); + ED_armature_edit_sync_selection(arm->edbo); + ED_armature_edit_validate_active(arm); WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, vc->obedit); } } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index adcd3a29bd0..60092a28e36 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1200,7 +1200,7 @@ static void createTransArmatureVerts(TransInfo *t) } if (mirror && (oldtot < t->total)) { - eboflip = ED_armature_bone_get_mirrored(arm->edbo, ebo); + eboflip = ED_armature_ebone_get_mirrored(arm->edbo, ebo); if (eboflip) total_mirrored++; } @@ -1370,7 +1370,7 @@ static void createTransArmatureVerts(TransInfo *t) } if (mirror && (td_old != td)) { - eboflip = ED_armature_bone_get_mirrored(arm->edbo, ebo); + eboflip = ED_armature_ebone_get_mirrored(arm->edbo, ebo); if (eboflip) { bid[i].bone = eboflip; bid[i].dist = eboflip->dist; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 92f596c5063..8b35b2e598d 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -847,7 +847,7 @@ static void recalcData_objects(TransInfo *t) mul_qt_v3(qrot, up_axis); /* roll has a tendency to flip in certain orientations - [#34283], [#33974] */ - roll = ED_rollBoneToVector(ebo, up_axis, false); + roll = ED_armature_ebone_roll_to_vector(ebo, up_axis, false); ebo->roll = angle_compat_rad(roll, td->ival); } } @@ -856,7 +856,7 @@ static void recalcData_objects(TransInfo *t) if (arm->flag & ARM_MIRROR_EDIT) { if (t->state != TRANS_CANCEL) - transform_armature_mirror_update(t->obedit); + ED_armature_edit_transform_mirror_update(t->obedit); else restoreBones(t); } diff --git a/source/blender/editors/util/ed_transverts.c b/source/blender/editors/util/ed_transverts.c index b0970cdfd48..c3fb653979c 100644 --- a/source/blender/editors/util/ed_transverts.c +++ b/source/blender/editors/util/ed_transverts.c @@ -153,7 +153,7 @@ void ED_transverts_update_obedit(TransVertStore *tvs, Object *obedit) } } if (arm->flag & ARM_MIRROR_EDIT) - transform_armature_mirror_update(obedit); + ED_armature_edit_transform_mirror_update(obedit); } else if (obedit->type == OB_LATTICE) { Lattice *lt = obedit->data; diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index a707bef8845..7feca708fe8 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -107,7 +107,7 @@ static EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in edit mode, cannot add an editbone", arm->id.name + 2); return NULL; } - return ED_armature_edit_bone_add(arm, name); + return ED_armature_ebone_add(arm, name); } static void rna_Armature_edit_bone_remove(bArmature *arm, ReportList *reports, PointerRNA *ebone_ptr) @@ -123,7 +123,7 @@ static void rna_Armature_edit_bone_remove(bArmature *arm, ReportList *reports, P return; } - ED_armature_edit_bone_remove(arm, ebone); + ED_armature_ebone_remove(arm, ebone); RNA_POINTER_INVALIDATE(ebone_ptr); } @@ -426,7 +426,7 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po copy_v3_v3(child->head, ebone->tail); if (arm->flag & ARM_MIRROR_EDIT) { - eboflip = ED_armature_bone_get_mirrored(arm->edbo, ebone); + eboflip = ED_armature_ebone_get_mirrored(arm->edbo, ebone); if (eboflip) { eboflip->roll = -ebone->roll; diff --git a/source/blender/makesrna/intern/rna_armature_api.c b/source/blender/makesrna/intern/rna_armature_api.c index 0616331bc05..222baf99afd 100644 --- a/source/blender/makesrna/intern/rna_armature_api.c +++ b/source/blender/makesrna/intern/rna_armature_api.c @@ -46,7 +46,7 @@ static void rna_EditBone_align_roll(EditBone *ebo, float no[3]) { - ebo->roll = ED_rollBoneToVector(ebo, no, false); + ebo->roll = ED_armature_ebone_roll_to_vector(ebo, no, false); } static float rna_Bone_do_envelope(Bone *bone, float *vec) diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 211006e997a..14fc2366232 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -358,7 +358,7 @@ struct wmTimer *WM_event_add_timer(struct wmWindowManager *wm, struct wmWindow * void WM_event_remove_timer(struct wmWindowManager *wm, struct wmWindow *win, struct wmTimer *timer) RET_NONE float WM_event_tablet_data(const struct wmEvent *event, int *pen_flip, float tilt[2]) RET_ZERO bool WM_event_is_tablet(const struct wmEvent *event) RET_ZERO -void ED_armature_edit_bone_remove(struct bArmature *arm, struct EditBone *exBone) RET_NONE +void ED_armature_ebone_remove(struct bArmature *arm, struct EditBone *exBone) RET_NONE void object_test_constraints(struct Object *owner) RET_NONE void ED_armature_ebone_to_mat4(struct EditBone *ebone, float mat[4][4]) RET_NONE void ED_armature_ebone_from_mat4(EditBone *ebone, float mat[4][4]) RET_NONE @@ -375,8 +375,8 @@ bool UI_view2d_view_to_region_clip(struct View2D *v2d, float x, float y, int *re void UI_view2d_view_to_region(struct View2D *v2d, float x, float y, int *regionx, int *region_y) RET_NONE void UI_view2d_sync(struct bScreen *screen, struct ScrArea *sa, struct View2D *v2dcur, int flag) RET_NONE -struct EditBone *ED_armature_bone_get_mirrored(const struct ListBase *edbo, EditBone *ebo) RET_NULL -struct EditBone *ED_armature_edit_bone_add(struct bArmature *arm, const char *name) RET_NULL +struct EditBone *ED_armature_ebone_get_mirrored(const struct ListBase *edbo, EditBone *ebo) RET_NULL +struct EditBone *ED_armature_ebone_add(struct bArmature *arm, const char *name) RET_NULL struct ListBase *get_active_constraints (struct Object *ob) RET_NULL struct ListBase *get_constraint_lb(struct Object *ob, struct bConstraint *con, struct bPoseChannel **r_pchan) RET_NULL @@ -530,7 +530,7 @@ float ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vert int ED_mesh_mirror_topo_table(struct Object *ob, struct DerivedMesh *dm, char mode) RET_ZERO int ED_mesh_mirror_spatial_table(struct Object *ob, struct BMEditMesh *em, struct DerivedMesh *dm, const float co[3], char mode) RET_ZERO -float ED_rollBoneToVector(EditBone *bone, const float new_up_axis[3], const bool axis_only) RET_ZERO +float ED_armature_ebone_roll_to_vector(EditBone *bone, const float new_up_axis[3], const bool axis_only) RET_ZERO void ED_space_image_get_size(struct SpaceImage *sima, int *width, int *height) RET_NONE bool ED_space_image_check_show_maskedit(struct Scene *scene, struct SpaceImage *sima) RET_ZERO |