Scripting API
The window
from ArtisanPlugin.Scripting import RealtimeRenderApi as rtr
Two calls own the window’s lifecycle: one opens it, one feeds it. Everything else in this section assumes both have run.
Show the viewer
ok = rtr.ShowRealtimeRender() # -> True when the window opened or was activated
Opens the Realtime Render window, or activates it when it is already open - the ArtisanRealtimeRender command, which is hidden from the command list, so this is the only scriptable way in. Returns the command’s own success flag as a bool.
Requires a valid licence. The window carries its own local HTTP server, and the page needs a moment to load; the calls in the rest of this section fail cleanly if you get ahead of it, so retry rather than assume.
Push the document into the viewer
rtr.UpdateRender() # -> None
Re-exports the current document to the viewer - the ArtisanRenderUpdate command. The export runs in the background, so this returns as soon as the export is queued, not when the viewer has finished swapping the model in. Requires a valid licence.
Call it after any geometry or material change you want to see. The window is not live: without an UpdateRender the viewer keeps showing the model from the previous export.
If the viewer’s HTTP server is not running you get “The Realtime Render window is not open. Call RealtimeRenderApi.ShowRealtimeRender() first.” - the underlying command only logged that condition, which a script would never see.
What the export looks like from the viewer’s side
The exporter joins all of a layer’s meshes into one part named after the Rhino layer. That single fact is why Materials can address parts by layer name, and why the viewer’s part list mirrors your layer structure rather than your object list. Hidden and locked layers are skipped.
An export also resets whatever the viewer was showing: materials assigned in the viewer and camera framing survive as the page re-applies its saved state, but give it a beat before capturing.