1

I just tried out the SVF2 public beta but couldn't get the model to load in the Viewer. I believe the model was translated successfully since the manifest returned has:

"name": "XXXX_ARC.nwd",
"progress": "complete",
"outputType": "svf2",
"status": "success"

However, when I tried to load the model in Viewer, it would fail on this line:

theViewer.loadModel(svfURL, onItemLoadSuccess, onItemLoadFail);

The svfURL is something like this:

https://cdn.derivative.autodesk.com/modeldata/file/urn:adsk.fluent:fs.file:autodesk-360-translation-storage-prod/*MyURN*/output/otg_files/0/output/0/otg_model.json

And the errors I got from Chrome browser: 403 GET errors. Seems like I don't have privilege to access the model?

Is there some additional setting I need to do?

Additional Info:
I have setup the Viewer environment as follows:

var options = {
    env: 'MD20ProdUS',
    api: 'D3S',
    getAccessToken: getForgeToken
};

var documentId = 'urn:' + urn;

Autodesk.Viewing.Initializer(options, function onInitialized() {
    var htmlDiv = document.getElementById('forgeViewer');
    var config3d = {
      extensions: ['ToolbarExtension', 'HandleSelectionExtension', .....a few extensions ],
      loaderExtensions: { svf: "Autodesk.MemoryLimited" }
    };
    
    theViewer = new Autodesk.Viewing.GuiViewer3D(htmlDiv, config3d);
    var startedCode = theViewer.start();
    if (startedCode > 0) {
        console.error('Failed to create a Viewer: WebGL not supported.');
        return;
    }
    Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);
});

I have also tried removing the config3d when creating the viewer but it still returned the same messages. The code got into onDocumentLoadSuccess but failed at theViewer.loadModel(svfURL, onItemLoadSuccess, onItemLoadFail);, jumping into onItemLoadFail.

jma
  • 13
  • 4

3 Answers3

0

Because you mention mainly the viewer not loading the SVF2, I can suspect that maybe you have not specified the correct Viewer environment.

Here is some sample code, and pay attention to the options where you have to set env and API:

var viewer;
var options = {
  // These are the SVF2 viewing settings during public beta
  env: 'MD20ProdUS', // or MD20ProdEU (for EMEA)
  api: 'D3S', 
  getAccessToken: getForgeToken
};
var documentId = 'urn:' + getUrlParameter('urn');

// Run this when the page is loaded
Autodesk.Viewing.Initializer(options, function onInitialized() {
  // Find the element where the 3d viewer will live.    
  var htmlElement = document.getElementById('MyViewerDiv');
  if (htmlElement) {
    // Create and start the viewer in that element    
    viewer = new Autodesk.Viewing.GuiViewer3D(htmlElement);
    viewer.start();
    // Load the document into the viewer.
    Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);
  }
});
Dharman
  • 30,962
  • 25
  • 85
  • 135
kevinvandecar
  • 176
  • 1
  • 3
  • Thanks for the info. I have edited my question with additional information on how I had setup the Viewer environment, which is similar to what you have, but it is still returning the same 403 error messages. – jma Oct 29 '20 at 02:47
  • Ok, thanks for the update. I tested again and in one case I saw 404 (not 403). So I investigated further and seems we may have had a minor bucket issue earlier this week. Could I ask you to try again using a new bucket, upload the model again, and then test SVF2 translation? Please let me know how it goes. Currently in my testing it seems resolved. Your viewer code looks fine to me. Thanks for providing it. Thank you – kevinvandecar Oct 29 '20 at 19:52
  • I've created a new bucket and did the SVF2 translation, but it's still returning the same error messages when loading the SVF2 in the viewer. When I changed to request for the SVF version, the model loads fine. Anything else I can do for trial and error? – jma Nov 01 '20 at 08:40
  • Sorry for the trouble you are having. I will ask engineering team what could be causing your issue. – kevinvandecar Nov 02 '20 at 22:22
  • Ok, Can you provide the URN (to be sure we are looking at correct one) and also a HAR export from the browser? HAR is the HTTP Archive and can be exported by following these example instructions: https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000CmCtCAK The HAR file can help our product team to see what is happening on your client. In the step "Refresh the page and allow to record browser-website interaction" make sure to load the SVF2 in that step. If you prefer, you can send it to forge.help@autodesk.com and mention "kevin vandecar" – kevinvandecar Nov 03 '20 at 22:11
  • I've sent the email to forge help. Thanks Kevin. – jma Nov 04 '20 at 04:38
0

I am facing the same problem.

  1. Although the model has been converted to SVF2 format, my cloud credits are being used up . An excerpt from the manifest:

         "name": "7085-33cc-9464.rvt",
         "progress": "complete",
         "outputType": "svf2",
         "status": "success"
    
  2. No matter with which settings, only the SVF format is loaded in the viewer. I don't get an error message from the viewer, everything works as before, except that SVF is still loaded and not SVF2. Viewer init options:

     const viewerEnv = await this.initialize({
       //env: dbModel.env,
    
       env: "MD20ProdEU",
       api: "D3S",
       //accessToken: "",
     });
    
FlorolF
  • 29
  • 7
0

Not sure if this has been solved on a separate thread, but the issue was probably that acmSessionId was not set in the options for loadModel() - see https://forge.autodesk.com/blog/403-error-when-trying-view-svf2

function onDocumentLoadSuccess(doc) {
  let items = doc.getRoot().search({
    'type': 'geometry',
    'role': '3d'
  }, true)

  let url = doc.getViewablePath(items[0])

  viewer.loadModel(url, { acmSessionId: doc.getAcmSessionId(url) })
}

The best thing is to just use loadDocumentNode() instead of loadModel()

Adam Nagy
  • 1,700
  • 1
  • 9
  • 14