waitForSceneCompletion Method

Returns a Promise that resolves after the contents of this viewport are fully loaded and rendered. This can be useful, for example, when you want to capture an image of the viewport's contents, as in the following code:

 async function captureImage(vp: Viewport): Promise<ImageBuffer | undefined> {
   await vp.waitForSceneCompletion();
   return vp.readImageBuffer();

waitForSceneCompletion(): Promise<void>

Returns - Promise<void>

Defined in

Last Updated: 11 November, 2022