Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-11-29 04:49:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-29 04:49:02 +0300
commit535984a848865c07a39610b32a53432d1a078c59 (patch)
tree7c25d24b5b12c8d7b23de475d39a3d469f000d33 /source/blender/editors/transform/transform_generics.c
parent27cccaeccd219e08c6947c3789ed8498f12f7878 (diff)
Cleanup: simplify transform orientation cycling
Remove dummy first index, store a pointer to the user orientation instead of having it store twice (which could get out of sync).
Diffstat (limited to 'source/blender/editors/transform/transform_generics.c')
-rw-r--r--source/blender/editors/transform/transform_generics.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index ba5b81ae641..ff3d52d7ddb 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1399,6 +1399,13 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
t->orientation.custom = BKE_scene_transform_orientation_find(
t->scene, t->scene->orientation_index_custom);
+ t->orientation.index = 0;
+ ARRAY_SET_ITEMS(
+ t->orientation.types,
+ &t->orientation.user,
+ /* V3D_MANIP_GLOBAL */
+ NULL);
+
/* exceptional case */
if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
if (ELEM(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL)) {
@@ -1513,13 +1520,6 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
t->orientation.custom = custom_orientation;
}
- t->orientation.index = 0;
- ARRAY_SET_ITEMS(
- t->orientation.types,
- V3D_MANIP_GLOBAL, /* Value isn't used (first index is no constraint). */
- t->orientation.user,
- V3D_MANIP_GLOBAL);
-
if (op && ((prop = RNA_struct_find_property(op->ptr, "release_confirm")) &&
RNA_property_is_set(op->ptr, prop)))
{