UNPKG

forma-embedded-view-sdk

Version:

The Forma Embedded View SDK is a JavaScript library for creating custom extensions in Autodesk Forma Site Design (previously Spacemaker).

59 lines (58 loc) 1.67 kB
import type { IframeMessenger } from "../iframe-messenger.js"; /** * Render GLBs in the 3D scene. * * @remarks * Available via {@link auto.Forma | Forma}.{@link index.EmbeddedViewSdk.render | render}.{@link render.RenderApi.glb | glb}. */ export declare class RenderGlbApi { #private; constructor(iframeMessenger: IframeMessenger); /** * Add a GLB to the scene. * * @returns Unique identifier of the GLB object in the scene. * * @example * const {id} = await Forma.render.glb.add({ glb }), */ add(request: { /** Binary .glb file as an ArrayBuffer */ glb: ArrayBuffer; }): Promise<{ id: string; }>; /** * Upsert an mesh in the scene. If the mesh does not exist, it will be added. * * This method can also be used as an upsert. * * @example * await Forma.render.glb.update({ id: "myPreviouslyAddedGlbId", glb }) */ update(request: { /** Scene identifier of the GLB object to update (or create). */ id: string; /** Binary .glb file as an ArrayBuffer */ glb: ArrayBuffer; }): Promise<void>; /** * Remove an existing GLB from the scene. * * @example * await Forma.render.glb.remove({ id: "myPreviouslyAddedGlbId" }) */ remove(request: { /** Scene identifier of the GLB object to remove. */ id: string; }): Promise<void>; /** * Remove all GLBs added by this API from the scene. * * Called automatically when the extension is unloaded * * @example * await Forma.render.glb.cleanup() */ cleanup(): Promise<void>; }