File Types
File Types configure how Slingshot determines what type of file each item is.
Configuration¶
ingest:
file_types:
- name: shot
examples: [101_010_0010_v001.mov, 201_200_0200_v0002.mp4] # (7)!
regex: ^(?P<version_name>(?P<shot>\d{3}_\d{3}_\d{4})_v\d{3,4}) # (1)!
parent_folders_regex: null # (2)!
extensions: # (3)!
- mov
- mp4
priority: 9 # (4)!
default_task: null # (5)!
var_map: null # (6)!
- Optional. The regex the filename will test against.
- Optional. regex the file's parent folders will test against.
- Optional. A list of valid file extensions for this type.
- One of
low
,medium
, orhigh
(will display as0
,5
, or9
). Higher values process first. - Optional. The default Shotgrid task to use if one cannot be parsed from the filename or parent folders.
- A mapping of filename values to template values. For example, filenames may contain the string "dev" but you want them to download to a folder called
Development
. You can map dev to Development here. It's a whole thing. We'll get into it. Todo. -
Examples are a list of sample filenames for this file type. If no examples are provided, three will be generated randomly from the configured regexes.
If examples are provided, they will be validated to make sure they match the current file type as configured. They'll also be checked to make sure they don't match any earlier, higher priority file_types.
Order Matters
Slingshot searches for matches from the top down, in the order configured. Once it finds a first match it stops searching.
If no match is found, the item type remains None
and the item will not be processed.
You can add a catch all, other
file_type last if you need to match any file.
Regular Expressions¶
TODO: explain how this works. Mention regexr.com.
Talk about how any named capture groups here can be used as variables in action modules.
Capture groups¶
Shotgrid¶
- version_name (required)
- task (optional)