Skip to content

Scripting API

Video

from ArtisanPlugin.Scripting import RealtimeRenderApi as rtr

The viewer records itself: what you see is what gets encoded, camera moves and auto-rotation included. Recording is inherently asynchronous - the file appears when the recording ends, not when the call returns - and that shapes both calls on this page.

Start recording

path = rtr.StartVideoRecording(r"C:\out\turntable.mp4", seconds=8)   # -> the path armed
ParameterDefaultMeaning
pathrequiredDestination file; .mp4 is appended when there is no extension
seconds0> 0: stop and save automatically after that long. 0: record until StopVideoRecording()
width / height0 (window size)Video size in px - pass both or neither
frameRate0 (viewer default, 30)Frames per second

Returns the full path armed, and the recording starts immediately. seconds outside 03600 throws. The containing directory is created if missing.

How the file lands: the viewer delivers a finished recording as a browser download, and the window quietly reroutes the next download to your path - no download bar, no Downloads folder. That reroute is one-shot and armed per StartVideoRecording call, so start recordings one at a time and let each finish.

The codec is the viewer’s choice: h264 MP4 where the OS supports it (Windows does), WebM otherwise - keeping the default .mp4 extension is right in practice.

Stop recording

rtr.StopVideoRecording()          # -> None

Ends a manual recording (seconds=0) and triggers the save to the armed path. Saving is asynchronous: give it a moment before reading the file. Calling it when nothing is recording does nothing.

The turntable, one call

path = rtr.RecordTurntable(r"C:\out\turntable.mp4", seconds=12)   # -> the path armed
ParameterDefaultMeaning
pathrequiredDestination file; .mp4 is appended when there is no extension
seconds8Recording length, 13600
width / height / frameRate0As in StartVideoRecording

The 360 in one call: auto-rotation on, seconds of video recorded to path, and the rotation scheduled back off inside the page when the recording ends — so your script needs no sleeps and the camera is not left spinning. Like every recording, the file appears when the recording finishes, not when the call returns.

from ArtisanPlugin.Scripting import RealtimeRenderApi as rtr

rtr.ShowRealtimeRender()
rtr.UpdateRender()
rtr.SetMaterialByLayer("Metal 01", "YELLOW_GOLD")
rtr.SetViewerCameraPreset("three-quarter")
rtr.RecordTurntable(r"C:\out\turntable.mp4", seconds=12)

The manual recipe — SetViewerOption("autoRotate", "true"), a timed StartVideoRecording, and turning the rotation off yourself — still works when you want camera moves of your own during the take.

For a photoreal (and much slower) turntable through Rhino’s raytracer, see Studio turntables instead.