Fix rotation tool issue

This commit is contained in:
JannisX11 2021-12-11 13:20:44 +01:00
parent 59a4fe1836
commit 5f5d1574e5
2 changed files with 4 additions and 4 deletions

View File

@ -693,14 +693,14 @@
if (scope.elements.length == 0) return; if (scope.elements.length == 0) return;
if (object) { if (object) {
worldRotation.setFromRotationMatrix( tempMatrix.extractRotation( object.matrixWorld ) ); if (!this.dragging) worldRotation.setFromRotationMatrix( tempMatrix.extractRotation( object.matrixWorld ) );
if (Toolbox.selected.transformerMode === 'rotate') { if (Toolbox.selected.transformerMode === 'rotate') {
_gizmo[ _mode ].update( worldRotation, eye ); _gizmo[ _mode ].update( worldRotation, eye );
this.rotation.set(0, 0, 0); this.rotation.set(0, 0, 0);
} else { } else {
object.getWorldQuaternion(this.rotation) object.getWorldQuaternion(this.rotation)
} }
if (this.rotation_selection) { if (this.rotation_selection.x || this.rotation_selection.y || this.rotation_selection.z) {
let q = Reusable.quat1.setFromEuler(this.rotation_selection); let q = Reusable.quat1.setFromEuler(this.rotation_selection);
this.quaternion.multiply(q); this.quaternion.multiply(q);
worldRotation.setFromQuaternion(this.quaternion); worldRotation.setFromQuaternion(this.quaternion);

View File

@ -1733,8 +1733,8 @@ Interface.definePanels(function() {
let elements = UVEditor.getMappableElements(); let elements = UVEditor.getMappableElements();
if (elements.length) { if (elements.length) {
for (let element of elements) { for (let element of elements) {
let face = element.faces[this.selected_faces[0] || Object.keys(element.faces)[0]]; let face = element.faces[ this.selected_faces[0] || Object.keys(element.faces)[0] ];
texture = face.getTexture() || texture; if (face) texture = face.getTexture() || texture;
if (texture) break; if (texture) break;
} }
} }