mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-02-11 16:12:06 +08:00
Per texture UV workflow improvements
This commit is contained in:
parent
08d86dfd79
commit
75ba67c84c
@ -161,6 +161,10 @@ const TextureGenerator = {
|
||||
let texture = cb(canvas.toDataURL());
|
||||
texture.uv_width = width;
|
||||
texture.uv_height = height;
|
||||
if (Format.per_texture_uv_size) {
|
||||
Project.texture_width = width;
|
||||
Project.texture_height = height;
|
||||
}
|
||||
return texture;
|
||||
},
|
||||
//constructors
|
||||
@ -1719,10 +1723,10 @@ const TextureGenerator = {
|
||||
changeUVResolution(width, height, texture) {
|
||||
let factor_x = width / Project.getUVWidth(texture);
|
||||
let factor_y = height / Project.getUVHeight(texture);
|
||||
if (!Format.per_texture_uv_size) {
|
||||
Project.texture_width = width;
|
||||
Project.texture_height = height;
|
||||
}
|
||||
|
||||
Project.texture_width = width;
|
||||
Project.texture_height = height;
|
||||
|
||||
if (texture) {
|
||||
texture.uv_width = width;
|
||||
texture.uv_height = height;
|
||||
|
@ -1279,8 +1279,10 @@ class Texture {
|
||||
} else if (Format.single_texture || Texture.all.length == 1 || Format.per_texture_uv_size) {
|
||||
|
||||
if (Format.per_texture_uv_size) {
|
||||
scope.uv_width = Project.texture_width * (formResult.size[0] / old_width);
|
||||
scope.uv_height = Project.texture_height * (formResult.size[1] / old_height);
|
||||
scope.uv_width = scope.uv_width * (formResult.size[0] / old_width);
|
||||
scope.uv_height = scope.uv_height * (formResult.size[1] / old_height);
|
||||
Project.texture_width = scope.uv_width;
|
||||
Project.texture_height = scope.uv_height;
|
||||
} else {
|
||||
Undo.current_save.uv_mode = {
|
||||
box_uv: Project.box_uv,
|
||||
|
Loading…
Reference in New Issue
Block a user