This function will add the necessary steps to render a Blender scene and save the rendering to an image file. Note that this process requires you have a camera and a light source in your scene!

add_render_image(script, filepath, ...)

Arguments

script

The Python script to append the generated code onto.

filepath

The file path to save the output file to. Note that the file format to use is inferred from the file extension; using non-standard or abbreviated extensions might result in render errors. Allowed formats include BMP, IRIS, PNG, JPEG, JPEG2000, TARGA, TARGA_RAW, CINEON, DPX, OPEN_EXR_MULTILAYER, OPEN_EXR, HDR, TIFF, AVI_JPEG, AVI_RAW, FRAMESERVER, H264, FFMPEG, THEORA, XVID.

...

Any additional options to pass to `bpy.ops.render.render`.

Value

A length 1 character vector containing the Blender Python script with render-to-image code added.