[英]How to get and restore current Settings in Autodesk Forge Viewer
我需要存儲/恢復設置面板的值。 我怎樣才能做到這一點?
我使用了以下但沒有成功。
在我的場景中,我更改了Ghost hidden objects
和Display Unit
,然后:
let current_profile = NOP_VIEWER.profileManager.getProfileOrDefault();
let profile = new Autodesk.Viewing.Profile(current_profile);
之后,我再次將Ghost隱藏對象和顯示單元更改為其他一些,然后:
NOP_VIEWER.setProfile(profile);
解決方案是使用viewer.getState()
:
存儲設置:
let current_state = NOP_VIEWER.getState();
let render_options = current_state.renderOptions;
恢復設置:
let state = {renderOptions: render_options}
NOP_VIEWER.restoreState(state);
更多信息: https://autodeskviewer.com/viewers/latest/docs/tutorial-viewer_state.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.