- Open Blender file named Create_model.blend
- Click in the workspace tab Scripting , then Run Script.
Example 1 | Example 2 |
---|---|
Example 3 | Example 4 |
---|---|
TODO:
- Fix issue with the wrong mesh textures.
This document outlines the unit tests for the Blender script. The tests cover various aspects of the script's functionality, ensuring that it behaves as expected under different scenarios.
- Test STL and image file paths exist
- Test image loading and existence
- Test camera and light creation
- Test mesh import and material assignment
- Test texture coordinate generation and mapping
- Test random mesh transformations
- Test rendering settings configuration
- Test image generation for scenes and angles
- Test image resolution and format
- Test camera removal after rendering
- Test handling of no valid mesh object
- Test error handling for file paths and image loading
- Test image generation limit per scene
- Test scene generation limit
- Test entire script execution end-to-end with different scenarios
To run the unit tests, follow these steps:
- Set up the necessary paths and variables in the
TestBlenderScript
class. - Open the Blender Text Editor.
- Copy and paste the test code into a new script.
- Run the script to execute the unit tests.
This Blender script generates random scenes and renders images of a 3D model. It applies texture color from an image file to the model and creates variations in scene composition.
- Generates random scenes with texture-applied models
- Applies texture color from an image to the model
- Creates variations in mesh transformations and camera angles
- Open the Blender Text Editor.
- Copy and paste the script code into a new script.
- Customize the file paths and parameters as needed.
- Run the script to generate and render random scenes.
For ensuring the functionality and correctness of the script, there are unit tests available. Refer to the Unit Tests document for detailed test cases and instructions on running the tests.
- Blender 3.0 or later
This project is licensed under the MIT License.