Autodesk Forge Viewer 在加载不同文档时出错
Autodesk Forge Viewer gives error when loading a different document
我正在使用 Autodesk Forge Viewer v7.18.0 以及使用新的 SceneBuilder 在查看器本身中添加 3d 几何体的自定义扩展。
在使用这个时,当用户从一个文件切换到另一个文件时,基本上加载不同的 SVF 文件,我们删除 SceneBuilder 创建的模型构建器中的所有片段,然后调用
Autodesk.Viewing.Document.load(fileUrn, onDocumentLoadSuccess, onDocumentLoadFailure)
并且在onDocumentLoadSuccess()
中,我们调用函数
//The viewable is fetched from the file based on certain criteria
viewer.loadDocumentNode(doc, viewable, loadOptions)
第一次加载新文件时出现以下错误,我不确定如何解决:
Uncaught TypeError: Cannot read property 'dispatchEvent' of null
at f.dispose (FragmentList.js:782)
at u.dtor (RenderModel.js:144)
at H.unloadModel (Viewer3DImpl.js:2763)
at H.unloadCurrentModel (Viewer3DImpl.js:2925)
at T.Z.tearDown (Viewer3D.js:800)
at T.tearDown (GuiViewer3D.js:180)
at T.Z.loadDocumentNode (Viewer3D.js:1713)
at onDocumentLoadSuccess (eval at <anonymous> (jquery.min.js:1), <anonymous>:142:12)
at Function.p (Document.js:146)
at l (Xhr.js:564)
如果再次加载新文件并按预期工作,则不会出现相同的错误。
非常感谢任何帮助。
正如您在堆栈跟踪中看到的那样,当 Model
/RenderModel
对象被卸载时(当切换到另一个 SVF 时),它会自动处理它的所有片段,所以您不需要不必手动执行此操作。
如果您在没有手动删除片段的情况下仍然出现此错误,则可能是 SceneBuilder
扩展中的错误。在这种情况下,请向 forge (dot) help (at) autodesk (dot) com
.
提交错误报告
我正在使用 Autodesk Forge Viewer v7.18.0 以及使用新的 SceneBuilder 在查看器本身中添加 3d 几何体的自定义扩展。
在使用这个时,当用户从一个文件切换到另一个文件时,基本上加载不同的 SVF 文件,我们删除 SceneBuilder 创建的模型构建器中的所有片段,然后调用
Autodesk.Viewing.Document.load(fileUrn, onDocumentLoadSuccess, onDocumentLoadFailure)
并且在onDocumentLoadSuccess()
中,我们调用函数
//The viewable is fetched from the file based on certain criteria
viewer.loadDocumentNode(doc, viewable, loadOptions)
第一次加载新文件时出现以下错误,我不确定如何解决:
Uncaught TypeError: Cannot read property 'dispatchEvent' of null
at f.dispose (FragmentList.js:782)
at u.dtor (RenderModel.js:144)
at H.unloadModel (Viewer3DImpl.js:2763)
at H.unloadCurrentModel (Viewer3DImpl.js:2925)
at T.Z.tearDown (Viewer3D.js:800)
at T.tearDown (GuiViewer3D.js:180)
at T.Z.loadDocumentNode (Viewer3D.js:1713)
at onDocumentLoadSuccess (eval at <anonymous> (jquery.min.js:1), <anonymous>:142:12)
at Function.p (Document.js:146)
at l (Xhr.js:564)
如果再次加载新文件并按预期工作,则不会出现相同的错误。
非常感谢任何帮助。
正如您在堆栈跟踪中看到的那样,当 Model
/RenderModel
对象被卸载时(当切换到另一个 SVF 时),它会自动处理它的所有片段,所以您不需要不必手动执行此操作。
如果您在没有手动删除片段的情况下仍然出现此错误,则可能是 SceneBuilder
扩展中的错误。在这种情况下,请向 forge (dot) help (at) autodesk (dot) com
.