Esacode

Docs / Blocks / Simulation

Render

Renders a 3D scene on the worker into frames (pictures) and a video, and streams the frames while it works.

Runs on a worker (Python) Simulation Version 1.0 Code you can open and adapt

How it works

Connect a scene: the output of a 3D scene block (objects, their models and their trajectories) or the trajectories of the Landing sweep. It renders each frame of a run on the worker, at the size and rate you choose, with a camera that follows an object, circles the scene, stays fixed or looks from above, and makes a video with ffmpeg (MP4, WebM or GIF).

Frames go to the Frames output (PNG or JPEG) and can be sent to a dataset as they are made (Outputs go to); about twice a second (less often in long renders) a small copy goes to the Live telemetry output, channel frame, so an Images view (through a Telemetry block) shows the render as it progresses.

Engines: Blender (Cycles, realistic light and shadows) when it is installed on the worker, otherwise the built-in renderer (Python with numpy: quick, simple shading). This is not the 3D view: it runs on the worker, without a browser.

Inputs

InputTakesWhat it is
Scene
scene
3D scene or Files
json, glb, gltf, obj, stl, ply
scene.json (esasim.scene/1) and the 3D files it names Takes several connections.

Outputs

OutputGivesWhat it is
Frames
frames
Files
png, jpg
One picture per frame: frame_00001.png …
Video
video
Files
mp4, webm, gif
The frames as a video
Live telemetry
telemetry
Live telemetryWhat the block sends while it runs, for views such as Chart or 3D view.

Settings

SettingDefaultWhat it does
Engine
engine
auto auto: Blender when it is installed on the worker, otherwise the built-in renderer.
One of: auto, built-in, blender
Runs to render
runs
first
One of: first, all, a number
Run number
run_number
1 With Runs to render = a number.
From 1
Width (pixels)
width
1280
From 64 to 7680
Height (pixels)
height
720
From 64 to 4320
Frames per second
fps
30
From 1 to 120
Speed
speed
1 Seconds of the run per second of video.
From 0.05 to 50
From (s)
start
0
From 0
To (s, 0 = the end)
end
0
From 0
Camera
camera
follow
One of: follow, orbit, fixed, top
Camera looks at
camera_target
empty An object's name (empty: a drone if there is one, otherwise the first object that moves).
Camera position (fixed)
camera_position
empty x,y,z in the scene's units and axes; empty: chosen to frame the scene.
Camera distance
camera_distance
0 For follow and orbit; 0 = from the size of the scene.
From 0
Field of view (degrees)
fov
45
From 5 to 120
Quality
quality
standard Blender: more samples per pixel; built-in: smoother edges.
One of: preview, standard, high
Background
background
sky
One of: sky, studio, night
Draw trajectories
trails
on
Frames
frames_format
png none: only the video.
One of: png, jpg, none
Video
video
mp4
One of: mp4, webm, gif, none
Stream frames while rendering
preview
on
Show the run and the time
overlay
on Written in a corner of every frame.
Blender program
blender
empty Empty: blender on the PATH (or ESASIM_BLENDER).
Install missing Python packages
install
on numpy and Pillow for the built-in renderer, imageio-ffmpeg when ffmpeg is missing: installed with pip into ~/.esasim/python, not into the system Python.

Where it runs

On one of your computers with the EsaSim worker: Any worker, NVIDIA GPU, AMD GPU, Intel GPU, Apple GPU (Metal).

In its code, settings are ctx.params["key"], inputs ctx.inputs["id"] and outputs ctx.output("id", "name.ext"); see Custom blocks.

More in Simulation