diff --git a/js/io/io.js b/js/io/io.js index a966f51d..9d72b13e 100644 --- a/js/io/io.js +++ b/js/io/io.js @@ -307,7 +307,6 @@ function uploadSketchfabModel() { title: tl('message.sketchfab.success'), message: `[${formResult.name} on Sketchfab](https://sketchfab.com/models/${response.uid})`, //\n\n \n\n`+ - //tl('message.sketchfab.setup_guide', '[Sketchfab Setup and Common Issues](https://blockbench.net/2020/01/22/sketchfab-setup-and-common-issues/)'), icon: 'icon-sketchfab', }) }, diff --git a/js/preview/transformer.js b/js/preview/transformer.js index 45a46950..3c52f839 100644 --- a/js/preview/transformer.js +++ b/js/preview/transformer.js @@ -1400,7 +1400,23 @@ scope.keyframes[0].offset('x', Math.trimDeg( (-Math.radToDeg(e.x - mesh.fix_rotation.x)) - scope.keyframes[0].calc('x') )); scope.keyframes[0].offset('y', Math.trimDeg( (-Math.radToDeg(e.y - mesh.fix_rotation.y)) - scope.keyframes[0].calc('y') )); scope.keyframes[0].offset('z', Math.trimDeg( ( Math.radToDeg(e.z - mesh.fix_rotation.z)) - scope.keyframes[0].calc('z') )); + + /* + } else if (Toolbox.selected.id === 'rotate_tool' && Transformer.getTransformSpace() == 2) { + if (axisNumber != 2) difference *= -1; + + let old_order = mesh.rotation.order; + mesh.rotation.reorder(axisNumber == 0 ? 'ZYX' : (axis == 1 ? 'ZXY' : 'XYZ')) + var obj_val = Math.trimDeg(Math.radToDeg(mesh.rotation[axis]) + difference); + mesh.rotation[axis] = Math.degToRad(obj_val); + mesh.rotation.reorder(old_order); + + scope.keyframes[0].offset('x', Math.trimDeg( (-Math.radToDeg(mesh.rotation.x - mesh.fix_rotation.x)) - scope.keyframes[0].calc('x') )); + scope.keyframes[0].offset('y', Math.trimDeg( (-Math.radToDeg(mesh.rotation.y - mesh.fix_rotation.y)) - scope.keyframes[0].calc('y') )); + scope.keyframes[0].offset('z', Math.trimDeg( ( Math.radToDeg(mesh.rotation.z - mesh.fix_rotation.z)) - scope.keyframes[0].calc('z') )); + */ + } else if (Toolbox.selected.id === 'move_tool' && BarItems.transform_space.value === 'global') { let offset_vec = new THREE.Vector3(); diff --git a/js/transform.js b/js/transform.js index 65a652fb..1d7aede5 100644 --- a/js/transform.js +++ b/js/transform.js @@ -755,7 +755,7 @@ function rotateOnAxis(modify, axis, slider) { } } - if (slider || space == 2) { + if (slider || (space == 2 && Format.rotation_limit)) { var obj_val = modify(obj.rotation[axis]); obj_val = Math.trimDeg(obj_val) if (Format.rotation_limit) { @@ -779,6 +779,18 @@ function rotateOnAxis(modify, axis, slider) { if (obj instanceof Cube) { obj.rotation_axis = axis_letter } + } else if (space == 2) { + + let old_order = mesh.rotation.order; + mesh.rotation.reorder(axis == 0 ? 'ZYX' : (axis == 1 ? 'ZXY' : 'XYZ')) + var obj_val = modify(Math.radToDeg(mesh.rotation[axis_letter])); + obj_val = Math.trimDeg(obj_val) + mesh.rotation[axis_letter] = Math.degToRad(obj_val); + mesh.rotation.reorder(old_order); + + obj.rotation[0] = Math.radToDeg(mesh.rotation.x); + obj.rotation[1] = Math.radToDeg(mesh.rotation.y); + obj.rotation[2] = Math.radToDeg(mesh.rotation.z); } else if (space instanceof Group) { let normal = axis == 0 ? THREE.NormalX : (axis == 1 ? THREE.NormalY : THREE.NormalZ) diff --git a/js/web.js b/js/web.js index daeca21b..408ac82f 100644 --- a/js/web.js +++ b/js/web.js @@ -21,21 +21,7 @@ function loadInfoFromURL() { EditSession.dialog() $('#edit_session_token').val(location.hash.substr(9)) } - if (location.hash.substr(1, 5) == 'load=') { - $.getJSON('https://blockbench.net/api/rawtext.php?url='+location.hash.substr(6), (model) => { - if (showSaveDialog()) { - resetProject(); - Codecs.project.load(model, {path: ''}); - } - }) - } else if (location.hash.substr(1, 5) == 'pbin=') { - $.getJSON('https://blockbench.net/api/rawtext.php?url='+'https://pastebin.com/raw/'+location.hash.substr(6), (model) => { - if (showSaveDialog()) { - resetProject(); - Codecs.project.load(model, {path: ''}); - } - }) - } else if (location.hash.substr(1, 2) == 'm=') { + if (location.hash.substr(1, 2) == 'm=') { $.getJSON(`https://blckbn.ch/api/models/${location.hash.substr(3)}`, (model) => { if (showSaveDialog()) { resetProject();