storysplat-viewer 0.1.3 → 0.1.6
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/dist/esm/index.js +10 -5
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -75185,9 +75185,8 @@ async function loadSplatAsset(scene, data, onProgress // Updated signature
|
|
|
75185
75185
|
const invertY = (_c = data.invertYScale) !== null && _c !== void 0 ? _c : false;
|
|
75186
75186
|
console.log(`StorySplat Viewer: Loading splat asset from ${modelUrl}`);
|
|
75187
75187
|
try {
|
|
75188
|
-
//
|
|
75189
|
-
|
|
75190
|
-
// For example: SceneLoader.RegisterPlugin(new SplatLoaderPlugin());
|
|
75188
|
+
// Debug: Check what loaders are registered
|
|
75189
|
+
console.log("StorySplat Viewer: Available SceneLoader plugins:", Object.keys(SceneLoader._RegisteredPlugins || {}));
|
|
75191
75190
|
const result = await SceneLoader.ImportMeshAsync("", // meshNames - empty string loads all
|
|
75192
75191
|
modelUrl, // rootUrl - the full URL
|
|
75193
75192
|
"", // sceneFilename - empty when using full URL
|
|
@@ -161176,8 +161175,6 @@ class Viewer {
|
|
|
161176
161175
|
}
|
|
161177
161176
|
}
|
|
161178
161177
|
|
|
161179
|
-
// Register all built-in loaders when the module loads
|
|
161180
|
-
registerBuiltInLoaders();
|
|
161181
161178
|
/**
|
|
161182
161179
|
* Initializes the StorySplat Viewer within a given HTML element.
|
|
161183
161180
|
*
|
|
@@ -161237,6 +161234,14 @@ function createViewerOptions(rawData, userOptions) {
|
|
|
161237
161234
|
async function initializeViewer(targetElement, rawData, // Accept any JSON data
|
|
161238
161235
|
options) {
|
|
161239
161236
|
var _a, _b;
|
|
161237
|
+
// Register BabylonJS loaders at runtime
|
|
161238
|
+
try {
|
|
161239
|
+
registerBuiltInLoaders();
|
|
161240
|
+
}
|
|
161241
|
+
catch (error) {
|
|
161242
|
+
console.error("StorySplat Viewer: Failed to register BabylonJS loaders:", error);
|
|
161243
|
+
throw new Error("Failed to initialize BabylonJS loaders");
|
|
161244
|
+
}
|
|
161240
161245
|
if (!targetElement) {
|
|
161241
161246
|
throw new Error("StorySplat Viewer: Target element not provided or not found.");
|
|
161242
161247
|
}
|