Skip to content

Commit

Permalink
Merge pull request #546 from mchorse/bbs_model_exporter
Browse files Browse the repository at this point in the history
BBS model exporter: add a single anchor group to a groupless model
  • Loading branch information
JannisX11 authored May 30, 2024
2 parents 4ba4867 + 9d0fb04 commit ddb4fd0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,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.2",
"version": "1.2.3",
"variant": "both",
"tags": ["Exporter", "Importer"],
"min_version": "4.8.0",
Expand Down
36 changes: 30 additions & 6 deletions plugins/bbs_exporter/bbs_exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,41 @@

/* Model exporter code */

function areThereObjects(objects)
{
for (let i = 0; i < objects.length; i++)
{
if (objects[i].type === "group")
{
return true;
}
}

return false;
}

function createHierarchy(objects)
{
var groups = {};
var createAnchor = !areThereObjects(objects);

for (let i = 0; i < objects.length; i++)
if (createAnchor)
{
var object = objects[i];
var group = new Group();

if (object.type === "group")
group.children = objects;
groups.anchor = createModelGroup(group, groups);
}
else
{
for (let i = 0; i < objects.length; i++)
{
groups[object.name] = createModelGroup(object, groups);
var object = objects[i];

if (object.type === "group")
{
groups[object.name] = createModelGroup(object, groups);
}
}
}

Expand Down Expand Up @@ -584,8 +608,8 @@
title: "BBS Model Ex/importer",
author: "McHorse",
description: "Adds actions to export/import models in BBS format, which is used by BBS machinima studio.",
icon: "fa-file-export",
version: "1.2.2",
icon: "icon.png",
version: "1.2.3",
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 @@ -11,5 +11,18 @@
]
}
]
},
"1.2.3": {
"title": "1.2.3",
"date": "2024-05-21",
"author": "McHorse",
"categories": [
{
"title": "Enhancements",
"list": [
"When exporting the model that has no groups, a single group called anchor will be added to successfully export the model without groups"
]
}
]
}
}

0 comments on commit ddb4fd0

Please sign in to comment.