[GUIDE] How to Properly Connect Shotgun / Shotgrid / Flow / SG / FPT with Deadline

Hello all!

For the last couple of days, I’ve been fighting with Deadline to properly post Draft movies to our instance. Given that there’s no up to date documentation on the matter, I felt I could craft a guide to help any newcomer with this matter.

Step 1: Update the Shotgun Plugin to use API Scripts instead of Human Users

  1. Navigate to your repository at /repository/events/Shotgun/Shotgun.py.

  2. Update the GetShotgunForEventPlugin function with the following code:

    def GetShotgunForEventPlugin(url, proxy, config):
        if LoginInfo.ShotgunInstance:
            try:
                LoginInfo.ShotgunInstance.find_one("Project", filters=[])
                return LoginInfo.ShotgunInstance
            except:
                pass
        name = SafeEncode(config.GetConfigEntry('ShotgunScriptName'))
    
        dataController = DeadlineApplicationManager.GetBaseInstance().DataController
        secretsManagementEnabled = dataController.SecretsManagementEnabled
        if secretsManagementEnabled:
            key = SafeEncode(dataController.SecretsManagementController.GetSecret('/events/Shotgun/ShotgunScriptKey'))
        else:
            key = SafeEncode(config.GetConfigEntry('ShotgunScriptKey'))
    
        if proxy == b"":
            proxy = None
    
        sgObject = shotgun_api3.shotgun.Shotgun(url, name.decode("utf-8"), key.decode("utf-8"), True, proxy, connect=False)
        LoginInfo.Debug("Connected to Shotgun using API key")
        return sgObject
    

    Big thanks to @Mayaenite for this snippet I found on this thread Deadline can't authenticate script deadline_integration - #10 by Mayaenite

Step 2: Create a new Script in SG/FPT

  1. Go to your SG/FPT instance as an admin.
  2. Click on your profile picture in the top right corner and go to the Scripts page.
  3. Create a new script. You can use the default API Admin user or adjust the permissions as needed. Also check Generate Events to keep track on what the script user is doing.
  4. Copy the API key now since you won’t see it again. If you forget, you’ll need to generate a new one.

Step 3: Configure the SG/FPT integration

  1. Open your Deadline Monitor, log in as Power User.

  2. Navigate to Tools > Configure Events....

  3. Select the Shotgun integration and fill out the form with your API user and other required information.

  4. Ensure the Create Version on Submission flag is set to TRUE.

    Here are my settings for reference:

Step 4: Fix the issue where Draft is not publishing the movie to SG/FPT

If you followed the old documentation, you’ll find that Draft is not publishing the movie to SG/FPT with a warning similar to this one despite marking the job as successful:

WARNING: Could not find an associated Shotgun Version ID.  The Draft output will not be uploaded to Shotgun.

This is due to not all Extra Info fields the code is referring to are listed in the documentation.

  1. Go to Tools > Configure Repository Options....
  2. Click on Job Settings, then on the Job Extra Properties tab.
  3. Add the following extra info fields per the screenshot (you might not need all tokens, but better safe than sorry :wink: ):

If you have any questions, comments to help improve this guide; or run into any issues, feel free to reach out!

5 Likes