diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-04-01 17:19:31 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-04-01 17:20:32 +0300 |
commit | 6ec463a4b754bf69baf94ba6b3683655f6834ccd (patch) | |
tree | 01e760a04eaf8260ce24d21d083388abf5f50668 /source/blender/blenkernel | |
parent | 952c4e41bb4dae0d1b4a36a316f6cf67c054afe0 (diff) |
Cleanup/Refactor: Transform Orientation: Use 'orient_index' instead 'orient_type'
`orient_index` is a more comprehensive value as it reveals both the type and index.
Differential Revision: https://developer.blender.org/D9595
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_scene.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index b2726885593..66edb00e83c 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -140,6 +140,8 @@ struct TransformOrientationSlot *BKE_scene_orientation_slot_get(struct Scene *sc void BKE_scene_orientation_slot_set_index(struct TransformOrientationSlot *orient_slot, int orientation); int BKE_scene_orientation_slot_get_index(const struct TransformOrientationSlot *orient_slot); +int BKE_scene_orientation_get_index(struct Scene *scene, int slot_index); +int BKE_scene_orientation_get_index_from_flag(struct Scene *scene, int flag); /* ** Scene evaluation ** */ diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index de3e1023b08..e0ff0b0268a 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -2517,6 +2517,18 @@ int BKE_scene_orientation_slot_get_index(const TransformOrientationSlot *orient_ orient_slot->type; } +int BKE_scene_orientation_get_index(Scene *scene, int slot_index) +{ + TransformOrientationSlot *orient_slot = BKE_scene_orientation_slot_get(scene, slot_index); + return BKE_scene_orientation_slot_get_index(orient_slot); +} + +int BKE_scene_orientation_get_index_from_flag(Scene *scene, int flag) +{ + TransformOrientationSlot *orient_slot = BKE_scene_orientation_slot_get_from_flag(scene, flag); + return BKE_scene_orientation_slot_get_index(orient_slot); +} + /** \} */ static bool check_rendered_viewport_visible(Main *bmain) |