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-28 02:01:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-28 02:15:02 +0300
commit6491d50d02b7c93b4955fe05dae62930f3a76ce1 (patch)
tree31b1513e33760b716a16366266dbd4e7f37bdc32 /source/blender/editors/transform/transform_generics.c
parent437d7d7cb9df3132d2e935f2b500f8669c17c4cc (diff)
Transform: default to user-defined orientation
Previously we tried this but reverted (see 64d40c82c324) because there wasn't a predictable set of keys to use global-space. Now the keys are swapped: - 'GX' always transforms in the user defined orientation. - 'GXX' always transforms in global space. As before 'GXXX' cycles back to disabling constraints. This does have a down side that GXX won't be used for local-space when the user has global space set. Also, when global is the user-orientation, pressing GX and GXX does the same thing. Note: examples here use GX but could be any transform-mode/axis.
Diffstat (limited to 'source/blender/editors/transform/transform_generics.c')
-rw-r--r--source/blender/editors/transform/transform_generics.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 65c8c50e746..9f739765d9c 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1395,10 +1395,17 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
t->around = V3D_AROUND_CURSOR;
}
- t->current_orientation = t->scene->orientation_type;
- t->custom_orientation = BKE_scene_transform_orientation_find(
+ t->orientation.user = t->scene->orientation_type;
+ 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,
+ V3D_MANIP_GLOBAL, /* Value isn't used (first index is no constraint). */
+ t->orientation.user,
+ V3D_MANIP_GLOBAL);
+
/* exceptional case */
if (t->around == V3D_AROUND_LOCAL_ORIGINS) {
if (ELEM(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL)) {
@@ -1489,8 +1496,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
RNA_property_is_set(op->ptr, prop)))
{
RNA_property_float_get_array(op->ptr, prop, &t->spacemtx[0][0]);
- t->current_orientation = V3D_MANIP_CUSTOM_MATRIX;
- t->custom_orientation = 0;
+ t->orientation.user = V3D_MANIP_CUSTOM_MATRIX;
+ t->orientation.custom = 0;
}
else if (op && ((prop = RNA_struct_find_property(op->ptr, "constraint_orientation")) &&
RNA_property_is_set(op->ptr, prop)))
@@ -1509,8 +1516,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
}
}
- t->current_orientation = orientation;
- t->custom_orientation = custom_orientation;
+ t->orientation.user = orientation;
+ t->orientation.custom = custom_orientation;
}
if (op && ((prop = RNA_struct_find_property(op->ptr, "release_confirm")) &&