Bases: sqlalchemy.ext.declarative.Base
A template for Version class.
A VersionType is basically a template object for the Version instances. It gives the information about the filename template, path template and output path template for the Version class. Then the Version class renders this Jinja2 templates and places itself (or the produced files) in to the appropriate folders in the Repository.
All the template variables ( filename, path, output_path) can use the following variables in their template codes.
Variable Name | Variable Source | Description |
---|---|---|
project | version.version_of.project | The project that the Version belongs to |
sequence | version.version_of.sequence | Only available for Shot versions |
version | version | The version itself |
type | version.type | The VersionType instance attached to the this Version |
In oyProjectManager, generally you don’t need to create VersionType instances by hand. Instead, add all the version types you need to your config.py file and the Project instance will create all the necessary VersionTypes from this config.py configuration file. For more information about the the config.py please see the documentation of config.py.
For previously created projects, where a new type is needed to be added you can still create a new VersionType instance and save it to the Projects’ database.
Parameters: |
|
---|
Methods
__init__(name, code, path, filename, ...[, ...]) | |
query() | |
save() | Saves the current VersionType to the database |
Attributes
code | |
environments | A descriptor that presents a read/write view of an object attribute. |
extra_folders | A string containing the extra folder names those needs to be |
filename | The filename template for this type of version instances. |
id | |
metadata | A collection of Table objects and their associated schema constructs. |
name | |
output_path | The output path template for this Type of Version instances. |
path | The path template for this Type of Version instance. |
type_for | An enum attribute holds what is this VersionType created for, a Shot |
The filename template for this type of version instances.
You can freely change the filename template attribute after creating Versions of this type. Any Version which is created prior to this change will not be effected. But be careful about the older and newer Versions of the same Asset or Shot may placed to different folders according to your new template.
The template should not include a dot (”.”) sign before the extension, it is handled by the Version instance.
The path template for this Type of Version instance.
You can freely change the path template attribute after creating Versions of this type. Any Version which is created prior to this change will not be effected. But be careful about the older and newer Versions of the same Asset or Shot may placed to different folders according to your new template.
The path template should be an relative one to the server_path, so don’t forget to place {{project.code}} at the beginning of your template if you are storing all your asset and shots inside the project directory.
If you want to store your assets in one place and use them in several projects, you can do it by starting the path of the VersionType with something like that:
"Assets/{{version.base_name}}/{{type.code}}"
and if your repository path is “/mnt/M/JOBs” then your assets will be stored in:
"/mnt/M/JOBs/Assets"
The output path template for this Type of Version instances.
To place your output path right beside the original version file you can set the output_path to:
"{{version.path}}/Outputs/{{version.take_name}}"
A string containing the extra folder names those needs to be created