Skip to content

Commit

Permalink
Transfer script for automated procgen with Blender to srb_assets su…
Browse files Browse the repository at this point in the history
…bmodule

Signed-off-by: Andrej Orsula <[email protected]>
  • Loading branch information
AndrejOrsula committed Oct 29, 2024
1 parent 1a70c2d commit 137e61a
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 943 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ament_python_install_package(space_robotics_bench)
## Install Python scripts
set(SCRIPTS_DIR scripts)
install(PROGRAMS
${SCRIPTS_DIR}/blender/procgen_assets.py
${SCRIPTS_DIR}/utils/clean_procgen_cache.py
${SCRIPTS_DIR}/utils/tensorboard.bash
${SCRIPTS_DIR}/utils/update_assets.bash
Expand Down
2 changes: 1 addition & 1 deletion assets/srb_assets
4 changes: 2 additions & 2 deletions docs/src/development/new_assets/procgen.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ Blender's [Shader Nodes](https://docs.blender.org/manual/en/latest/render/shader

## Workflow

The package includes a `blender/procgen_assets.py` script that automates the entire procedural generation process, including node construction, modifier application, seeding, texture baking, and model export. This script is fully standalone and interacts with Blender's Python API (`bpy`) through its binary executable. Although Blender can be used as a Python module via [bpy](https://pypi.org/project/bpy), it is often linked to a specific Python version and has longer release cycles. The standalone script offers more flexibility, allowing it to be used with any Blender version.
The [`srb_assets` repository](https://github.com/AndrejOrsula/srb_assets) includes a [`procgen_assets.py`](<(https://github.com/AndrejOrsula/srb_assets/blob/main/scripts/blender/procgen_assets.py)>) script that automates the entire procedural generation process, including node construction, modifier application, seeding, texture baking, and model export. This script is fully standalone and interacts with Blender's Python API (`bpy`) through its binary executable. Although Blender can be used as a Python module via [bpy](https://pypi.org/project/bpy), it is often linked to a specific Python version and has longer release cycles. The standalone script offers more flexibility, allowing it to be used with any Blender version.

Node trees can be generated from Python source files provided as input to the script. The [Node To Python addon](https://extensions.blender.org/add-ons/node-to-python) simplifies the creation of such source code. This addon enables users to design node trees in Blender's graphical interface and convert them into Python code that can be integrated into the `procgen_assets.py` script. This method allows users to prototype assets interactively within Blender's GUI and then export them into code.
Node trees can be generated from Python source files provided as input to the script. The [Node To Python addon](https://extensions.blender.org/add-ons/node-to-python) simplifies the creation of such source code. This addon enables users to design node trees in Blender's graphical interface and convert them into Python code that can be integrated into the [`procgen_assets.py`](<(https://github.com/AndrejOrsula/srb_assets/blob/main/scripts/blender/procgen_assets.py)>) script. This method allows users to prototype assets interactively within Blender's GUI and then export them into code.
23 changes: 0 additions & 23 deletions scripts/blender/__init__.py

This file was deleted.

Loading

0 comments on commit 137e61a

Please sign in to comment.