ddg.visualization.blender.render module

ddg.visualization.blender.render.set_world_background(color=(1, 1, 1, 1), strength=0.2, world=None)[source]

Set the world background color and emission.

Parameters:
colorSequence of 4 floats between 0 and 1 (default=(1, 1, 1, 1))

Color the background will have.

strengthfloat (default=0.2)

Emission strength of the background.

worldbpy.types.World (default=None)

World to modify. If None, use world of the current scene.

ddg.visualization.blender.render.set_film_transparency(scene=None, transparent=True)[source]

Set the transparency of the render’s film.

Parameters:
scenebpy.types.Scene (default=None)

Scene to apply the render setup to. If None, use the current scene.

transparentbool (default=True)

If True make the film transparent, else use opaque world background.

ddg.visualization.blender.render.setup_eevee_renderer(scene=None, samples=64, shadows_px='128')[source]

Set render settings for the Eevee engine.

Parameters:
scenebpy.types.Scene (default=None)

Scene to which to apply the render settings. If None use the current scene.

samplesint (default=64)

Number of samples.

shadows_pxenum in [“64”, “128”, “256”, “512”, “1024”, “2048”, “4096”],

(default=”128”) Number of pixels to use for rendering of shadows.

ddg.visualization.blender.render.setup_cycles_renderer(scene=None, device='CPU', noise_threshold=0.01, min_samples=0, max_samples=512, time_limit=5, denoise=False, persistent_data=True)[source]

Set render settings for the Cycles engine with adaptive sampling.

Parameters:
scenebpy.types.Scene (default=None)

Scene to which to apply the render settings. If None, use the current scene.

devicestr (default=”CPU”)

Cycles render device, either “CPU” or “GPU”.

noise_thresholdfloat (default=0.01)

The error threshold used in adaptive sampling.

min_samplesint (default=0)

Minimum number of samples.

max_samplesint (default=512)

Minimum number of samples.

time_limitfloat (default=5)

Maximum time of a render. Zero means no time limit.

denoisebool (default=False)

Whether or not to denoise the output after render.

persistent_databool (default=True)

Whether or not to keep render data for faster re-renders and animation renders.

ddg.visualization.blender.render.set_render_output_images(output_path, time=True, scene=None, file_format='PNG', alpha=True, quality=100)[source]

Set the rendering output for an image sequence.

Unless time=False, each time this function is called a new timestamp is set, and the output images will be saved under {output_path}/{timestamp}/ in order to isolate renders between sessions.

Parameters:
output_pathstr

The directory path to which to save to ouput.

timebool (default=True)

Whether or not to create a timestamp subdirectory and save the rendered images under it.

scenebpy.types.Scenes (default=None)

The scene to which to apply the settings. If None use the current scene.

file_formatstr (default=”PNG”)

The file format of the images. In upper letters. For example ‘PNG’ or ‘JPEG2000’

alphabool (default=True)

Whether to use alpha in the output image.

qualityint (default=100)

Quality of the output image in percent.

See also

render_animation
ddg.visualization.blender.render.render_frame(frame, full_path, camera=None)[source]

Render a frame to full_path.

Parameters:
frameint

Frame to use for the render.

full_pathstr

Output path with file name and extension.

camerabpy.types.Camera (default=None)

Camera to use for the render. If None use the current scene camera.

ddg.visualization.blender.render.render_animation(path, start=None, end=None, camera=None)[source]

Render all frames between start and end to path.

Parameters:
pathstr

Path of the output.

startint (default=None)

Start frame. If None use current scene start frame.

endint (default=None)

End frame. If None use current scene end frame.

camerabpy.types.Camera (default=None)

Camera to use for the render. If None, use the current scene camera.