bump rev 3.7.D1

This commit is contained in:
Stewart Allen 2022-10-25 18:23:00 -04:00
commit 3dd05536f3
4 changed files with 22 additions and 4 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "grid-apps", "name": "grid-apps",
"version": "3.7.0D", "version": "3.7.1D",
"description": "grid.space 3d slice & modeling tools", "description": "grid.space 3d slice & modeling tools",
"author": "Stewart Allen <sa@grid.space>", "author": "Stewart Allen <sa@grid.space>",
"license": "MIT", "license": "MIT",

View file

@ -15,7 +15,7 @@ gapp.main("main.kiri", [], (root) => {
const modfns = root.kirimod = ( root.kirimod || [] ); const modfns = root.kirimod = ( root.kirimod || [] );
const kiri = root.kiri = { const kiri = root.kiri = {
beta: 3700, beta: 3701,
driver: {}, // driver modules driver: {}, // driver modules
load(fn) { load(fn) {
modfns.push(fn); modfns.push(fn);

View file

@ -104,14 +104,21 @@ function restore_space() {
} }
}); });
mesh.db.space.iterate({ map: true }).then(cached => { mesh.db.space.iterate({ map: true }).then(cached => {
const keys = [];
const claimed = [];
for (let [id, data] of Object.entries(cached)) { for (let [id, data] of Object.entries(cached)) {
keys.push(id);
if (count++ === 0) { if (count++ === 0) {
mesh.api.log.emit(`restoring workspace`); mesh.api.log.emit(`restoring workspace`);
} }
// restore group // restore group
if (Array.isArray(data)) { if (Array.isArray(data)) {
claimed.push(id);
let models = data let models = data
.map(id => { return { id, md: cached[id] } }) .map(id => {
claimed.push(id);
return { id, md: cached[id] }
})
.filter(r => r.md) // filter cache misses .filter(r => r.md) // filter cache misses
.map(r => new mesh.model(r.md, r.id).applyMatrix(mcache[r.id])); .map(r => new mesh.model(r.md, r.id).applyMatrix(mcache[r.id]));
if (models.length) { if (models.length) {
@ -123,6 +130,17 @@ function restore_space() {
} }
} }
} }
for (let id of claimed) {
keys.remove(id);
}
if (keys.length) {
mesh.api.log.emit(`removing ${keys.length} unclaimed meshes`);
}
// clear out meshes left in the space db along with their matrices
for (let id of keys) {
mesh.db.space.remove(id);
delete mcache[id];
}
// restore global cache only after objects are restored // restore global cache only after objects are restored
// otherwise their setup will corrupt the cache for other restores // otherwise their setup will corrupt the cache for other restores
matrixCache = mcache; matrixCache = mcache;

View file

@ -5,7 +5,7 @@
let terms = { let terms = {
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved", COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
LICENSE: "See the license.md file included with the source distribution", LICENSE: "See the license.md file included with the source distribution",
VERSION: (is_self ? self : this).debug_version || "3.7.D0" VERSION: (is_self ? self : this).debug_version || "3.7.D1"
}; };
if (typeof(module) === 'object') { if (typeof(module) === 'object') {