Skip to content

Commit

Permalink
Merge pull request #657 from mchorse/master
Browse files Browse the repository at this point in the history
BBS exporter: Use applied texture's size for UVs
  • Loading branch information
JannisX11 authored Dec 19, 2024
2 parents 3702a79 + 8d4cc6a commit 72116b8
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@
"icon": "icon.png",
"author": "McHorse",
"description": "Adds actions to export/import models in BBS format, which is used by BBS machinima studio.",
"version": "1.2.3",
"version": "1.2.4",
"variant": "both",
"tags": ["Exporter", "Importer"],
"min_version": "4.8.0",
Expand Down
45 changes: 43 additions & 2 deletions plugins/bbs_exporter/bbs_exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,57 @@

function compile()
{
function findTextureSize()
{
var c = Cube.all;
var keys = Object.keys(sides);

for (var i = 0; i < c.length; i++)
{
var cube = c[i];

for (var j = 0; j < keys.length; j++)
{
var face = cube.faces[keys[j]];

if (face)
{
var textureUuid = face.texture;

for (var k = 0; k < Texture.all.length; k++)
{
var texture = Texture.all[k];

if (texture && texture.uuid == textureUuid)
{
return [texture.width, texture.height];
}
}
}
}
}

return null;
}

var output = {
version: "0.7.2",
animations: {}
};

if (lastOptions.model)
{
var texture = [Project.texture_width, Project.texture_height];
var textureSize = findTextureSize();

if (textureSize)
{
texture = textureSize;
}

output.model = {
groups: createHierarchy(Outliner.root),
texture: [Project.texture_width, Project.texture_height]
texture: texture
};
}

Expand Down Expand Up @@ -609,7 +650,7 @@
author: "McHorse",
description: "Adds actions to export/import models in BBS format, which is used by BBS machinima studio.",
icon: "icon.png",
version: "1.2.3",
version: "1.2.4",
min_version: "4.8.0",
variant: "both",
has_changelog: true,
Expand Down
13 changes: 13 additions & 0 deletions plugins/bbs_exporter/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,18 @@
]
}
]
},
"1.2.4": {
"title": "1.2.4",
"date": "2024-12-11",
"author": "McHorse",
"categories": [
{
"title": "Bug fixes",
"list": [
"When exporting the model's UV is incorrectly picked from the project's texture size rather than from the active texture"
]
}
]
}
}

0 comments on commit 72116b8

Please sign in to comment.