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_constraints.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_constraints.c')
-rw-r--r--source/blender/editors/transform/transform_constraints.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index 805411ffc20..27ece728276 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -686,9 +686,15 @@ void setLocalConstraint(TransInfo *t, int mode, const char text[])
* ftext is a format string passed to BLI_snprintf. It will add the name of
* the orientation where %s is (logically).
*/
-void setUserConstraint(TransInfo *t, short orientation, int mode, const char ftext[])
+void setUserConstraint(TransInfo *t, int mode, const char ftext[])
{
char text[256];
+ short orientation = t->orient[t->orient_curr].type;
+ if (orientation == V3D_ORIENT_CUSTOM_MATRIX) {
+ /* Use the real value of the "orient_type". */
+ orientation = t->orient[0].type;
+ }
+
const char *spacename = transform_orientations_spacename_get(t, orientation);
BLI_snprintf(text, sizeof(text), ftext, spacename);
@@ -943,12 +949,10 @@ void stopConstraint(TransInfo *t)
void initSelectConstraint(TransInfo *t)
{
if (t->orient_curr == 0) {
- t->orient_curr = 1;
- transform_orientations_current_set(t, t->orient_curr);
+ transform_orientations_current_set(t, 1);
}
- short orientation = t->orient[t->orient_curr].type;
- setUserConstraint(t, orientation, CON_APPLY | CON_SELECT, "%s");
+ setUserConstraint(t, CON_APPLY | CON_SELECT, "%s");
setNearestAxis(t);
}