Creating a new extension
In this section, you'll learn how to create a simple Reference viewer extension in Maya.
It will be on the form a dialog that will be shown when the user clicks a menu reference viewer menu item within the DCC.
Get more detailed information about available extensions and how they work in the extensions documentation section.
Prerequisites
- Install Connect v3+/v24+
- Download and install the Maya framework base integration.
- Create a new folder for your extension. This folder will contain all the files for your extension:
cd ~/Documents/ftrack
mkdir -p extensions/ftrack_example
Developing
- Create a folder for each needed extension:
cd ~/Documents/ftrack/extensions/connect
mkdir launch
cd ~/Documents/ftrack/extensions/ftrack_example
mkdir dialogs
mkdir plugins
mkdir tool-configs
mkdir widgets
- Follow the instructions on how to create each extension type:
- Setup the FTRACK_CONNECT_EXTENSIONS_PATH environment variable to point to the extensions folder:
export FTRACK_CONNECT_EXTENSIONS_PATH=~/Documents/ftrack/extensions/connect
- Start Connect and launch a framework integration, your extension should now be visible under the ftrack menu.
Overview
📄️ Launch config
Create a maya-launch.yaml file inside your user extensions folder with the following overrides:
📄️ Dcc config
Create a maya.yaml file inside your user extensions folder with the following content:
📄️ Dialog
Create a referenceviewerdialog.py file inside your user extensions folder with the following content:
📄️ Tool config
Create a mayareferenceviewer.yaml file inside your user extensions folder with the following content:
📄️ Plugin
Create a mayareferencecollector.py file inside the plugins folder with the following content:
📄️ Widget
This s the widget that will represent the maya reference collector plugin. The populatemethod is always called by the base Class, and the queryreferences is used to call the uihook method from the plugin to populate the UI. As the execution of the uihook is async, the result goes to the uihookcallback method. In the onreferencechanged method we modify the config of the plugin to set the selected_reference option.
📄️ Javascript
Photoshop Javascript function