This hook is executed to launch applications, potentially in a Rez context.
It is NOT official/supported by Shotgun Software, but by third-party contributors
Please note that this requires Rez to be installed as a package, i.e.
able to rez env rez
, which exposes the Rez Python API.
With a proper Rez installation, you can do this by running rez-bind rez
.
To keep a copy of the original rez_app_launch.py
, there are 2 variants
available:
tk-config-default2 is the latest pipeline configuration style
rez_app_launch.py
tk-config-default is the legacy pipeline configuration style
rez_app_launch.py
, only updated to keep it functionalAs of writing, the 2
rez_app_launch.py
was tested at WWFX UK using rez 2.28.0. Newerrez
versions may be tested in the future.
Setup custom pipeline configuration for your Shotgun project
See "Advanced project setup" steps video or checkout this official tutorial page
Identify whether your pipeline configurations are based off tk-config-default2 or tk-config-default (legacy)
The Python hook and example .yml
configuration files are setup in a way
that mimics the folder structure where you need to copy them into.
<config>
will now refer to the full path to the folder which contain
core
, env
, hooks
.
<config>/hooks/tk-multi-launchapp
folder if it does not exist.tk-config-default2/hooks/tk-multi-launchapp/rez_app_launch.py
into that folder.<config>/hooks
folder if it does not exist (highly unlikely).tk-config-default2/hooks/rez_app_launch.py
into that folder.After setting up the advanced pipeline configurations and copying in the Python hook file, setting up applications to be launched from Rez are done by:
Then, you should be able to see and launch applications in rez context in:
If you are using tk-config-default2 v1.2.11 and have the patch program available, you can do these remaining steps by simply running in the terminal (tested on Linux):
patch --strip=0 < tk-config-default2/example-configs.patch
It might work with other versions/permutations of pipeline configurations but not guaranteed.
Otherwise, manually...
Create new settings.tk-tk-multi-launchapp.*
application configurations
inside <config>/env/includes/settings/tk-multi-launchapp.yml
.
Here is an example for Maya. This assumes you have a maya
rez package
built, installed and available i.e. rez env maya
.
# rez Maya 2019
settings.tk-multi-launchapp.maya:
engine: tk-maya
versions: # Tip! These will be substituted as {version}
- 2019.0
- 2019.2
extra:
rez:
packages:
- "maya-{version}" # i.e. maya-2019.0
# # Optional, additional rez packages
# - studio_maya_tools-1.2
# - show_maya_tools-dev
parent_variables:
- PYTHONPATH
- MAYA_MODULE_PATH
- MAYA_SCRIPT_PATH
menu_name: "Maya 2019"
location: "@apps.tk-multi-launchapp.location"
# --- IMPORTANT ---
# Point to rez_app_launch.py hook location
hook_app_launch: "{config}/tk-multi-launchapp/rez_app_launch.py"
# What to run after entering "rez env maya" to launch Maya, e.g.
linux_path: "maya"
mac_path: "Maya.app"
windows_path: "maya.exe"
Expose those settings.tk-tk-multi-launchapp.*
application configurations
for Shotgun apps which launches applications
i.e. inside <config>/env/includes/settings/
:
If you are using tk-config-default v0.18.2 and have the patch program available, you can do these remaining steps by simply running in the terminal (tested on Linux):
patch --strip=0 < tk-config-default/example-configs.patch
It might work with other versions/permutations of pipeline configurations but not guaranteed.
Otherwise, manually...
Create new application configurations inside, e.g. "launch_rez_maya_2019"
<config>/env/includes/app_launchers.yml
.
Here is an example for Maya. This assumes you have a maya
rez package
built, installed and available i.e. rez env maya
.
#
# -------------------------------------------------
# rez Maya 2019
# -------------------------------------------------
launch_rez_maya_2019:
engine: tk-maya
versions: # Tip! These will be substituted as {version}
- 2019.0
- 2019.2
extra:
rez_packages:
- "maya-{version}" # i.e. maya-2019.0
# # Optional, additional rez packages
# - studio_maya_tools-1.2
# - show_maya_tools-dev
hook_app_launch: rez_app_launch
hook_before_app_launch: default
icon: '{target_engine}/icon_256.png'
linux_path: "maya"
location:
version: v0.9.15
type: app_store
name: tk-multi-launchapp
mac_path: "Maya.app"
menu_name: Rez Maya 2019
windows_path: "maya.exe"
Expose those application configurations for Shotgun environment/apps which launches applications.
i.e. inside <config>/env/
, look for usages of "launch_maya" and create
a copy of it but for "launch_rez_maya_2019"
Check out the tk-config-default/env/*.yml
example configuration files for
more info.