This commit is contained in:
2026-09-29 14:23:43 +02:00
parent b61142f9bd
commit f7c0c38ec2
2 changed files with 25 additions and 1 deletions
+4
View File
@@ -594,6 +594,7 @@
}
function scaleCubeUvs(cube, x, y) {
if (typeof Format === 'undefined' || Format?.id !== 'geckolib_model') return;
if (x === 1 && y === 1) return;
if (cube.box_uv) {
if (typeof cube.setUVMode !== 'function') throw new Error('Box UV conversion is unavailable in this Blockbench version.');
@@ -611,6 +612,7 @@
}
function expandProjectUvs(width, height) {
if (typeof Format === 'undefined' || Format?.id !== 'geckolib_model') return false;
const oldWidth = validUvDimension(Project.texture_width), oldHeight = validUvDimension(Project.texture_height);
const nextWidth = Math.max(oldWidth, width), nextHeight = Math.max(oldHeight, height);
if (nextWidth === oldWidth && nextHeight === oldHeight) return false;
@@ -623,6 +625,7 @@
}
function normalizeCubeUvs(cube, actorIndex, width, height, original = null) {
if (typeof Format === 'undefined' || Format?.id !== 'geckolib_model') return false;
width = validUvDimension(width); height = validUvDimension(height);
const all = getActorUvBasis(), actor = all[actorIndex];
const key = cube.uuid || cube.name;
@@ -641,6 +644,7 @@
}
function normalizeActorUvs(actorIndex, width, height, original = null) {
if (typeof Format === 'undefined' || Format?.id !== 'geckolib_model') return false;
let changed = false;
for (const cube of Cube.all) {
if (cubeBelongsToActor(cube, actorIndex)) changed = normalizeCubeUvs(cube, actorIndex, width, height, original) || changed;