0

How do I add a new Toolkit App to the tank command?

Hello!

Right now I'm looking for way to launch a Toolkit App from the tank command without an associated engine. I noticed that the tank command has actions for launching Maya, launching Nuke etc. How do I add additional commands?

1 comment

  • 0
    Avatar
    Permanently deleted user

    Great question!

    if you want to start up a Toolkit app from the tank command (e.g. the shell engine), you need to add it to its environment.

    This is akin to running an app inside of Maya or Nuke. Instead of having a Shotgun menu where you can see all items that are available for your current work area, you can run the tank command to see all available commands. The Tank command has a number of built-in system and admin commands, but you can also register your own apps, just like you would with Maya or Nuke!

    Like Maya and Nuke, there are different configurations for different environments, so you can for example have one set of apps appearing if you are working on a shot and one if you are working on an asset.

    You can see this in action in our default config. If you launch Maya for a shot, Toolkit will load the following apps (see the actual code here):

      tk-maya:
        debug_logging: false
        location: {name: tk-maya, type: app_store, version: v0.3.9}
        menu_favourites:
        - {app_instance: tk-multi-workfiles, name: Shotgun File Manager...}
        template_project: null
        use_sgtk_as_menu_name: false
        apps: 
            tk-multi-workfiles: '@workfiles-launch-at-startup'
            tk-multi-about: '@about'
            tk-multi-screeningroom: '@launch_screeningroom'
    

    If you instead launch the tank command for a shot ( using the syntax tank Shot foobar or tank /path/to/shot/foobar ), 
    Toolkit would start the shell engine and load the following apps (see actual code here): 

      tk-shell:
        apps:
          tk-multi-screeningroom: '@launch_screeningroom'
          tk-shotgun-launch3dsmax: '@launch_3dsmax'
          tk-shotgun-launchmaya: '@launch_maya'
          tk-shotgun-launchnuke: '@launch_nuke'
          tk-shotgun-launchphotoshop: '@launch_photoshop'
        debug_logging: false
        location: {name: tk-shell, type: app_store, version: v0.3.4}
    

    In practice, it looks something like this:

    > tank Shot moo87
    
    Welcome to the Shotgun pipeline toolkit!
    For documentation, see https://toolkit.shotgunsoftware.com/forums
    Will search across all Shotgun Projects.
    - Found Shot moo87 (Project 'Chasing the Light')
    - Starting the Shotgun pipeline toolkit v0.14.76jmkm using configuration
    /mnt/software/tank/chasing_v2.
    - Setting the Context to Shot moo87.
    - Started Shell Engine version v0.3.3
    - Environment: /mnt/software/tank/chasing_v2/config/env/shot.yml.
    
    The following commands are available:
    
    [ --- lots of built in command shown here that I have omitted --- ]
    
    ==================================================
    Shell Engine Commands
    ==================================================
    
    launch_nuke
    -----------
    Launches and initializes an application environment.
    
    ingest
    ------
    Publishing of data into Shotgun
    
    screening_room_rv
    -----------------
    Screening Room integration right inside your application.
    
    screening_room_web
    ------------------
    Screening Room integration right inside your application.
    
    launch_photoshop
    ----------------
    Launches and initializes an application environment.
    
    launch_maya
    -----------
    Launches and initializes an application environment.
    

    Think of the above listing as the "shotgun menu equivalent" inside the shell engine.

    If I wanted to add one of the built-in toolkit apps into my shell engine Shot environment, I could use the install app command. (If you wanted to add one of your own apps, you would currently have to manually edit the config). For example, if I wanted to install the "work area info" app into my shell engine environment, I would do the following:

    My project that I want to operate on is called 'chasing the light', so I do the following:

    > tank Project chasing install_app
    
    Welcome to the Shotgun pipeline toolkit!
    For documentation, see https://toolkit.shotgunsoftware.com/forums
    Will search across all Shotgun Projects.
    - Found Project Chasing the Light
    - Starting the Shotgun pipeline toolkit v0.14.76 using configuration
    /mnt/software/tank/chasing_v2.
    - Setting the Context to Chasing the Light.
    - Running install_app...
    
    Please specify an app to install and an environment to install it into!
    The following environments exist in the current configuration:
     - asset
     - asset_step
     - project
     - sequence
     - shot
     - shot_step
     - shotgun_asset
     - shotgun_project
     - shotgun_publishedfile
     - shotgun_sequence
     - shotgun_shot
     - shotgun_tankpublishedfile
     - shotgun_task
     - shotgun_version
    
    Syntax:  install_app environment_name engine_name app_name
    Example: install_app asset tk-shell tk-multi-about
    
    ERROR: Invalid number of parameters.
    

    So it basically tells me that I need to specify the environment, the engine and then the app.

    In my case, this is the shot environment, the shell engine and the current work area app is called tk-multi-about (https://support.shotgunsoftware.com/entries/95440077 ). So I do the following:

    > tank Project chasing install_app shot tk-shell tk-multi-about
    
    Welcome to the Shotgun pipeline toolkit!
    For documentation, see https://toolkit.shotgunsoftware.com/forums
    Will search across all Shotgun Projects.
    - Found Project Chasing the Light
    - Starting the Shotgun pipeline toolkit v0.14.67 using configuration
    /mnt/software/tank/chasing_v2.
    - Setting the Context to Chasing the Light.
    - Running install_app...
    
    Welcome to the Shotgun Pipeline Toolkit App installer!
    Successfully located tk-multi-about v0.1.14...
    
    App Installation Complete!
    
    For documentation, see https://support.shotgunsoftware.com/entries/95440077
    

    If the app has any settings, it may prompt you as part of the installation!

    Now if I go back to my shot and ask toolkit for the available apps, I get the following:

    > tank Shot moo87
    
    Welcome to the Shotgun pipeline toolkit!
    For documentation, see https://toolkit.shotgunsoftware.com/forums
    Will search across all Shotgun Projects.
    - Found Shot moo87 (Project 'Chasing the Light')
    - Starting the Shotgun pipeline toolkit v0.14.67 using configuration
    /mnt/software/tank/chasing_v2.
    - Setting the Context to Shot moo87.
    - Started Shell Engine version v0.3.3
    - Environment: /mnt/software/tank/chasing_v2/config/env/shot.yml.
    
    The following commands are available:
    
    [ --- lots of built in command shown here that I have omitted --- ]
    
    ==================================================
    Shell Engine Commands
    ==================================================
    
    launch_nuke
    -----------
    Launches and initializes an application environment.
    
    ingest
    ------
    Publishing of data into Shotgun
    
    screening_room_rv
    -----------------
    Screening Room integration right inside your application.
    
    screening_room_web
    ------------------
    Screening Room integration right inside your application.
    
    launch_photoshop
    ----------------
    Launches and initializes an application environment.
    
    work_area_info
    --------------
    Shows a breakdown of your current environment and configuration.
    
    launch_maya
    -----------
    Launches and initializes an application environment.
    
    

    Note how there is a new work_area_info command available. Now in order to finally run this app, I do:

    tank Shot moo87 work_area_info
    

     

Please sign in to leave a comment.