reanimate-0.5.0.0: Animation library based on SVGs.

Safe HaskellNone
LanguageHaskell2010

Reanimate.Blender

Description

Blender is a free and open-source 3D graphics toolkit. It is usually used through a graphical user-interface but can also be scripted via Python. These Blender scripts can access 100% of Blender's functionality and offer a convenient way of coding 3D effects.

Running Blender can be time-consuming but heavy caching means scripts are only run when they change.

Blender cheatsheet:

# To generate with a transparent background, set film_transparent = True:
bpy.context.scene.render.film_transparent = True

# Filmic is great for photorealism but bad for animations.
# If you want your textures to keep their exact color values,
# set the view_transform to 'Standard':
bpy.context.scene.view_settings.view_transform = 'Standard'

# Blender's default render engine is 'EEVEE', fast but not a raytracer.
# To switch to raytracing, set the engine to 'CYCLES':
bpy.context.scene.render.engine = 'CYCLES'

# Rendering at full resolution can be slow. When developing, try
# decreasing the resolution_percentage for faster renders.
bpy.context.scene.render.resolution_percentage = 10

# The resolution of the final image are set by resolution_x and resolution_y:
bpy.context.scene.render.resolution_x = 320
bpy.context.scene.render.resolution_y = 180
Synopsis

Documentation

blender :: Text -> SVG Source #

Run a Blender script and embed the resulting image file. The image will be scaled to fit the screen exactly (assuming a default canvas layout). Note that Blender resolution defaults to 1920x1080 but can be changed in the script code.

blender' :: Text -> FilePath Source #

Generate Blender image as a separate PNG file. Can be embedded with mkImage.