Scripting API
Realtime Render
from ArtisanPlugin.Scripting import RealtimeRenderApi as rtr
Realtime Render is a separate window hosting a web-based viewer: Artisan exports the document to it as a GLB and the page renders it with its own camera, its own material catalogue and its own lighting. Driving it from a script is how you get a presentable image — or a full set of product shots, or a turntable video — without setting up a raytraced render.
The windowOpen the viewer and push document updates into it.
CameraPresets, explicit placement and zoom extents.
MaterialsBy layer or by part, plus live fine-tuning.
Scene & effectsBackground, environment, lights and post-effects.
CaptureOne screenshot, or the 8 standard views in one call.
VideoRecord the viewer to an MP4, timed or manual.
The three rules
Everything in this facade follows from three facts about the window.
It is not the Rhino viewport. Every call here talks to the Realtime Render window, never to Rhino’s views — to stage the Rhino camera use rhinoscriptsyntax or Views. And nothing here modifies the Rhino document, so nothing here needs a Transaction: materials, scene options and camera moves restyle the viewer’s private copy of the model, and the next export puts the document’s truth back.
It is not live-linked. The window shows the model as of the last export. UpdateRender is what pushes document changes across, and it is asynchronous — it returns when the export is queued, not when the viewer has swapped the model in.
It must be open. Every call throws “The Realtime Render window is not open. Call RealtimeRenderApi.ShowRealtimeRender() first.” when it is not. The working sequence is always ShowRealtimeRender → UpdateRender → scene/camera/materials → capture.
The thirty-second product shot
from ArtisanPlugin.Scripting import RealtimeRenderApi as rtr
rtr.ShowRealtimeRender()
rtr.UpdateRender()
rtr.SetMaterialByLayer("Metal 01", "ROSE_GOLD")
rtr.SetMaterialByLayer("Gems 01", "DIAMOND")
rtr.SetViewerEnvironment("studio", 1.2)
rtr.SetViewerBackground("#1a1a2e", "#0b0b14")
rtr.SetViewerCameraPreset("three-quarter")
print(rtr.ViewerScreenshot(r"C:\out\hero.png"))
Which calls wait, which fire and forget
Only the calls that need an answer wait for the page: GetViewerItems, SetMaterialByLayer, ViewerScreenshot and CaptureViews — those are the ones that can time out. The rest (camera moves, scene options, SetViewerMaterial, EditViewerMaterial, video start/stop) queue JavaScript into the window and return immediately; anything that goes wrong inside the page afterwards is invisible to your script. Each page notes which side of the line its calls sit on.