Shell Integration

Shotgun Engine for the Shell

Shotgun Support in a Shell
By: Shotgun Software
Latest Version: v0.5.1 (prod)
For our version numbers, we follow the Semantic Versioning standard.
System Name: tk-shell

Overview

The Shotgun engine for the shell works in conjunction with the Tank command. Once the engine has been installed, you can run Shotgun Pipeline Toolkit apps straight from the command line. The Tank command will take care of listing and presenting the user with the different installed apps that are available. The engine forms the bridge between the terminal and the installed apps. If you have PySide or PyQt installed, you can run apps that have a UI straight from a shell.

Documentation

The Shotgun engine for the shell handles command line interaction and is tightly integrated with the tank command which is distributed as part of the Core API. When you execute the tank command in a terminal, Toolkit launches the engine to handle app execution.

For more information about the tank command, please see our main documentation:

Installation and Updates

Adding this Engine to the Shotgun Pipeline Toolkit

If you want to add this engine to Project XYZ, and an environment named asset, execute the following command:

> tank Project XYZ install_engine asset tk-shell

Updating to the latest version

If you already have this item installed in a project and you want to get the latest version, you can run the update command. You can either navigate to the tank command that comes with that specific project, and run it there:

> cd /my_tank_configs/project_xyz
> ./tank updates

Alternatively, you can run your studio tank command and specify the project name to tell it which project to run the update check for:

> tank Project XYZ updates

Collaboration and Evolution

If you have access to the Shotgun Pipeline Toolkit, you also have access to the source code for all apps, engines and frameworks in Github where we store and manage them. Feel free to evolve these items; use them as a base for further independent development, make changes (and submit pull requests back to us!) or simply tinker with them to see how they have been built and how the toolkit works. You can access this code repository at https://github.com/shotgunsoftware/tk-shell.

Special Requirements

  • You need Shotgun Pipeline Toolkit Core API version v0.14.56 or higher to use this.

Configuration

No Configuration Needed!

This item does not have any options to configure!

Release Notes

Welcome to the release notes for this App. Below you will find an overview of all the changes we did for each release. We try to be as detailed as possible and include all bugs we have fixed, features we have added and things that may have changed. If you have questions about a particular release, don't hesitate to contact our support team!

v0.5.1

2016-Nov-10

Check for existing QApplication in engine.execute_command()

Details:

Check for an existing QApplication before attempting to create one. If a QApplication is already running, execute the input command immediately. If a QApplication needs to be created, do so, then queue the input command to execute using QTimer.singleShot() and start the exec_() loop. Resolves #38354.

v0.5.0

2016-May-09

Allows on-the-fly context changes.

Details:

As with the tk-nuke engine, context changes in the shell engine can now be performed via the sgtk.platform.change_context() function.

v0.4.2

2016-May-03

Fixed a PyQt issue with dialogs and made the engine more flexible about when PyQt/PySide can be used to show UIs.

Details:

  • Fixes an issue with PyQt where the exec_ method on dialogs always returned None. (thanks Jonathan Stone!)
  • The engine used to allow UIs to be displayed using the engine's show methods only if they were executed through commands. Now the engine allows the methods to be invoked as soon as a QApplication is made available. Therefore this allows UIs to be shown while using the tank shell command.

v0.4.1

Improved logic for indication of a UI present

Details:

This changes the meaning of the has_ui property so that it is consistent with other engines. Previously has_ui would return True as soon as a valid pyside/pyqt4 was detected. This is inconsistent with other engines, where has_ui indicates that an active UI is present and running. This pull request adjusts the shotgun engine so that has_ui only returns true when a QApplication is actually active in the system.

v0.4.0

Updated visual style to better match Maya.

Details: This change affects the visual appearance of all apps running in the engine, making their visual appearance much more consistent with the look and feel that you would get inside Maya. Please note that after this upgrade, app UIs will look slightly different.

v0.3.8

Updated PySide version handling to support very old versions!

v0.3.7

Added a default application icon for UI apps.

v0.3.6

Added support for optional App command arguments

v0.3.5

Updated PyQt compatibility

v0.3.4

Now uses the built in QT stylesheet introduced in Core v0.14.28.

v0.3.3

Updated QT Style Sheet to include a border around text input elements.

v0.3.2

Added better unicode support

v0.3.1

Renames and support for the new name Sgtk.

v0.3.0

Added PyQt Support.

Details:

  • Engine now supports PyQt4 for UIs. This is detected at runtime, and if tank can load PyQt4 from the python system path, it will attempt to use it. This is a fallback in case PySide is not found.

  • Better error messages when PySide/PyQt4 is not installed - the engine now presents some more polished feedback in the case a UI based app is launched but neither PySide nor PyQt exists to handle the UI creation.

v0.2.7

Better handling of keyboard interrupts.

v0.2.6

Fixed a bug which could cause apps raising Exceptions to be stuck in a loop.

v0.2.5

Adjustments to PyQt Support

v0.2.4

Fixed issue when running some apps with PyQt.

v0.2.3

Minor adjustments to PyQt initialization.

v0.2.2

Added support for app arguments

v0.2.1

Engine is now compliant with Tank Core v0.13

Details: - Added QT support - Added support for Core v0.13 specifics; logging, execution etc.

v0.1.1

Adjustments to work nicely with core v0.12.5

v0.1.0

Baseline Release.

Follow

3 Comments

  • 0
    Avatar
    Scott Ballard

    I'd love to see an example of how to launch an app from the command line in the docs here. I'm sure it's documented somewhere else, which I will go hunt for now. :)

  • 0
    Avatar
    Manne Öhrström

    Hello Scott! Here is some documentation in case you didn't already find it:  https://support.shotgunsoftware.com/entries/95442818

  • 0
    Avatar
    Matthew Gidney

    And the opposite?  How would one add the shell to the desktop launcher, ie tk-shell?

    Matt

Please sign in to leave a comment.