Skip to content

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)!
  1. Optional. The regex the filename will test against.
  2. Optional. regex the file's parent folders will test against.
  3. Optional. A list of valid file extensions for this type.
  4. One of low, medium, or high (will display as 0, 5, or 9). Higher values process first.
  5. Optional. The default Shotgrid task to use if one cannot be parsed from the filename or parent folders.
  6. 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.
  7. 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)