0

Shotgun Toolkit: Folder Schema for Shot Related Assets

Hi,

We are in the midst of adjusting shotgun's default folder schema in a sandbox config. Our problem is that our current pipeline places assets linked to shots under the {Shot} folder, i.e.

Project
-assets
-sequence
--shot
---steps
---assets

 

The trouble is, how do I make a yml file that will locate all the related assets and localize said files?

 

my current yml files looks like this:

# Copyright (c) 2013 Shotgun Software Inc.
# 
# CONFIDENTIAL AND PROPRIETARY
# 
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit 
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your 
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights 
# not expressly granted therein are reserved by Shotgun Software Inc.

# the type of dynamic content
type: "shotgun_list_field"

# the shotgun entity type to connect to
entity_type: "Asset"

# switch this to true if you only want to make folders for
# values that are being used. Note that evaluating this is 
# expensive and may potentially slow down folder creation.
skip_unused: false 

# the shotgun field to use for the folder name
field_name: "sg_asset_type"
filters: [ { "path": "shots", "relation": "in", "values": [ "$Shot" ] } ]


 

I took and copied the structure currently used the default assets schema. Is there a place where filters are explained in more detail? Is the filter reference for api the same as the toolkit filters? How do I know which folders/entities are dynamic(i.e. $Shot).

 

Thanks.

2 comments

  • 0
    Avatar
    Permanently deleted user

    Hello Ken!

    That's a great question! 

    The filters syntax follows the syntax used in the Shotgun API, so if you are familiar with the Shotgun API, it should be quick to pick up. The $Shot token in your example refers to a Shotgun Entity Type (e.g. Project, Sequence, Shot, Asset etc) which is a parent of the current folder schema level. The folder creation code will replace the $Shot bit with the current parent entity link, e.g. something like { "type": "Shot", "name": "abc123", "id": 123 }. This reference syntax makes it possible to limit the folders you want to create at a certain level by some parent node - like for example creating all the shot folders for a given sequence.

    In Shotgun, there is a way to tell the system which Shots are associated with which Assets - or vice versa which Asset are associated with a Shot. Unfortunately, Toolkit doesn't have great support for this at the moment. Because the standard relationships in Shotgun are what we refer to as Multi Entity fields, each Shot may have several child asset and each asset may have several associated Shots. This creates a conundrum; under which shot should the folder X be created if asset X is associated with both Shot A and B? Officially supporting Shot specific assets is fairly high up on our roadmap and is something we have talked about for some time now, but we don't have a great way to deal with the many-to-many relationship between Shots and Assets at the moment.

    One way to implement this right now is if you created a Shot link field on Asset, so that each asset could have a a single shot as a parent - this would be similar to the Sequence/Shot setup and could be configured in Tookit! But is this the sort of structure you are after? 

    Thanks!
    Manne

     

  • 0
    Avatar
    Burak Ertekin

    Hello,I'm having some trouble creating shot related asset folders.

    Currently, I'm dividing my assets into two types: general and shotbased. If it was assigned to any shots, a folder which specifies the shot will be created and this asset will be placed in this folder. And if not, this asset will go under general.

    I have placed shot.yml and shot folder under asset_type, and asset.yml and asset folder under shot.

     

    My shot.yml filter is:

    filters:
        - { "path": "sg_asset_type", "relation": "is", "values": ["SHOTBASED_ASSETS"]}

    and my asset.yml filter is

    filters:
        - { "path": "project", "relation": "is", "values": [ "$project" ] }

     

    However, I'm receiving this error:

    API read() Shot.sg_asset_type doesn't exist:
    {"path"=>"sg_asset_type", "values"=>["SHOTBASED_ASSETS"], "relation"=>"is"}
    The current environment is shotgun_asset.

     

    What am I missing here?

    Thanks a lot!

Please sign in to leave a comment.