@preference-sl/pref-viewer 2.11.0-beta.6 → 2.11.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import "@babylonjs/loaders/glTF/2.0/Extensions/KHR_draco_mesh_compression";
|
|
|
5
5
|
import { USDZExportAsync, GLTF2Export } from "@babylonjs/serializers";
|
|
6
6
|
|
|
7
7
|
import GLTFResolver from "./gltf-resolver.js";
|
|
8
|
-
import {
|
|
8
|
+
import { MaterialData } from "./pref-viewer-3d-data.js";
|
|
9
9
|
import BabylonJSAnimationController from "./babylonjs-animation-controller.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -452,7 +452,7 @@ export default class BabylonJSController {
|
|
|
452
452
|
if (container.state.name === "materials") {
|
|
453
453
|
return;
|
|
454
454
|
}
|
|
455
|
-
if (container.assetContainer && (container.isPending || materialContainer.isPending || optionMaterial.isPending)) {
|
|
455
|
+
if (container.assetContainer && (container.state.isPending || materialContainer.state.isPending || optionMaterial.isPending)) {
|
|
456
456
|
assetContainersToProcess.push(container.assetContainer);
|
|
457
457
|
}
|
|
458
458
|
});
|
|
@@ -504,7 +504,7 @@ export default class BabylonJSController {
|
|
|
504
504
|
const modelContainer = this.#containers.model;
|
|
505
505
|
const environmentContainer = this.#containers.environment;
|
|
506
506
|
|
|
507
|
-
if (!cameraState.isPending && !modelContainer.isPending && !environmentContainer.isPending) {
|
|
507
|
+
if (!cameraState.isPending && !modelContainer.state.isPending && !environmentContainer.state.isPending) {
|
|
508
508
|
return false;
|
|
509
509
|
}
|
|
510
510
|
|
|
@@ -559,7 +559,7 @@ export default class BabylonJSController {
|
|
|
559
559
|
* Finds and returns the asset container object by its name.
|
|
560
560
|
* @private
|
|
561
561
|
* @param {string} name - The name of the container to find.
|
|
562
|
-
* @returns {
|
|
562
|
+
* @returns {Object|null} The matching container object, or null if not found.
|
|
563
563
|
*/
|
|
564
564
|
#findContainerByName(name) {
|
|
565
565
|
return Object.values(this.#containers).find((container) => container.state.name === name) || null;
|
|
@@ -612,7 +612,7 @@ export default class BabylonJSController {
|
|
|
612
612
|
/**
|
|
613
613
|
* Adds the asset container to the Babylon.js scene if it should be shown and is not already visible.
|
|
614
614
|
* @private
|
|
615
|
-
* @param {
|
|
615
|
+
* @param {object} container - The container object containing asset state and metadata.
|
|
616
616
|
* @param {boolean} [updateVisibility=true] - If true, updates the visibility attribute in parent components.
|
|
617
617
|
* @returns {boolean} True if the container was added, false otherwise.
|
|
618
618
|
*/
|
|
@@ -631,7 +631,7 @@ export default class BabylonJSController {
|
|
|
631
631
|
/**
|
|
632
632
|
* Removes the asset container from the Babylon.js scene if it is currently visible.
|
|
633
633
|
* @private
|
|
634
|
-
* @param {
|
|
634
|
+
* @param {object} container - The container object containing asset state and metadata.
|
|
635
635
|
* @param {boolean} [updateVisibility=true] - If true, updates the visibility attribute in parent components.
|
|
636
636
|
* @returns {boolean} True if the container was removed, false otherwise.
|
|
637
637
|
*/
|
|
@@ -650,7 +650,7 @@ export default class BabylonJSController {
|
|
|
650
650
|
/**
|
|
651
651
|
* Replaces the asset container in the Babylon.js scene with a new one.
|
|
652
652
|
* @private
|
|
653
|
-
* @param {
|
|
653
|
+
* @param {object} container - The container object containing asset state and metadata.
|
|
654
654
|
* @param {AssetContainer} newAssetContainer - The new asset container to add to the scene.
|
|
655
655
|
* @returns {boolean} True if the container was replaced and added, false otherwise.
|
|
656
656
|
*/
|
|
@@ -703,8 +703,8 @@ export default class BabylonJSController {
|
|
|
703
703
|
/**
|
|
704
704
|
* Loads an asset container (model, environment, materials, etc.) using the provided container state.
|
|
705
705
|
* @private
|
|
706
|
-
* @param {
|
|
707
|
-
* @returns {Promise<[
|
|
706
|
+
* @param {object} container - The container object containing asset state and metadata.
|
|
707
|
+
* @returns {Promise<[object, AssetContainer|boolean]>} Resolves to an array with the container and the loaded asset container, or false if loading fails.
|
|
708
708
|
* @description
|
|
709
709
|
* Resolves the asset source using GLTFResolver, prepares plugin options, and loads the asset into the Babylon.js scene.
|
|
710
710
|
* Updates the container's cache data and returns the container along with the loaded asset container or false if loading fails.
|