【问题标题】:Is there a way to unload a loaded model?有没有办法卸载加载的模型?
【发布时间】:2019-01-12 23:42:35
【问题描述】:

我想使用单个查看器来加载/卸载模型,而不是拆除查看器并创建一个新的查看器实例。

推理:我已经加载了多个模型,其中一个模型太大并且有问题,它会减慢渲染速度,我在想是否可以卸载有问题的模型而不是重新加载所有模型,除了有问题的模型型号。

【问题讨论】:

    标签: autodesk-forge autodesk-viewer


    【解决方案1】:

    如果您只想卸载特定模型,以下代码 sn -p 可能会有所帮助。

    const models = viewer.impl.modelQueue().getModels();
    const model = models[2]; //!<< The model you want to unload
    viewer.impl.unloadModel( model );
    

    【讨论】:

    • 这行得通,谢谢! (另外,特别感谢“getAllModel”方法)
    猜你喜欢
    • 2014-09-06
    • 1970-01-01
    • 1970-01-01
    • 2020-11-12
    • 2012-03-13
    • 2010-11-28
    • 2010-10-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多