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:
authorGermano Cavalcante <germano.costa@ig.com.br>2020-05-01 23:40:54 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-05-01 23:41:06 +0300
commit06839379c5d4f541a80c4d0f4487d8eb2c6fbba0 (patch)
tree7c1c04fef3a8011ed58a866c1eebca6f60ecd687 /source/blender/editors/transform/transform.c
parent87602d886f70a38a20e5738709dd971744a27516 (diff)
Transform: Allow orientation change with custom matrix in modal
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r--source/blender/editors/transform/transform.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 9ce98611b40..f3306caa931 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -828,7 +828,7 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, bool is
if (ELEM(cmode, '\0', axis)) {
/* Successive presses on existing axis, cycle orientation modes. */
t->orientation.index = (t->orientation.index + 1) % ARRAY_SIZE(t->orientation.types);
- initTransformOrientation(t->context, t);
+ initTransformOrientation(t->context, t, t->orientation.types[t->orientation.index]);
}
if (t->orientation.index == 0) {
@@ -1893,7 +1893,13 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
unit_m3(t->spacemtx);
initTransInfo(C, t, op, event);
- initTransformOrientation(C, t);
+
+ /* Use the custom orientation when it is set. */
+ short orientation = t->orientation.types[0] == V3D_ORIENT_CUSTOM_MATRIX ?
+ V3D_ORIENT_CUSTOM_MATRIX :
+ t->orientation.types[t->orientation.index];
+
+ initTransformOrientation(C, t, orientation);
if (t->spacetype == SPACE_VIEW3D) {
t->draw_handle_apply = ED_region_draw_cb_activate(