Customising DCC launch

Here we are going to demonstrate how to disable Maya launcher for the compositing(task type) department, we do this by modifying the Maya launcher hook:

mypipeline/ftrack-connect-pipeline-maya/hook/discover_maya.py

 1..
 2
 3def on_discover_maya_pipeline(session, event):
 4    from ftrack_connect_pipeline_maya import __version__ as integration_version
 5
 6    data = {
 7        'integration': {
 8            "name": 'ftrack-connect-pipeline-maya',
 9            'version': integration_version
10        }
11    }
12
13    # Disable maya launch on certain task types
14    task = session.get('Context', selection[0]['entityId'])
15
16    if task['type']['name'].lower() in ['compositing']:
17        # Do not show Maya launchers compositing task launch
18        data['integration']['disable'] = True
19
20..

The implementation is pretty straightforward, as Connect emits a discover event, the maya hook checks the task type and disables the launcher accordingly.

Within the same hook, you can also augment the environment variables sent to Nuke.

Changing paths to DCC executables and arguments

In some cases, you might want to change the location of DCC executables or the arguments passed on. This is done by modifying the configs within configuration of the ftrack-application-launcher module.

In this example we are going to change the Windows location of Maya and add an argument:

ftrack-application-launcher/resource/config/maya-pipeline.json

 1{
 2    "priority":100,
 3    "context": ["Task"],
 4    "identifier": "ftrack-connect-launch-maya",
 5    "applicationIdentifier":"maya_{variant}",
 6    "integrations": {
 7        "pipeline":[
 8            "ftrack-connect-pipeline-definition",
 9            "ftrack-connect-pipeline",
10            "ftrack-connect-pipeline-qt",
11            "ftrack-connect-pipeline-maya"
12        ]
13    },
14    "label": "Maya",
15    "icon": "maya",
16    "variant": "{version}",
17    "search_path":{
18        "linux": {
19            "prefix":["/", "usr","autodesk","maya.+"],
20            "expression":["bin","maya$"],
21            "version_expression": "maya(?P<version>\\d{4})"
22        },
23        "windows": {
24            "prefix":["E:\\", "Program Files.*"],
25            "expression":["Autodesk", "Maya.+", "bin", "maya.exe"],
26            "launch_arguments": ["-pythonver","2"]
27        },
28        "darwin": {
29            "prefix":["/", "Applications"],
30            "expression": ["Autodesk", "maya.+", "Maya.app"]
31        }
32    },
33    "console": true
34 }

The changes we have done:

  • Changed the Windows Maya executable base path to E: instead of C:

  • Added the arguments “-pythonver 2” to Maya.

References

Find full documentation on how to create a launcher here: ftrack Application Launcher developer documentation