I'm having an issue when loading a viewable svf locally. I'm loading the bubble.json file as my document. (see below)
function launchViewer(urn) {
var options = {
env: 'Local',
};
console.log(JSON.stringify(options));
Autodesk.Viewing.Initializer(options, () => {
viewer = new Autodesk.Viewing.Private.GuiViewer3D(document.getElementById('forgeViewer'));
viewer.start();
var documentId = "output/bubble.json";
Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);
});
}
My output folder contains the bubble.json file and the folder with the svf contents.
When I run the function I get the following error on the console
Logger.js:187 Error while processing SVF: {"url":"http://localhost:5500/output/output/1/result.svf","httpStatus":404,"httpStatusText":"Not Found"}
When I take a look at the json file it has the following
"urn": "$file$/output/1/result.svf",
so it seems like its pointing to the wrong place. When I modify the json file to say
"urn": "$file$/1/result.svf",
the model loads just fine. I could simply programmatically move the file or modify the json before loading the document but I'm wondering why the default json file from the translation is pointing to the wrong location.
For reference I am using Design Automation for Inventor and following this Developer blog post to translate my models. [https://forge.autodesk.com/blog/speed-viewable-generation-when-using-design-automation-inventor][1]
You are right. Inventor saves the file to place where it cannot be used for loading on your website. In our http://inventor-config-demo.autodesk.io/ demo application we are doing exactly what you described, we move the bubble.json file to proper place.
You can see the source code here https://github.com/Autodesk-Forge/forge-configurator-inventor/blob/238dbc7262f518decfbe484e6698b0d9356ca19b/AppBundles/CreateSVFPlugin/CreateSvfAutomation.cs#L101.