[Bf-blender-cvs] [8d590e4b862] master: Fix T83801: UVEditor translation ignores "Pixel Coordinates" and aspect ratio

Philipp Oeser noreply at git.blender.org
Wed Dec 16 15:05:53 CET 2020


Commit: 8d590e4b86287be22567d1adf8c6a7946bc7f63d
Author: Philipp Oeser
Date:   Wed Dec 16 10:14:58 2020 +0100
Branches: master
https://developer.blender.org/rB8d590e4b86287be22567d1adf8c6a7946bc7f63d

Fix T83801: UVEditor translation ignores "Pixel Coordinates" and aspect
ratio

Caused by rB4eda60c2d82d.

T83801 reported not moving in pixel space, but even without that toggle
above commit caused the translation to not take apsect ratio into
account properly [a translation of 1 on the x axis for example on an
image with non 1:1 aspect ration caused the UVs to not end up in the
same place on the next 'tile']

Above commit removed 'removeAspectRatio()' [the counterpart of
applyAspectRatio -- which does the pixel coord correction internally]
from 'applyTranslation()'.

This was also reported in T83352 [which was closed by rBf3b08af24c9f --
but that only solved the displax in header, not the actual
transformation]

Now bring back 'removeAspectRatio()'.

Maniphest Tasks: T83801

Differential Revision: https://developer.blender.org/D9869

===================================================================

M	source/blender/editors/transform/transform_mode_translate.c

===================================================================

diff --git a/source/blender/editors/transform/transform_mode_translate.c b/source/blender/editors/transform/transform_mode_translate.c
index 90c1f241338..8597c372537 100644
--- a/source/blender/editors/transform/transform_mode_translate.c
+++ b/source/blender/editors/transform/transform_mode_translate.c
@@ -377,6 +377,9 @@ static void applyTranslation(TransInfo *t, const int UNUSED(mval[2]))
     else {
       mul_v3_m3v3(global_dir, t->spacemtx, global_dir);
     }
+    if (t->flag & T_2D_EDIT) {
+      removeAspectRatio(t, global_dir);
+    }
   }
   else {
     copy_v3_v3(global_dir, t->values);



More information about the Bf-blender-cvs mailing list