diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-08-23 04:53:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-08-23 05:03:11 +0300 |
commit | 232049dd9408e15d2082181e60ddd775b375ff19 (patch) | |
tree | 445988faa416644cfb0d210d864fb908e69d4f77 /source/blender/editors/armature/armature_edit.c | |
parent | 30582c59ccd00fc5c3221540c078947d25fc1bfd (diff) |
Armature: use BKE_armature_transform when applying transformation
Keep ED_armature_transform for RNA Armature.transform
since it operates on edit-bones in edit-mode.
Rename ED_armature_transform_bones to ED_armature_edit_transform
since it wasn't obviously an edit-mode function.
Diffstat (limited to 'source/blender/editors/armature/armature_edit.c')
-rw-r--r-- | source/blender/editors/armature/armature_edit.c | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index 4e6661b1d15..c4c10549da3 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -62,22 +62,10 @@ /* ************************** Object Tools Exports ******************************* */ /* NOTE: these functions are exported to the Object module to be called from the tools there */ -void ED_armature_transform_apply(Main *bmain, Object *ob, float mat[4][4], const bool do_props) -{ - bArmature *arm = ob->data; - - /* Put the armature into editmode */ - ED_armature_to_edit(arm); - - /* Transform the bones */ - ED_armature_transform_bones(arm, mat, do_props); - - /* Turn the list into an armature */ - ED_armature_from_edit(bmain, arm); - ED_armature_edit_free(arm); -} - -void ED_armature_transform_bones(struct bArmature *arm, float mat[4][4], const bool do_props) +/** + * See #BKE_armature_transform for object-mode transform. + */ +void ED_armature_edit_transform(bArmature *arm, const float mat[4][4], const bool do_props) { EditBone *ebone; float scale = mat4_to_scale(mat); /* store the scale of the matrix here to use on envelopes */ @@ -114,21 +102,13 @@ void ED_armature_transform_bones(struct bArmature *arm, float mat[4][4], const b } } -void ED_armature_transform(Main *bmain, bArmature *arm, float mat[4][4], const bool do_props) +void ED_armature_transform(bArmature *arm, const float mat[4][4], const bool do_props) { if (arm->edbo) { - ED_armature_transform_bones(arm, mat, do_props); + ED_armature_edit_transform(arm, mat, do_props); } else { - /* Put the armature into editmode */ - ED_armature_to_edit(arm); - - /* Transform the bones */ - ED_armature_transform_bones(arm, mat, do_props); - - /* Go back to object mode*/ - ED_armature_from_edit(bmain, arm); - ED_armature_edit_free(arm); + BKE_armature_transform(arm, mat, do_props); } } |