diff --git a/plugins.json b/plugins.json index f87e31ee..63086eb1 100644 --- a/plugins.json +++ b/plugins.json @@ -759,7 +759,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", diff --git a/plugins/bbs_exporter/bbs_exporter.js b/plugins/bbs_exporter/bbs_exporter.js index cfd27daa..3adf4099 100644 --- a/plugins/bbs_exporter/bbs_exporter.js +++ b/plugins/bbs_exporter/bbs_exporter.js @@ -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); + } } } @@ -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, diff --git a/plugins/bbs_exporter/changelog.json b/plugins/bbs_exporter/changelog.json index 6d940922..efcade4e 100644 --- a/plugins/bbs_exporter/changelog.json +++ b/plugins/bbs_exporter/changelog.json @@ -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" + ] + } + ] } } \ No newline at end of file