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-09-25 01:16:41 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-09-25 16:24:05 +0300
commit388b9162469650c7b0523c2fb9c88bbe2dee1567 (patch)
tree0aedf3c08117091d6092b3a630deb5e0df22b34e /source/blender/editors/transform/transform.c
parentd5a6b3b18c5d6c751b6b0091453d836313dbcde1 (diff)
Fix T80937: Changing the contrain axis does not return to the scene orientation
This was the behavior in old versions of blender. During a transformation operation, when pressing a contrain key, the chosen orientation is that of the scene. If you press the same key, the orientation changes to Global or Local. However, if you choose another contrain axis with the orientation changed, the orientation does not return to the set for the scene. It remains Global or Local. Now when changing a contrain axis, no matter what the current orientation is, it always returns to the scene orientation.
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r--source/blender/editors/transform/transform.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index bc08cb91c0d..ab24bbb35d4 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -755,27 +755,22 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, bool is
stopConstraint(t);
}
else {
- setUserConstraint(t, V3D_ORIENT_GLOBAL, constraint_axis, msg1);
+ setUserConstraint(t, constraint_axis, msg1);
}
}
else if (!edit_2d) {
+ short orient_index = 1;
if (t->orient_curr == 0 || ELEM(cmode, '\0', axis)) {
/* Successive presses on existing axis, cycle orientation modes. */
- t->orient_curr = (short)((t->orient_curr + 1) % (int)ARRAY_SIZE(t->orient));
- transform_orientations_current_set(t, t->orient_curr);
+ orient_index = (short)((t->orient_curr + 1) % (int)ARRAY_SIZE(t->orient));
}
- if (t->orient_curr == 0) {
+ transform_orientations_current_set(t, orient_index);
+ if (orient_index == 0) {
stopConstraint(t);
}
else {
- const short orientation = t->orient[t->orient_curr].type;
- if (is_plane == false) {
- setUserConstraint(t, orientation, constraint_axis, msg2);
- }
- else {
- setUserConstraint(t, orientation, constraint_plane, msg3);
- }
+ setUserConstraint(t, constraint_axis, is_plane ? msg3 : msg2);
}
}
t->redraw |= TREDRAW_HARD;
@@ -1717,10 +1712,6 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
initTransInfo(C, t, op, event);
- /* Use the custom orientation when it is set. */
- short orient_index = t->orient[0].type == V3D_ORIENT_CUSTOM_MATRIX ? 0 : t->orient_curr;
- transform_orientations_current_set(t, orient_index);
-
if (t->spacetype == SPACE_VIEW3D) {
t->draw_handle_apply = ED_region_draw_cb_activate(
t->region->type, drawTransformApply, t, REGION_DRAW_PRE_VIEW);
@@ -1868,7 +1859,7 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
/* Constraint init from operator */
if (t->con.mode & CON_APPLY) {
- setUserConstraint(t, t->orient[t->orient_curr].type, t->con.mode, "%s");
+ setUserConstraint(t, t->con.mode, "%s");
}
/* Don't write into the values when non-modal because they are already set from operator redo