pysdic_blender.render_blender_image#

render_blender_image(camera, mesh, *, displacement=None, texture=None, texture_range=(0.0, 255.0), material=None, spotlights=(), arealights=(), background_color=(1.0, 1.0, 1.0), background_strength=1.0, **render_options)[source]#

Render one image of a mesh seen by a camera with Blender: the counterpart of pysdic.generate_synthetic_image() with the lighting and the materials of Cycles (shading, shadows, specular reflections, depth of field).

Creates a BlenderExperiment (which clears the data of Blender) with the camera (see BlenderCamera), the mesh (see BlenderMesh) and the lights, and renders it. For several images of the same scene, use a BlenderExperiment directly (the scene is built once).

Important

Requires bpy. The camera must follow the OpenCV pinhole model without distortion, and the mesh must be a 3D triangle_3 mesh.

Parameters:
Returns:

The linear intensity \((H, W)\), or the RGB image \((H, W, 3)\) with color=True (float64).

Return type:

numpy.ndarray