Creation, distribution and testing of Avalon example projects.
These projects are used in the Getting Started guide, along with during continous integration for end-to-end tests. The repository contains functionality for generating projects per "recipe" under varying configurations.
Data in Avalon is partitioned into files on disk and documents in a database. Files are available as-is, whereas database documents are stored in a serialised form which requires uploading.
$ python import.py batman
The above command will import the batman
example project into your database such that you may use it like any normal project.
Projects are created by (1) creating and publishing assets and (2) exporting the corrseponding database.
Thing to keep in mind.
- Avoid referencing absolute paths. Instead, utilise the
AVALON_PROJECTS
environment variable, referencing the global directory in which all of your projects are stored.
Once you have created a project you would like to distribute, we'll do an "export" of the contents within the database.
$ python export.py my_project
Congratulations, your project is now ready for distribution!
A project can be procedurally generated by automatically publishing application-files.
As opposed to merely exporting/importing a given (fixed) database, a procedural project takes into account your .config.toml
file and publishes files according to the given configuration
.
In a procedural project, application files are known as "resources" and reside within the resources/
directory. Each project contains a .recipe.json
detailing the process of generating a given project.
Example
Here is what a recipe might look like for a project called "batman".
[
{
"message": "Modeling..",
"session": {
"app": "mayapy2016",
"asset": "Bruce",
"silo": "assets",
"config": "polly",
"task": "modeling"
},
"resources": [
"model_v001.ma",
"model_v002.ma",
"model_v003.ma"
]
},
{
"message": "Rigging..",
"session": {
"app": "mayapy2016",
"asset": "Bruce",
"silo": "assets",
"config": "polly",
"task": "rigging"
},
"resources": [
"rig_v003.ma",
"rig_v006.ma"
]
},
{
"message": "Animating..",
"session": {
"app": "mayapy2016",
"asset": "shot1",
"silo": "film",
"config": "polly",
"task": "animation"
},
"resources": [
"anim_v002.ma",
"anim_v006.ma",
"anim_v012.ma",
"anim_v034.ma"
]
}
]
Each item in this list is known as a job
and each job
is run sequentially via build.py
.
$ python build.py batman
# Modeling..
# processing 'model_v001.ma'..
# processing 'model_v002.ma'..
# processing 'model_v003.ma'..
# Rigging..
# processing 'rig_v003.ma'..
# processing 'rig_v006.ma'..
# Animating..
# processing 'anim_v002.ma'..
# processing 'anim_v006.ma'..
# processing 'anim_v012.ma'..
# processing 'anim_v034.ma'..
In order to create a procedural project, you'll first create your project as per usual, and then "lift" the contained files into a resource directory, such as `resources/my_project/my_file.ma".