2.6 KiB
2.6 KiB
User Guide: Usage - Blender Integration
This document explains how to use the optional Blender integration feature of the Asset Processor Tool.
Overview
The Asset Processor Tool can optionally run Blender scripts after processing assets. These scripts automate the creation of PBR node groups and materials in specified .blend files, linking to the processed textures. This feature is available when using the tool via the Command-Line Interface (CLI) or the Graphical User Interface (GUI).
How it Works (User Perspective)
When the Blender integration is enabled and configured, the Asset Processor Tool will:
- Process the input assets and generate the output files, including the
metadata.jsonfile for each asset. - Execute Blender in the background using the specified Blender executable path.
- Run the
blenderscripts/create_nodegroups.pyscript within Blender, passing the path to the processed asset's output directory and the target.blendfile for node groups. This script reads themetadata.jsonand creates/updates PBR node groups in the target.blendfile. - If configured, execute the
blenderscripts/create_materials.pyscript within Blender, passing the path to the processed asset's output directory, the target.blendfile for materials, and the.blendfile containing the node groups. This script reads themetadata.json, creates/updates materials in the target materials.blendfile, and links them to the node groups created in the node group.blendfile.
Enabling and Configuring Blender Integration
In the GUI
- Locate the "Blender Post-Processing" section in the Processing Panel.
- Check the box to enable the Blender integration.
- Input fields and browse buttons will appear for specifying the target
.blendfiles for Node Groups and Materials. These fields will default to the paths configured inconfig.py.
In the CLI
- Use the
--nodegroup-blendoption followed by the path to the target.blendfile for node groups. - Use the
--materials-blendoption followed by the path to the target.blendfile for materials.
Providing either of these options in the CLI will trigger the respective Blender script execution after asset processing. These command-line options override the default paths set in config.py.
Requirements
- A working installation of Blender.
- The path to the Blender executable configured in
config.pyor accessible in your system's PATH. - For the material creation script, the target
.blendfile must contain a template material namedTemplate_PBRMaterialwith a Group node labeledPLACEHOLDER_NODE_LABEL(as defined inblenderscripts/create_materials.py).