Fixed inner workings

This commit is contained in:
Christoph Stahl 2019-06-24 20:36:31 +02:00
parent 28001fdca5
commit 33b6711fb7
2 changed files with 8 additions and 8 deletions

View File

@ -200,7 +200,7 @@ function init() {
stl.click(function(e) { stl.click(function(e) {
e.preventDefault(); e.preventDefault();
var exporter = new RK.STLExporter(); var exporter = new RK.STLExporter();
var objs = CK.character.threeObj.children; var objs = CK.character.children;
var character = objs[0]; var character = objs[0];
var figure = []; var figure = [];
var max_objs = 0; var max_objs = 0;
@ -219,7 +219,7 @@ function init() {
console.log(character); console.log(character);
figure.push(character); figure.push(character);
} }
if(CK.character.characterData.parts.mount !== undefined) { if(CK.data.parts.mount !== undefined) {
console.log("Exporting Mount"); console.log("Exporting Mount");
var mount = undefined; var mount = undefined;
for(i in objs) { // find mount for(i in objs) { // find mount
@ -237,15 +237,15 @@ function init() {
} }
console.log(figure); console.log(figure);
var stlString = exporter.parse(figure) var stlString = exporter.parse(figure)
var name = CK.character.name var name = CK.data.meta.character_name
name = name === "" ? "unnamed" : name name = name === "" ? "unnamed" : name
download(stlString, name + '.stl', 'application/sla'); download(stlString, name + '.stl', 'application/sla');
}); });
stl_base.click(function(e) { stl_base.click(function(e) {
e.preventDefault(); e.preventDefault();
var exporter = new RK.STLExporter(); var exporter = new RK.STLExporter();
var stlString = exporter.parse([CK.character.threeObj]) var stlString = exporter.parse([CK.character])
var name = CK.character.name var name = CK.data.meta.character_name
name = name === "" ? "unnamed" : name name = name === "" ? "unnamed" : name
download(stlString, name + '_base.stl', 'application/sla'); download(stlString, name + '_base.stl', 'application/sla');
}); });
@ -253,8 +253,8 @@ function init() {
sjson.click(function(e) { sjson.click(function(e) {
e.preventDefault(); e.preventDefault();
var char_json = JSON.stringify(CK.character.characterData); var char_json = JSON.stringify(CK.data);
var name = CK.character.name var name = CK.data.meta.character_name
name = name === "" ? "unnamed" : name name = name === "" ? "unnamed" : name
download(char_json, name + ".json", "text/plain"); download(char_json, name + ".json", "text/plain");
}); });

2
herosaver.min.js vendored

File diff suppressed because one or more lines are too long