mirror of
https://github.com/yeicor-3d/yet-another-cad-viewer.git
synced 2025-12-20 06:27:04 +01:00
fix issue with helpers
This commit is contained in:
@@ -1290,7 +1290,7 @@ third-party archives.
|
|||||||
|
|
||||||
The following npm package may be included in this product:
|
The following npm package may be included in this product:
|
||||||
|
|
||||||
- typescript@5.3.3
|
- typescript@5.4.2
|
||||||
|
|
||||||
This package contains the following license and notice below:
|
This package contains the following license and notice below:
|
||||||
|
|
||||||
@@ -2408,7 +2408,7 @@ THE SOFTWARE.
|
|||||||
|
|
||||||
The following npm package may be included in this product:
|
The following npm package may be included in this product:
|
||||||
|
|
||||||
- vuetify@3.5.7
|
- vuetify@3.5.8
|
||||||
|
|
||||||
This package contains the following license and notice below:
|
This package contains the following license and notice below:
|
||||||
|
|
||||||
|
|||||||
@@ -6,14 +6,11 @@ import {Vector3} from "three/src/math/Vector3.js"
|
|||||||
import {Box3} from "three/src/math/Box3.js"
|
import {Box3} from "three/src/math/Box3.js"
|
||||||
import {Matrix4} from "three/src/math/Matrix4.js"
|
import {Matrix4} from "three/src/math/Matrix4.js"
|
||||||
|
|
||||||
let latestModel: string | null = null;
|
|
||||||
|
|
||||||
/** This class helps manage SceneManagerData. All methods are static to support reactivity... */
|
/** This class helps manage SceneManagerData. All methods are static to support reactivity... */
|
||||||
export class SceneMgr {
|
export class SceneMgr {
|
||||||
/** Loads a GLB model from a URL and adds it to the viewer or replaces it if the names match */
|
/** Loads a GLB model from a URL and adds it to the viewer or replaces it if the names match */
|
||||||
static async loadModel(sceneUrl: Ref<string>, document: Document, name: string, url: string): Promise<Document> {
|
static async loadModel(sceneUrl: Ref<string>, document: Document, name: string, url: string): Promise<Document> {
|
||||||
let loadStart = performance.now();
|
let loadStart = performance.now();
|
||||||
latestModel = name; // To help load helpers only once per model load batch
|
|
||||||
|
|
||||||
// Start merging into the current document, replacing or adding as needed
|
// Start merging into the current document, replacing or adding as needed
|
||||||
document = await mergePartial(url, name, document);
|
document = await mergePartial(url, name, document);
|
||||||
@@ -22,12 +19,8 @@ export class SceneMgr {
|
|||||||
|
|
||||||
if (name !== extrasNameValueHelpers) {
|
if (name !== extrasNameValueHelpers) {
|
||||||
// Reload the helpers to fit the new model
|
// Reload the helpers to fit the new model
|
||||||
// Only reload the helpers after a few milliseconds of no more models being added/removed
|
// TODO: Only reload the helpers after a few milliseconds of no more models being added/removed
|
||||||
setTimeout(async () => {
|
await this.reloadHelpers(sceneUrl, document);
|
||||||
if (name === latestModel) {
|
|
||||||
document = await this.reloadHelpers(sceneUrl, document);
|
|
||||||
}
|
|
||||||
}, 10)
|
|
||||||
} else {
|
} else {
|
||||||
// Display the final fully loaded model
|
// Display the final fully loaded model
|
||||||
let displayStart = performance.now();
|
let displayStart = performance.now();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yet-another-cad-viewer",
|
"name": "yet-another-cad-viewer",
|
||||||
"version": "0.4.0",
|
"version": "0.4.3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "Yeicor <4929005+Yeicor@users.noreply.github.com>",
|
"author": "Yeicor <4929005+Yeicor@users.noreply.github.com>",
|
||||||
|
|||||||
Reference in New Issue
Block a user