### Testing with Bazel Source: https://github.com/oqton/blenderless/blob/master/README.md Execute all tests for the Blenderless project using Bazel. ```sh bazel test //... ``` -------------------------------- ### Command-Line Interface: Render Geometry to GIF Source: https://github.com/oqton/blenderless/blob/master/README.md Use the command-line interface to render a geometry file (STL) to a GIF animation, creating a camera loop around an object. ```sh bazel run //blenderless -- gif /path/to/foo.stl /path/to/output.gif ``` -------------------------------- ### Command-Line Interface: Render YAML Config to Image Source: https://github.com/oqton/blenderless/blob/master/README.md Use the command-line interface to render a scene defined in a YAML configuration file to an image. ```sh bazel run //blenderless -- config /path/to/scene.yml /path/to/output.png ``` -------------------------------- ### Command-Line Interface: Render Geometry to Image Source: https://github.com/oqton/blenderless/blob/master/README.md Use the command-line interface to render a geometry file (STL) to an image file (PNG). Optionally export the generated .blend file. ```sh bazel run //blenderless -- image /path/to/foo.stl /path/to/output.png ``` ```sh bazel run //blenderless -- --export-blend-path /path/to/export.blend image /path/to/foo.stl /path/to/output.png # If .blend needs to be exported ``` -------------------------------- ### Python Module Usage Source: https://github.com/oqton/blenderless/blob/master/README.md Demonstrates how to use the Blenderless Python module for rendering single STL files, from configuration files, and for generating GIF animations. Set 'export_blend_path' to export the generated Blender workspace. ```python from blenderless import Blenderless # Set the following property if you want to export the generated blender workspace. Blenderless.export_blend_path = 'export.blend' # Render single STL file path_to_foo_png = Blenderless.render('meshpath.stl', dest_path=None, azimuth=45, elevation=30, theta=0) # Render from config, note that objects and cameras are defined within the YAML config. path_to_foo_png = Blenderless.render_from_config('config.yml', dest_path=None) # Render GIF animation, note that azimuth is defined by number of frames. path_to_foo_gif = Blenderless.gif(cls, mesh_path, dest_path=None, elevation=30, theta=0, frames=60, duration=2) ``` -------------------------------- ### YAML Configuration for Advanced Scenes Source: https://github.com/oqton/blenderless/blob/master/README.md Defines an advanced scene using YAML, specifying camera coordinates, mesh paths, and materials. Supports referencing presets and custom labels. ```yaml scene: # See options in blenderless.scene.Scene preset_path: ../../preset.blend cameras: # See options in blenderless.camera - _target_: blenderless.camera.SphericalCoordinateCamera # Instantiate one camera with following arguments azimuth: 45 elevation: 30 theta: 0 distance: 1 objects: # See blenderless.geometry and blenderless.material - _target_: blenderless.geometry.Mesh # Refers to classes within the blenderless package mesh_path: ../../mesh/3DBenchy.stl # Constructor argument material: # Constructor argument pointing towards another class within the blenderless package _target_: blenderless.material.MaterialFromName material_name: test_material # Link to material name known in present.blend - _target_: blenderless.geometry.BlenderLabel label_value: '42' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.