0

Query All Asset names for project into string list

I'm new to shotgun and I'm looking to do something rather simple. I was wondering if someone could help me get started. 

How can I query all the asset names for a project into a string list?

In this case I'm using the demo project AAA Game, so the list returned should look something like this...

fast_run_male_01
Soldier_Crouch_Nav_FWD_839938_MocapPass
Soldier_Nav_IdleBase_MocapPass
gear_jiggle_SFX
male_infantry01_base_model
crashed_icebreaker...etc

1件のコメント

  • 0
    Avatar
    Sergio Fernandez

    #!/usr/bin/env python

    # --------------------------------------
    # Imports
    # --------------------------------------
    import shotgun_api3
    from shotgun_api3 import Shotgun
    import shotgun_api3 as api
    import os
    import sys
    import subprocess
    import time
    from ConfigParser import ConfigParser
    from pprint import pprint # useful for debugging

    SERVER_PATH = "your url"
    SCRIPT_NAME = 'scriptnamehere'
    SCRIPT_KEY = 'script key here'

    if __name__ == '__main__':

    sg = shotgun_api3.Shotgun(SERVER_PATH, SCRIPT_NAME, SCRIPT_KEY)

    project_name = 'your project name'

    sg_shots = sg.find("Task", [['project.Project.name', 'is', project_name]])

    result = sg_shots

    pprint(result)

ログインしてコメントを残してください。