Fix #1146 glTF does not save node names

Fix texture generator rounding numbers incorrectly on high resolutions
Fix #1140 cannot pan UV editor while using copy-paste tool
This commit is contained in:
JannisX11 2021-11-09 16:39:07 +01:00
parent 860c4fcfd8
commit 04b4acde2d
4 changed files with 11 additions and 3 deletions

View File

@ -486,7 +486,7 @@ new Property(Group, 'number', 'color');
new NodePreviewController(Group, {
setup(group) {
bone = new THREE.Object3D();
bone.name = group.name;
bone.name = group.uuid;
bone.isGroup = true;
Project.nodes_3d[group.uuid] = bone;
},

View File

@ -943,8 +943,8 @@ const TextureGenerator = {
var pos = {
x: ftemp.posx,
y: ftemp.posy,
w: Math.ceil(ftemp.width),
h: Math.ceil(ftemp.height)
w: Math.ceil(ftemp.width * res_multiple) / res_multiple,
h: Math.ceil(ftemp.height * res_multiple) / res_multiple
}
var d = TextureGenerator.face_data[ftemp.face_key];
var flip_rotation = false;

View File

@ -281,6 +281,7 @@ const UVEditor = {
UVEditor.updatePastingOverlay()
function clickElsewhere(event) {
if (event.button == 1) return;
if (!Painter.selection.overlay) {
removeEventListeners(document, 'mousedown touchstart', clickElsewhere)
} else if (Painter.selection.overlay.has(event.target).length == 0) {
@ -1772,6 +1773,7 @@ Interface.definePanels(function() {
viewport.scrollTop += ((viewport.scrollTop + offsetY) * zoom_diff) / old_zoom
this.updateMouseCoords(event)
if (Painter.selection.canvas) UVEditor.updatePastingOverlay()
return false;
}

View File

@ -1903,6 +1903,12 @@ GLTFExporter.prototype = {
}
if (OutlinerNode.uuids[object.name]) {
gltfNode.name = String( OutlinerNode.uuids[object.name].name );
}
serializeUserData( object, gltfNode );
if ( object.isMesh || object.isLine || object.isPoints ) {