Fix #2132 issue with UV preview

This commit is contained in:
JannisX11 2023-12-03 20:36:57 +01:00
parent 3d5f11e88b
commit 81e36dfc2e
3 changed files with 3 additions and 3 deletions

View File

@ -683,13 +683,13 @@ function updateProjectResolution() {
UVEditor.vue.uv_resolution.replace([Project.texture_width, Project.texture_height]);
UVEditor.vue.updateSize()
}
Canvas.uvHelperMaterial.uniforms.DENSITY.value = Project.texture_width / 32;
if (Texture.selected) {
// Update animated textures
Texture.selected.height++;
Texture.selected.height--;
}
}
Canvas.uvHelperMaterial.uniforms.DENSITY.value = Project.texture_width / 32;
Blockbench.dispatchEvent('update_project_resolution', {project: Project});
}

View File

@ -1183,7 +1183,7 @@ new NodePreviewController(Cube, {
let vertex_uvs = mesh.geometry.attributes.uv;
let pw = Project.texture_width;
let ph = Project.texture_height;
if (tex && Format.per_texture_uv_size) {
if (tex && Format.per_texture_uv_size && Project.view_mode !== 'uv') {
pw = tex.getUVWidth();
ph = tex.getUVHeight();
}

View File

@ -1112,7 +1112,7 @@ new NodePreviewController(Mesh, {
stretch = tex.frameCount
frame = tex.currentFrame || 0;
}
let uv_size = tex
let uv_size = (tex && Project.view_mode !== 'uv')
? [tex.getUVWidth(), tex.getUVHeight()]
: [Project.texture_width, Project.texture_height];