Customize Asset Processing with Python Asset Builder
With Python Asset Builder, you can create custom process jobs for assets produced in content creation tools such as Maya and Houdini, or any source asset type with a known file format.
To use Python Asset Builder, you must enable the Python Asset Builder Gem.
Python Asset Builder implementation
Python Asset Builders follow the same design pattern and function of Asset Builders. A Python Asset Builder takes a source asset and produces runtime optimized product assets that are stored in the Asset Cache. Python Asset Builders have three parts:
- Descriptor is a class that provides Asset Processor with the builder’s ID and file patterns for asset types it can process.
- Create Jobs provides a
CreateJobsRequesthandler that produces aCreateJobsResponse. The response contains information that Asset Processor uses to queue job processes for the Python Asset Builder. - Process Job provides a
ProcessJobRequesthandler that produces aProcessJobResponseand generates product assets. The response contains information that Asset Processor needs to place the product assets in the Asset Cache and information used to track the product assets and their product dependencies.
Writing a Python Asset Builder
There are four steps to create a Python Asset Builder:
- Add a Bootstrap Script - Add the Python Asset Builder script to a bootstrap location.
- Create a Descriptor - Add the Descriptor that provides the Asset Builder ID and file patterns and register handlers for job creation and processing.
- Implement Create Jobs - Define logic in the callback method for
CreateJobsthat responds with the job information. - Implement Process Job - Define logic for
ProcessJobto generate product asset files and dependencies.
Bootstrap
Add a Python Asset Builder to a bootstrap.py script.
Descriptor
The Python Asset Builder registers the builder with Asset Processor in Open 3D Engine (O3DE).
CreateJobs
Create process job information for Asset Processor with CreateJobs in Python Asset Builder.
ProcessJob
ProcessJob in Python Asset Builder produces job information for Asset Processor and generates product assets.