How Do I Add Multiple Versions of Maya to the Launcher and SG Desktop?

Note: This document describes functionality only available if you have taken control over a Toolkit configuration. Please refer to the Shotgun Integrations Admin Guide.

The example below walks you through what you need to change to have Maya 2014 and Maya 2015 appear in SG Desktop's launcher as a submenu in a single launch button. This will also show a menu option for launching each version of Maya in Shotgun (there's no submenu support in Shotgun).

Limitations

If you need to provide different default args for the different versions of your DCC, this method will not work. You will need to define separate instances of the Launcher (tk-multi-launchapp) and they will show up as separate launch buttons in SG Desktop (and in Shotgun). An example where this approach will not work is launching Nuke and NukeX. Since launching NukeX requires the --nukex argument, they require separate instances.

 

config/env/includes/paths.yml

This is where you define the path on the users' machine where the Maya executables live.

Locate the following lines

maya_windows: 'C:\Program Files\Autodesk\Maya2014\bin\maya.exe'
maya_mac: /Applications/Autodesk/maya2014/Maya.app
maya_linux: maya

change them to something like this.

maya_windows: 'C:\Program Files\Autodesk\Maya{version}\bin\maya.exe'
maya_mac: /Applications/Autodesk/maya{version}/Maya.app
maya_linux: maya{version}

 

config/env/includes/app_launchers.yml

These are the instances of the tk-multi-launchapp (the Launcher) that are configured to launch each DCC.

Note: the "version" specified in the "location" setting below may be different from what you have in your config. You should use the version you currently have, not the version below.

Locate the following lines:

launch_maya:
  defer_keyword: ''
  engine: tk-maya
  extra: {}
  hook_app_launch: default
  hook_before_app_launch: '{config}/before_app_launch.py'
  icon: '{target_engine}/icon_256.png'
  linux_args: ''
  linux_path: '@maya_linux'
  location: {name: tk-multi-launchapp, type: app_store, version: v0.5.4}
  mac_args: ''
  mac_path: '@maya_mac'
  menu_name: Launch Maya
  versions: []
  windows_args: ''
  windows_path: '@maya_windows'

We'll modify the original instance to add version tokens (defined in the version setting here). The token {version} will be replaced with these values here (like in the menu name) and will also be replaced in the paths defined above. Modify the menu_name and versions settings like so:

  menu_name: 'Launch Maya {version}'
  versions: ['2014', '2015']

Note that the versions will be sorted automatically in reverse numeric order in the SG Desktop UI and the "latest" version will be the default. We have plans to make the sorting and default version configurable in the future.

You can also modify the icon setting to include the  {version} token if you want your recent items to be able to display different icons for the different versions of Maya. You will need to provide those yourself and place them with the correct name ideally in your pipeline configuration's icons directory and then point this setting to something like {config_path}/icons/icon_maya{version}.png

 

config/env/project.yml

SG Desktop currently only runs in the project environment when in a Project. So here we'll make sure that it's configured to "roll up" versions of your DCC into a single button.

Locate the following lines (this may look slightly different in your config, that's okay):

engines:
  ...
  tk-desktop:
    apps:
      tk-multi-launch3dsmax: '@launch_3dsmax'
      tk-multi-launchhiero: '@launch_hiero'
      tk-multi-launchmari: '@launch_mari'
      tk-multi-launchmaya: '@launch_maya'
      tk-multi-launchmotionbuilder: '@launch_motionbuilder'
      tk-multi-launchnuke: '@launch_nuke'
      tk-multi-launchphotoshopcc: '@launch_photoshop'
      tk-multi-launchsoftimage: '@launch_softimage'
      tk-multi-screeningroom: '@launch_screeningroom'
    collapse_rules:
    - {button_label: $app, match: Launch $app, menu_label: None}
    debug_logging: false
    default_group: Studio
    groups:
    - matches: ['*Hiero*', '*Houdini*', '*Mari*', '*Max*', '*Maya*', '*Motion*', '*Nuke*', '*Photoshop*', '*Softimage*']
      name: Creative Tools
    hook_launch_python: default
    location: {name: tk-desktop, type: app_store, version: v1.0.2}
    show_recents: true

 The collapse_rules define how to determine whether things should be rolled up. Modify the setting to look like this:

    collapse_rules:
    - {button_label: $app, match: Launch $app $version, menu_label: Launch $version}

 

Now in SG Desktop, navigate to your Project list, and then select your project again (this reloads the pipeline configuration), and you should see the different versions of Maya showing up in a submenu:

Shotgun.png

 

Ensuring the Shotgun Web Application gets the updated menu settings

If you notice that the Shotgun web application doesn't show your new menu options, or you see the error below, you can regenerate the Shotgun menu cache:

ERROR: The action could not be executed! This is typically because there is an error in the app configuration which prevents the engine from initializing it.

In order to ensure the Shotgun web application gets the new menu item settings, you'll need to regenerate the cache files that it reads when populating those menus. You can do that simply by running the following tank command from the root of your pipeline configuration:

$ ./tank clear_shotgun_menu_cache

Then go to the Shotgun web application and reload the page, wait a few seconds to ensure the cache operation has completed, and then your menus should show up as expected.

Follow

13 Comments

  • 1
    Avatar
    David Mason

    Thanks KP, Solved my problem with this post.

    But, like Hassan, I have the same issue.  

    KP had Suggested:

    "As for the Nuke path having different representations of the version number in the path... that's annoying and unfortunately the only way around that would be to rename the path or make an alias that pointed to the correct one."

     

     

     

     

  • 0
    Avatar
    Hassan Youssef

    Thanks KP for this awesome documentation it's very helpful, I used this method for The Foundry products and it works find in Mac OSX platform, but unfortunately it has a problem with the Windows platform because of their versioning system,

    Example:

    nuke_windows: 'C:\Program Files\Nuke*9.0v3\Nuke9.0*.exe'

    If I used the same variable {version} with both, the result would be a wrong path. Is there any solution to avoid this problem.

  • 0
    Avatar
    KP

    That's correct guys. At the moment, the only way around it is using an alias or rename things explicitly.

  • 0
    Avatar
    Hassan Youssef

    Yea, it's very annoying for the IT administration and I hope Shotgun submit a solution for this in the future, thanks guys for your answers.

  • 0
    Avatar
    Benjamin Lipman

    How does this affect launching from the website rather than the desktop?

  • 0
    Avatar
    Hassan Youssef

    Same effect Benjamin at the website screenshot attached.

  • 0
    Avatar
    Stephen Hallquist

    You can do something like this no?

    nuke_windows: 'C:\Program Files\Nuke{version}v6\Nuke{version}.exe'

    This works well for me.

  • 0
    Avatar
    Mike Miller

    I ran through these steps, but my desktop launcher pull down menu just reads "Launch $version".

    The correct version of maya is launched, but how do I get the pull down menu to resolve $version?

    (running on winodws 7)

  • 0
    Avatar
    Maxim Doucet

    @all: there seems to be a way to handle versions in nuke's path elegantly with parenthesis as described in https://support.shotgunsoftware.com/entries/95442947#view-post-48094197

  • 1
    Avatar
    Macbeth R

    Quick example for handling versions with parenthesis for Nuke:

    ...\config\env\includes\app_launchers.yml
    menu_name: 'Launch Nuke {version}'
    versions: ['(10.5)v1', '(10.0)v6', '(10.0)v4', '(9.0)v7']

    ...\config\env\includes\paths.yml
    nukex_mac: /Applications/Nuke{version}/Nuke{version}.app
    nukex_windows: 'C:\Program Files\Nuke{version}\Nuke{v0}.exe'
    nukex_linux: Nuke{version}

    ...\config\env\project.yml
    collapse_rules:
    - {button_label: $app, match: Launch $app $version, menu_label: Launch $version}

  • 0
    Avatar
    Bernie kimbacher

    Macbeth does this work for starting Nuke through the right click menu on an entity on the website too? I tried it and it works through the Shotgun Desktop app but not through the right click menu...

  • 0
    Avatar
    Bernie kimbacher

    nevermind, got it working now... i rewrote the launchers for Nuke, NukeX and NukeAssist and now it works, must have been something funky in there...

    Thanks for that!

  • 0
    Avatar
    Ali Jafargholi

    Thanks for the documentation, it was very helpful. 

     

    It seems Tk picks the latest version as a default version, is there a way to specify what version is default?

Please sign in to leave a comment.