Step 4: Loading a scene from a bucket
Меньше 1 минуты
Step 4: Loading a scene from a bucket
Geometric, attribute, and other heavy data are stored in buckets.
Buckets are not files and don't have names, extensions or paths like regular files. You can load them by knowing their GUIDs.
The GUIDs of the bucket for the model you need can be found out by making a query to the tangl servers, but for now we will use the GUID for one of the models in the Demo account and load it immediately.
Load the scene using the GUID of the bucket:
sceneManager.load("0491523c-3e44-f638-93aa-3a077e411e29")
You can also set a callback for the event of complete loading before loading.
When the loading is complete, call the zoom function on the entire scene to center it:
//load scene from bucket via bucket GUID and zoom camera after load process
sceneManager
.onAllLoaded(() => {
renderManager.zoomCameraToSelection()
}).load("0491523c-3e44-f638-93aa-3a077e411e29")
The scene should now load and be displayed in the viewer: