Authentication
Scene to render inside, do note the scene appearance is not populated automatically, use setupThumbnailScene()
Model to render
Size of the resulting image, ignored for 3d thumbnails
Type of thumbnail, "png" | "webp" | "gltf"
Quality of image, with 1 being max-
Automatically download gltf file
ThumbnailResult, always a string for 2d thumbnails, 3d can be ArrayBuffer (glb, binary) or {[key: string]: unknown} (gltf, json)
Example of generating thumbnail of accessory
//config
const ASSETID = 1039433
//code
FLAGS.ANIMATE_SKELETON = false
FLAGS.UPDATE_SKELETON = true
const rScene = RBXRenderer.addScene()
setupThumbnailScene(rScene)
const accessoryrbx = await API.Asset.GetRBX(`rbxassetid://${ASSETID}`, {"Roblox-AssetFormat":"avatar_meshpart_accessory"})
const accessory = accessoryrbx.generateTree().GetChildren()[0]
const handle = accessory.FindFirstChildOfClass("MeshPart")
const cf = handle.Prop("CFrame")
if (!accessory.FindFirstChildOfClass("Camera")) cf.Position = [0,0,0]
const result = await generateModelThumbnail(new Authentication(), rScene, accessory, [1000,1000], "webp", 0.99)
console.log(result)
console.log(result.length)
Generates a 2d or 3d thumbnail of a model/similar instance