From db44717935989f86ff547485760b6edda0233149 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Wed, 14 Oct 2015 13:30:42 -1000 Subject: [PATCH] Transform import positions using 3x3 matrix to skip tuple resize --- src/mcedit2/editortools/clone.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mcedit2/editortools/clone.py b/src/mcedit2/editortools/clone.py index f0b04d4..8c7d2c3 100644 --- a/src/mcedit2/editortools/clone.py +++ b/src/mcedit2/editortools/clone.py @@ -236,7 +236,7 @@ class CloneTool(EditorTool): rotations = baseRotations matrix = transform.rotationMatrix((0, 0, 0), *rotations) - matrix = numpy.linalg.inv(matrix) + matrix = numpy.linalg.inv(matrix)[:3, :3] if offsetPoint is None: offsetPoint = self.mainPendingClone.basePosition @@ -250,9 +250,8 @@ class CloneTool(EditorTool): rotations = [a+b for a,b in zip(rotations, baseRotations)] if rotateOffsets: # Convert to 4-element column and back - offset = tuple(offset) + (0, ) - offset = offset * matrix - offset = tuple(offset.T)[:3] + offset = (offset * matrix).T + offset = tuple(float(x) for x in offset) @property def mainPendingClone(self):