diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-05-30 17:28:53 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-05-30 17:28:53 +0300 |
commit | 55598269d243e1a04b1c7f861b67b2a06f819157 (patch) | |
tree | 3bb1f219703f06aa5149dc8296418c2b4c5d76d2 /source/blender/editors/transform/transform_orientations.c | |
parent | a574478d901aef5c22b9f3a4f8ac69e4b87411b8 (diff) |
Cleanup: Deduplicate code
Diffstat (limited to 'source/blender/editors/transform/transform_orientations.c')
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 32269e1bacc..ebef0e149d9 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -545,37 +545,7 @@ const char *transform_orientations_spacename_get(TransInfo *t, const short orien void transform_orientations_current_set(TransInfo *t, const short orient_index) { const short orientation = t->orient[orient_index].type; - const char *spacename; - switch (orientation) { - case V3D_ORIENT_GLOBAL: - spacename = TIP_("global"); - break; - case V3D_ORIENT_GIMBAL: - spacename = TIP_("gimbal"); - break; - case V3D_ORIENT_NORMAL: - spacename = TIP_("normal"); - break; - case V3D_ORIENT_LOCAL: - spacename = TIP_("local"); - break; - case V3D_ORIENT_VIEW: - spacename = TIP_("view"); - break; - case V3D_ORIENT_CURSOR: - spacename = TIP_("cursor"); - break; - case V3D_ORIENT_CUSTOM_MATRIX: - spacename = TIP_("custom"); - break; - case V3D_ORIENT_CUSTOM: - default: - BLI_assert(orientation >= V3D_ORIENT_CUSTOM); - TransformOrientation *ts = BKE_scene_transform_orientation_find( - t->scene, orientation - V3D_ORIENT_CUSTOM); - spacename = ts->name; - break; - } + const char *spacename = transform_orientations_spacename_get(t, orientation); BLI_strncpy(t->spacename, spacename, sizeof(t->spacename)); copy_m3_m3(t->spacemtx, t->orient[orient_index].matrix); |