Skip to content

Commit

Permalink
Texture Stitcher: stitching of textures of varied resolutions
Browse files Browse the repository at this point in the history
  • Loading branch information
mchorse committed Mar 12, 2024
1 parent f6cf173 commit 288fc3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
"icon": "fa-compress-arrows-alt",
"author": "McHorse",
"description": "Adds a menu item to textures editor that stitches multiple textures into one",
"version": "1.0.2",
"version": "1.0.3",
"variant": "both"
},
"arcaniax_block_exporter": {
Expand Down
18 changes: 9 additions & 9 deletions plugins/texture_stitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@

if (rect != null)
{
cube.uv_offset[0] += rect.x / mx;
cube.uv_offset[1] += rect.y / my;
cube.uv_offset[0] += rect.x / rect.mx;
cube.uv_offset[1] += rect.y / rect.my;
}

toApplySides = north.texture !== false;
Expand All @@ -205,10 +205,10 @@

if (rect !== null)
{
face.uv[0] = face.uv[0] * mx + rect.x;
face.uv[1] = face.uv[1] * my + rect.y;
face.uv[2] = face.uv[2] * mx + rect.x;
face.uv[3] = face.uv[3] * my + rect.y;
face.uv[0] = face.uv[0] * rect.mx + rect.x;
face.uv[1] = face.uv[1] * rect.my + rect.y;
face.uv[2] = face.uv[2] * rect.mx + rect.x;
face.uv[3] = face.uv[3] * rect.my + rect.y;

if (face.texture !== false)
{
Expand Down Expand Up @@ -244,8 +244,8 @@
{
var uv = face.uv[key];

uv[0] = uv[0] * mx + rect.x;
uv[1] = uv[1] * my + rect.y;
uv[0] = uv[0] * rect.mx + rect.x;
uv[1] = uv[1] * rect.my + rect.y;

applied = true;
});
Expand Down Expand Up @@ -274,7 +274,7 @@
author: 'McHorse',
description: 'Adds a menu item to textures editor that stitches multiple textures into one',
icon: 'fa-compress-arrows-alt',
version: '1.0.2',
version: '1.0.3',
variant: 'both',
onload()
{
Expand Down

0 comments on commit 288fc3f

Please sign in to comment.