mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-01-30 15:42:42 +08:00
Fix model memory data not loading correctly
This commit is contained in:
parent
3a836a17e1
commit
c7b8f7714f
@ -31,21 +31,25 @@ class Codec {
|
||||
}
|
||||
if (file.path && isApp && this.remember && !file.no_file ) {
|
||||
var name = pathToName(file.path, true);
|
||||
let project = Project;
|
||||
Project.name = pathToName(name, false);
|
||||
Project.export_path = file.path;
|
||||
|
||||
}
|
||||
|
||||
this.parse(model, file.path)
|
||||
|
||||
if (file.path && isApp && this.remember && !file.no_file ) {
|
||||
loadDataFromModelMemory();
|
||||
addRecentProject({
|
||||
name,
|
||||
path: file.path,
|
||||
icon: Format.icon
|
||||
})
|
||||
let project = Project;
|
||||
setTimeout(() => {
|
||||
if (Project == project) updateRecentProjectThumbnail();
|
||||
}, 200)
|
||||
}
|
||||
this.parse(model, file.path)
|
||||
if (isApp) loadDataFromModelMemory();
|
||||
}
|
||||
//parse(model, path)
|
||||
|
||||
|
@ -1030,21 +1030,33 @@ var codec = new Codec('bedrock', {
|
||||
}
|
||||
if (file.path && isApp && this.remember && !file.no_file ) {
|
||||
var name = pathToName(file.path, true);
|
||||
let project = Project;
|
||||
Project.name = pathToName(name, false);
|
||||
Project.export_path = file.path;
|
||||
|
||||
}
|
||||
|
||||
this.parse(model, file.path)
|
||||
|
||||
if (file.path && isApp && this.remember && !file.no_file ) {
|
||||
if (isApp) {
|
||||
let no_textures_before = Texture.all.length == 0;
|
||||
loadDataFromModelMemory();
|
||||
if (!Format.single_texture && no_textures_before && Texture.all.length) {
|
||||
Cube.all.forEach(cube => {
|
||||
cube.applyTexture(Texture.all[0]);
|
||||
})
|
||||
}
|
||||
}
|
||||
addRecentProject({
|
||||
name,
|
||||
path: file.path,
|
||||
icon: Format.icon
|
||||
});
|
||||
let project = Project;
|
||||
setTimeout(() => {
|
||||
if (Project == project) setTimeout(() => updateRecentProjectThumbnail(), 40);
|
||||
}, 200)
|
||||
}
|
||||
this.parse(model, file.path)
|
||||
if (isApp) loadDataFromModelMemory();
|
||||
},
|
||||
compile(options) {
|
||||
if (options === undefined) options = {}
|
||||
|
@ -62,7 +62,15 @@ let codec = new Codec('image', {
|
||||
}
|
||||
}
|
||||
|
||||
if (isApp) loadDataFromModelMemory();
|
||||
if (path && isApp && !files[0].no_file ) {
|
||||
loadDataFromModelMemory();
|
||||
|
||||
addRecentProject({
|
||||
name,
|
||||
path: path,
|
||||
icon: Format.icon
|
||||
});
|
||||
}
|
||||
},
|
||||
afterSave() {
|
||||
if (!isApp || !Texture.all.length) return;
|
||||
|
Loading…
Reference in New Issue
Block a user