Shotgrid Toolkit Engine for Gaffer

Overview

build Code style: black

Shotgun toolkit engine for Gaffer

Contact : Diego Garcia Huerta

tk-gaffer_04

Overview

Implementation of a shotgun engine for Gaffer. It supports the classic bootstrap startup methodology and integrates with Gaffer adding a new Shotgun Menu in the main Gaffer tool-bar.

With the engine, hooks for most of the standard tk applications are provided:

More:

Disclaimer

This engine has been developed and tested in Windows 10 using Gaffer version 0.59.0 You can find this the port to windows in Eric Mehl github Gaffer repository: Gaffer Windows

The engine has not been used in production before so use it at your own risk. Also keep in mind that some of the hooks provided might need to be adapted to your work flows and pipelines. If you use it in production, I would love to hear about it, drop me a message in the contact link at the top of this documentation.

Engine Installation

When I started using shotgun toolkit, I found quite challenging figuring out how to install and configure a new tk application or a new engine. Shotgun Software provides extensive documentation on how to do this, but I used to get lost in details, specially with so many configuration files to modify.

If you are familiar with how to setup an engine and apps, you might want to skip the rest of this document, just make sure to check the templates and additions to the configs that might give you a good start. Also be sure tocheck the options available for this engine here:

Gaffer engine options

If you are new to shotgun, I also recommend to read at least the following shotgun articles, so you get familiar with how the configuration files are setup, and the terminology used:

Here are detailed instructions on how to make this engine work assuming you use a standard shotgun toolkit installation and have downloaded shotgun desktop.

Shotgun Desktop Download Instructions

Also an amazing resource to look for help when configuring your engine, is the Shotgun Community Forums, specifically under Pipeline Integrations category.

Finally, this link contains the technical reference for Shotgun toolkit and related technologies, a great effort to collate all the tech documentation in a single place:

Shotgun's Developer Documentation

Configuring your project for Shotgun Toolkit

If you haven't done it yet, make sure you have gone through the basic steps to configure your project to use shotgun toolkit, this can be done in shotgun desktop app, by:

  • enter into the project clicking it's icon

  • click on the user icon to show more options (bottom right)

  • click on Advanced project setup

    advanced_project_setup

  • Select a configuration: "Shotgun Default" or pick an existing project that you have already setup pages and filters for. select_a_project_configuration

  • Select a Shotgun Configuration: select "default" which will download the standard templates from shotgun. (this documentation is written assuming you have this configuration) select_a_shotgun_configuration

  • Define Storages: Make sure you name your first storage "primary", and a choose a primary folder where all the 'jobs' publishes will be stored, in this case "D:\demo\jobs" for illustrative purposes. define_storages

  • Project Folder Name: This is the name of the project in disk. You might have some sort of naming convention for project that you might follow, or leave as it is. (My advice is that you do not include spaces in the name) project_folder_name

  • Select Deployment: Choose "Centralized Setup". This will be the location of the configuration files (that we will be modifying later). For example, you could place the specific configuration for a project (in this example called game_config) within a folder called "configs" at the same level then the jobs folder, something like:

├───jobs
└───configs
    └───game_config
        ├───cache
        ├───config
        │   ├───core
        │   │   ├───hooks
        │   │   └───schema
        │   ├───env
        │   │   └───includes
        │   │       └───settings
        │   ├───hooks
        │   │   └───tk-multi-launchapp
        │   ├───icons
        │   └───tk-metadata
        └───install
            ├───apps
            ├───core
            ├───engines
            └───frameworks

(Note that this might not be suitable for more complex setups, like distributed configurations) select_deployment

Modifying the toolkit configuration files to add this engine and related apps

Every pipeline configuration has got different environments where you can configure apps accordingly. (for example you might want different apps depending if you are at an asset context or a shot context. The configured environments really depend on your projects requirements. While project, asset, asset_step, sequence, shot, shot_step, site are the standard ones, it is not uncommon to have a sequence_step environment or use a episode based environment either.

I've included a folder called 'config' in this repository where you can find the additions to each of the environments and configuration YAML files that come with the default shotgun toolkit configuration repository (as of writing)

configuration additions

These YAML files provided should be merged with the original ones as they won't work on their own.

As an example, for the location of the engine, we use a git descriptor that allows up to track the code from a git repository. This allows easy updates, whenever a new version is released. So in the example above, you should modify the file: .../game_config/config/env/includes/engine_locations.yml

and add the following changes from this file: engine_locations.yml

# Gaffer
engines.tk-gaffer.location:
  type: git
  branch: master
  path: https://github.com/diegogarciahuerta/tk-gaffer.git
  version: v1.0.0

Do not forget to update the version of the engine to the latest one. You can check here which one is the latest version

In your environments you should add tk-gaffer yml file, for example in the asset_step yml file: /configs/game_config/env/asset_step.yml

Let's add the include at the beginning of the file, in the 'includes' section:

- ./includes/settings/tk-gaffer.yml

Now we add a new entry under the engines section, that will include all the information for our Gaffer application:

  tk-gaffer: "@settings.tk-gaffer.asset_step"

And so on.

Finally, do not forget to copy the additional tk-gaffer.yml into your settings folder.

Modifying the Templates

The additions to config/core/templates.yml are provided also under the config directory of this repository, specifically:

templates.yml

Modifying the Directory Schema

Also I have decided to configure the sequence_step environment for this engine, so there are additions to the directory structure schema that might need to be added if you are not already using that environment. (note that they follow the standard schema setup from shotgun and might need to be adjusted to your pipeline needs)

directory schema additions

Configuring Gaffer in the software launcher

In order for our application to show up in the shotgun launcher, we need to add it to our list of software that is valid for this project.

  • Navigate to your shotgun URL, ie. example.shotgunstudio.com, and once logged in, clink in the Shotgun Settings menu, the arrow at the top right of the web page, close to your user picture.

  • Click in the Software menu select_a_project_configuration

  • We will create a new entry for Gaffer, called "Gaffer" and whose description can be conveniently copy and pasted from the Gaffer website

create_new_software

  • We now should specify the engine this software will use. "tk-gaffer"

software_specify_engine

  • Note that you can restrict this application to certain projects by specifying the project under the projects column. If no projects are specified this application will show up for all the projects that have this engine in their configuration files.

If you want more information on how to configure software launches, here is the detailed documentation from shotgun.

Configuring software launches

Caching and downloading the engine into disk

One last step is to cache the engine and apps from the configuration files into disk. Shotgun provides a tank command for this.

Tank Advanced Commands

  • Open a console and navigate to your pipeline configuration folder, where you will find a tank or tank.bat file. (in our case we placed the pipeline configuration under D:\demo\configs\game_config)

  • type tank cache_apps , and press enter. Shotgun Toolkit will start revising the changes we have done to the configuration YAML files and downloading what is requires.

tank_cache_apps

Gaffer engine should be ready to use

If we now go back and forth from our project in shotgun desktop ( < arrow top left if you are already within a project ), we should be able to see Gaffer as an application to launch.

engine_is_configured

Gaffer engine options

GAFFER_BIN_DIR: defines where the gaffer executable directory is. This is used in case you decide to install Gaffer in a different location than the default. Note that the toolkit official way to achieve the same is by using tk-multi-launchapp, but for less complicated cases, this environment variable should be sufficient.

SGTK_GAFFER_CMD_EXTRA_ARGS: defines extra arguments that will be passed to executable when is run.

Command Line reference

Toolkit Apps Included

tk-multi-workfiles2

tk-gaffer_07

This application forms the basis for file management in the Shotgun Pipeline Toolkit. It lets you jump around quickly between your various Shotgun entities and gets you started working quickly. No path needs to be specified as the application manages that behind the scenes. The application helps you manage your working files inside a Work Area and makes it easy to share your work with others.

Basic hooks have been implemented for this tk-app to work. open, save, save_as, reset, and current_path are the scene operations implemented.

Check the configurations included for more details:

additions to the configs

tk-multi-snapshot

tk-gaffer_08

A Shotgun Snapshot is a quick incremental backup that lets you version and manage increments of your work without sharing it with anyone else. Take a Snapshot, add a description and a thumbnail, and you create a point in time to which you can always go back to at a later point and restore. This is useful if you are making big changes and want to make sure you have a backup of previous versions of your scene.

Hook is provided to be able to use this tk-app, similar to workfiles2.

tk-multi-loader2

tk-gaffer_01

The Shotgun Loader lets you quickly overview and browse the files that you have published to Shotgun. A searchable tree view navigation system makes it easy to quickly get to the task, shot or asset that you are looking for and once there the loader shows a thumbnail based overview of all the publishes for that item. Through configurable hooks you can then easily reference or import a publish into your current scene.

Hook for this tk app supports any PublishedFile with an extenstion that a Scene Reader or Image Reader nodes support. For example Alembic Caches, USD, EXR or any other common image formats.

tk-multi-publish2

tk-gaffer_03

The Publish app allows artists to publish their work so that it can be used by artists downstream. It supports traditional publishing workflows within the artist’s content creation software as well as stand-alone publishing of any file on disk. When working in content creation software and using the basic Shotgun integration, the app will automatically discover and display items for the artist to publish. For more sophisticated production needs, studios can write custom publish plugins to drive artist workflows.

The basic publishing of the current session is provided as hooks for this app.

tk-multi-breakdown

tk-gaffer_02

The Scene Breakdown App shows you a list of items you have loaded in your script and tells you which ones are out of date. Scene reader and Image reader nodes are scanned for file paths that represent published files. Updating those nodes with newer versions of the publishes is supported by this engine.

Hook is provided to display and update the items in teh Gaffer script that represent publishes.

tk-multi-setframerange

tk-gaffer_05

This is a simple yet useful app that syncs your current file with the latest frame range in Shotgun for the associated shot. If a change to the cut has come in from editorial, quickly and safely update the scene you are working on using this app. Towards the end, it will display a UI with information about what got changed.

Hook is provided to set the frame range for the current Gaffer script for a shot_step environment.

As always, please adjust this logic accordingly to however you want to handle frame ranges in your pipeline.

Development notes

The way this engine works is via a Gaffer script that is run as soon as Gaffer initializes and triggers the instancing of the Gaffer toolkit engine. Once the engine is up and running, the menus are created using Gaffers MenuDefinition functionality.

A few tricks are used to display the menu in the correct way. Gaffer is a multi document application, you can have multiple gaffer scripts opened at the same time from a single Gaffer python instance, which made a bit complicated the management of the engine context. Context is swapped to the corresponding one (if appropiate) when the menu button is clicked, which could show as a really small delay for the menu to show.

Also at Gaffer startup, there is a chance that a user could click in the menu while the engine is still loaded. This is resolved by showing a temporary menu indicating that the engine is still loading and then showing the real menu after this has finished loading.

Gaffer seems to be compiled with the minimum amount of python standard libraries, which made development of this engine quite complicated at first. Shotgun Toolkit makes uses of the standard library sqlite3, but unfortunately it was not included in the default distribution of Gaffer 0.57.x<0.60.x, at the very least in Windows. I resorted to recompiling it and including it in the repo, although ideally Gaffer python distribution is complete and there is no need for this workaround. As of version 0.60.7.0 this seems to be resolved and the import works as expected, I left the aforementioned functionality just in case anyone is using earlier versions of Gaffer Windows.

Thanks to Eric Mehl (and the other people involved) for the massive effort that might have been porting Gaffer to Windows. He was the one that put me in the right track with sqlite3, which for the longest was the main blocker for this engine to exist.

Gaffer Community


For completion, I've kept the original README from shotgun, that include very valuable links:

Documentation

This repository is a part of the Shotgun Pipeline Toolkit.

Using this app in your Setup

All the apps that are part of our standard app suite are pushed to our App Store. This is where you typically go if you want to install an app into a project you are working on. For an overview of all the Apps and Engines in the Toolkit App Store, click here: https://support.shotgunsoftware.com/entries/95441247.

Have a Question?

Don't hesitate to contact us! You can find us on [email protected]

You might also like...
A powerful workflow engine implemented in pure Python

Spiff Workflow Summary Spiff Workflow is a workflow engine implemented in pure Python. It is based on the excellent work of the Workflow Patterns init

Crab is a flexible, fast recommender engine for Python that integrates classic information filtering recommendation algorithms in the world of scientific Python packages (numpy, scipy, matplotlib).

Crab - A Recommendation Engine library for Python Crab is a flexible, fast recommender engine for Python that integrates classic information filtering r

A Python library for the Docker Engine API

Docker SDK for Python A Python library for the Docker Engine API. It lets you do anything the docker command does, but from within Python apps – run c

Tesseract Open Source OCR Engine (main repository)

Tesseract OCR About This package contains an OCR engine - libtesseract and a command line program - tesseract. Tesseract 4 adds a new neural net (LSTM

Jinja is a fast, expressive, extensible templating engine.

Jinja is a fast, expressive, extensible templating engine. Special placeholders in the template allow writing code similar to Python syntax.

🛠️ Learn a technology X by doing a project  - Search engine of project-based learning
🛠️ Learn a technology X by doing a project - Search engine of project-based learning

Learn X by doing Y 🛠️ Learn a technology X by doing a project Y Website You can contribute by adding projects to the CSV file.

Python binding to Modest engine (fast HTML5 parser with CSS selectors).

A fast HTML5 parser with CSS selectors using Modest engine. Installation From PyPI using pip: pip install selectolax Development version from github:

GraphQL is a query language and execution engine tied to any backend service.

GraphQL The GraphQL specification is edited in the markdown files found in /spec the latest release of which is published at https://graphql.github.io

GraphQL Engine built with Python 3.6+ / asyncio
GraphQL Engine built with Python 3.6+ / asyncio

Tartiflette is a GraphQL Server implementation built with Python 3.6+. Summary Motivation Status Usage Installation Installation dependencies Tartifle

tartiflette-aiohttp is a wrapper of aiohttp which includes the Tartiflette GraphQL Engine, do not hesitate to take a look of the Tartiflette project.
tartiflette-aiohttp is a wrapper of aiohttp which includes the Tartiflette GraphQL Engine, do not hesitate to take a look of the Tartiflette project.

tartiflette-aiohttp is a wrapper of aiohttp which includes the Tartiflette GraphQL Engine. You can take a look at the Tartiflette API documentation. U

ASGI support for the Tartiflette GraphQL engine
ASGI support for the Tartiflette GraphQL engine

tartiflette-asgi is a wrapper that provides ASGI support for the Tartiflette Python GraphQL engine. It is ideal for serving a GraphQL API over HTTP, o

A Python library for the Docker Engine API

Docker SDK for Python A Python library for the Docker Engine API. It lets you do anything the docker command does, but from within Python apps – run c

Apache Spark - A unified analytics engine for large-scale data processing

Apache Spark Spark is a unified analytics engine for large-scale data processing. It provides high-level APIs in Scala, Java, Python, and R, and an op

ChatterBot is a machine learning, conversational dialog engine for creating chat bots
ChatterBot is a machine learning, conversational dialog engine for creating chat bots

ChatterBot ChatterBot is a machine-learning based conversational dialog engine build in Python which makes it possible to generate responses based on

CPU inference engine that delivers unprecedented performance for sparse models
CPU inference engine that delivers unprecedented performance for sparse models

The DeepSparse Engine is a CPU runtime that delivers unprecedented performance by taking advantage of natural sparsity within neural networks to reduce compute required as well as accelerate memory bound workloads. It is focused on model deployment and scaling machine learning pipelines, fitting seamlessly into your existing deployments as an inference backend.

DeepSpeech is an open source embedded (offline, on-device) speech-to-text engine which can run in real time on devices ranging from a Raspberry Pi 4 to high power GPU servers.

Project DeepSpeech DeepSpeech is an open-source Speech-To-Text engine, using a model trained by machine learning techniques based on Baidu's Deep Spee

ChatterBot is a machine learning, conversational dialog engine for creating chat bots
ChatterBot is a machine learning, conversational dialog engine for creating chat bots

ChatterBot ChatterBot is a machine-learning based conversational dialog engine build in Python which makes it possible to generate responses based on

Minecraft clone using Python Ursina game engine!
Minecraft clone using Python Ursina game engine!

Minecraft clone using Python Ursina game engine!

:mag: Ambar: Document Search Engine
:mag: Ambar: Document Search Engine

🔍 Ambar: Document Search Engine Ambar is an open-source document search engine with automated crawling, OCR, tagging and instant full-text search. Am

Releases(v1.0.0)
Owner
Diego Garcia Huerta
💾 VFX | Animation Pipeline and production tools developer.
Diego Garcia Huerta
BMP180 sensor driver for Home Assistant used in Raspberry Pi

BMP180 sensor driver for Home Assistant used in Raspberry Pi Custom component BMP180 sensor for Home Assistant. Copy the content of this directory to

747Developments 1 Dec 17, 2021
智能无人机路径规划仿真系统是一个具有操作控制精细、平台整合性强、全方向模型建立与应用自动化特点的软件

Drone智能无人机路径规划仿真系统是一个具有操作控制精细、平台整合性强、全方向模型建立与应用自动化特点的软件。它以A、B两国在C区开展无人机战争为背景,该系统的核心功能是通过仿真平台规划无人机航线,并进行验证输出,数据可导入真实无人机,使其按照规定路线精准抵达战场任一位置,支持多人多设备编队联合行动。

wwy 349 Jan 03, 2023
Resmed_myair_sensors - This is a Home Assistant custom component to pull daily CPAP data from ResMed's myAir service using an undocumented API

resmed_myair This component will set up the following platforms. Platform Description sensor Show info from the myAir API. Installation Using the tool

Preston Tamkin 17 Dec 29, 2022
Pylorawan is a Micropython wrapper for lorawan devices from RAK Wireless.

pylorawan Pylorawan is a Micropython wrapper for lorawan devices from RAK Wireless. Tested on a Raspberry PI Pico with a RAK4200(H) Evaluation Board (

Peter Houghton 3 Nov 04, 2022
Raspberry Pi Power Button - Wake/Power Off/Restart(Double Press)

Control Raspberry pi with physically attached button. Wake, Power Off, and Restart (Double Press) . Python3 script runs as a service with easy installation.

Stas Yakobov 16 Oct 22, 2022
This repository contains all the code and files needed to simulate the notspot quadrupedal robot using Gazebo and ROS.

Notspot robot simulation - Python version This repository contains all the files and code needed to simulate the notspot quadrupedal robot using Gazeb

50 Sep 26, 2022
从零开始打造一个智能家居系统

SweetHome 从零开始打造智能家居系统的尝试,主要的实现有 可以扫码添加设备并控制设备的Android App 可以控制亮灭的灯,并可以设置在Android App连接到指定Wifi后自动亮起 可以控制开关的窗帘,机械结构部分自己设计并3D打印出来 树莓派主控,实现Http请求接口和ZigBe

金榜 5 May 01, 2022
Event-based hardware simulation framework

An event-based multi-device simulation framework providing configuration and orchestration of complex multi-device simulations.

Diamond Light Source Controls Group 3 Feb 01, 2022
Simple Python script to decode and verify an European Health Certificate QR-code

A simple Python script to decode and verify an European Health Certificate QR-code.

Mathias Panzenböck 61 Oct 05, 2022
The ABR Control library is a python package for the control and path planning of robotic arms in real or simulated environments.

The ABR Control library is a python package for the control and path planning of robotic arms in real or simulated environments. ABR Control provides API's for the Mujoco, CoppeliaSim (formerly known

Applied Brain Research 277 Jan 05, 2023
🌱 - WebhookHard◞ Fines Educativos ◟

v1.0.0 WebhookHardware ¿Que es WebhookHardware? WebhookHardware se trata de un proyecto tratado para sacar informacion sobre el hardware de tus victim

3 Jun 14, 2021
A Raspberry Pi Pico powered Macro board, like a Streamdeck but cheaper and simpler.

Env-MCRO A Raspberry Pi Pico powered Macro board, like a Streamdeck but cheaper and simpler. (btw this image is a bit outdated, some of the silkscreen

EnviousData 68 Oct 14, 2022
Micro Displays for Raspberry Pi

micro-displays Micro Displays for Raspberry Pi Why? I'm super bored in lockdown. Add a Raspberry Pi 400 and a few tiny displays... The top half of the

ig 291 Jul 06, 2022
Automatically draw a KiCad schematic for a circuit prototyped on a breadboard.

Schematic-o-matic Schematic-o-matic automatically draws a KiCad schematic for a circuit prototyped on a breadboard. How It Works The first step in the

Nick Bild 22 Oct 11, 2022
Scapy: the Python-based interactive packet manipulation program & library. Supports Python 2 & Python 3.

Scapy Scapy is a powerful Python-based interactive packet manipulation program and library. It is able to forge or decode packets of a wide number of

SecDev 8.3k Jan 08, 2023
LED effects plugin for klipper

This plugin allows Klipper to run effects and animations on addressable LEDs, such as Neopixels, WS2812 or SK6812.

Julian Schill 238 Jan 04, 2023
Segger Embedded Studio project for building & debugging Flipper Zero firmware.

Segger Embedded Studio project for Flipper Zero firmware Установка Добавить данный репозиторий в качестве сабмодуля в корень локальной копии репозитор

25 Dec 28, 2022
Vvim - Keyboardless Vim interactions

This is done via a hardware glove that the user wears. The glove detects the finger's positions and translates them into key presses. It's currently a work in progress.

Boyd Kane 8 Nov 17, 2022
Mini Pupper - Open-Source,ROS Robot Dog Kit

Mini Pupper - Open-Source,ROS Robot Dog Kit

MangDang 747 Dec 28, 2022
A script and GUI for controlling stepper motors from an arduino

A script and GUI for controlling stepper motors from an arduino (nema 23 in my case but should work for others in general)

Pip 2 Aug 01, 2022