ftrack_api.structure.standard
- class ftrack_api.structure.standard.StandardStructure(project_versions_prefix=None, illegal_character_substitute='_')[source]
Project hierarchy based structure that only supports Components.
The resource identifier is generated from the project code, the name of objects in the project structure, asset name and version number:
my_project/folder_a/folder_b/asset_name/v003
If the component is a FileComponent then the name of the component and the file type are used as filename in the resource_identifier:
my_project/folder_a/folder_b/asset_name/v003/foo.jpg
If the component is a SequenceComponent then a sequence expression, %04d, is used. E.g. a component with the name foo yields:
my_project/folder_a/folder_b/asset_name/v003/foo.%04d.jpg
For the member components their index in the sequence is used:
my_project/folder_a/folder_b/asset_name/v003/foo.0042.jpg
The name of the component is added to the resource identifier if the component is a ContainerComponent. E.g. a container component with the name bar yields:
my_project/folder_a/folder_b/asset_name/v003/bar
For a member of that container the file name is based on the component name and file type:
my_project/folder_a/folder_b/asset_name/v003/bar/baz.pdf
- __init__(project_versions_prefix=None, illegal_character_substitute='_')[source]
Initialise structure.
If project_versions_prefix is defined, insert after the project code for versions published directly under the project:
my_project/<project_versions_prefix>/v001/foo.jpg
Replace illegal characters with illegal_character_substitute if defined.
Note
Nested component containers/sequences are not supported.
- sanitise_for_filesystem(value)[source]
Return value with illegal filesystem characters replaced.
An illegal character is one that is not typically valid for filesystem usage, such as non ascii characters, or can be awkward to use in a filesystem, such as spaces. Replace these characters with the character specified by illegal_character_substitute on initialisation. If no character was specified as substitute then return value unmodified.
- get_resource_identifier(entity, context=None)[source]
Return a resource identifier for supplied entity.
context can be a mapping that supplies additional information, but is unused in this implementation.
Raise a
ftrack_api.exeption.StructureError
if entity is not attached to a committed version and a committed asset with a parent context.