Open Shadowkitten47 opened 2 weeks ago
Suggested changes
export_codec.write(export_codec.compile({raw: true}), Project.export_path)
( line 708 of io.js ) Make the initial compile raw
write(content, path) {
if (fs.existsSync(path) && this.overwrite) {
this.overwrite(content, path, path => this.afterSave(path))
} else {
Blockbench.writeFile(path, { content: autoStringify(content) }, path => this.afterSave(path));
}
}
( line 128 of codec.js, codec::write() ) add autoStringify on non-overwriting
var model = content['minecraft:geometry'][0]
( line 1193 of bedrock.js within function overwrite) Use content rather than recompiling
obj[model_name] = content;
( line 400 of bedrock_old.js ) again use content rather than recompile
Detailed description of your suggestion
This is more a question but either way I want to know why.
(line 708 of io.js) Calls the compile function and sends it to write when saving below is Codec.write()
Witch if the file already exists sends to this.overwrite and if it's bedrock
( line 1193 of bedrock.js in function .overwrite)
It calls this.compile AGAIN which I should have to say why this shouldn't be the case because this can really slow down performance on super large or complex bedrock models personally I'm trying to make models that already take 10min to compile I don't want another 10 minutes. On the alterative I think we you should call export_codec as raw from the beginning then stringifying it on write