Skip to content

shotgunsoftware/tk-framework-alias

Repository files navigation

VFX Platform Python Code style: black Build Status

tk-framework-alias

Toolkit framework for integration with Autodesk Alias.

The main use of this framework is by the Alias Engine. The framework allows the engine to run alongside Alias, providing access to the Flow Production Tracking Toolkit Apps that can interact with the data in Alias.

Support

  • 2022.2 <= Alias <= 2024
  • Windows only

What's in the Framework

Alias Plugin

This plugin is loaded by Alias and is the main entry point to integrating a Python client (e.g. Flow Production Tracking) with Alias. This is maintained by the Flow Production Tracking Automotive Team.

File location: dist/Alias/{python_version/{alias_version}/{plugin_name}.plugin

Alias Python API

The Python module that provides bindings to the C++ Alias API. This allows the Python client (e.g. Flow Production Tracking) to interact with the Alias data. This is maintained by the Flow Production Tracking Automotive Team.

File location: dist/Alias/{python_version/{alias_version}/alias_api.pyd

Toolkit Plugin for Alias

The Toolkit Plugin is used by plugin_bootstrap.py to bootstrap the Flow Production Tracking Alias Engine, which can be initiated by the Alias Plugin. This allows Flow Production Tracking to be started up by Alias. See dev for more details on how the Toolkit Plugin is built.

File location: dist/Toolkit/plugin/com.sg.basic.alias

Embeddable Python Package

To ensure the framework can run with any Alias version, a specific Python version may be required. In this case, the framework provides a minimal embeddable Python package that can be installed to the user's %APPDATA% folder at runtime. Embeddable Python packages can be downloaded from here. See dist for more details about the Python distribution.

File location: dist/Python{major}{minor}/python-{major}.{minor}-embed-amd64.zip

Development Tools

The dev folder provides scripts to build the necessary components for the framework. See dev for more details.


How it Works

The framework has potential to be used more generally, but for the purpose of demonstrating how the farmework works, the provided example will use the Alias Engine.

The framework can be used for any version of Alias (within the support cycle). The high-level steps include:

  1. First, run the framework's start up utils.
  2. The start up utils will generate a plugin lst file that can be used when launching Alias to auto-load the Alias Plugin. For example, using a Windows command lint:
"C:\Program Files\Autodesk\AliasAutoStudio2024.0\bin\Alias.exe" -a as -P "C:\path\to\alias_plugins.lst"
  1. Alias loads the plugin which will embed Python to access the Python modules to initialize Flow Production Tracking and establish communication with Alias.

The startup utils do all the necessary set up to ensure that Alias can load the plugin to initialize Flow Production Tracking. See the main start up function ensure_plugin_ready for more details.

Due to major changes to Alias starting in 2024.0, the framework essentially operates in two different modes. For Alias versions prior to 2024.0:

  • Only the framework's start up utils are used to generate the plugin list file
  • The Alias Engine will use the plugin list file to launch Alias and auto-load the plugin
  • The plugin will start the Alias Engine in the same process as Alias
  • The Alias Engine will import the Alias Python API module directly to interact with the data in Alias
  • The Alias Engine will create a Qt Application and share the Alias event loop to display Toolkit UI alongside Alias.
  • No other framework functionality is used

For Alias 2024.0 and later:

  • The framework's start up utils are used to ensure the Toolkit Plugin is installed and a suitable version of Python is avilable, in addition to generating the plugin list file
  • The Alias Engine will use the plugin list file to launch Alias and auto-load the plugin
  • The plugin will start the Alias Python API server
  • The plugin will then use the Toolkit Plugin to bootstrap the Alias Engine in a new process (separate from Alias)
  • The Alias Engine will establish a connection to the Alias Python API server to interact with the data in Alias
  • the Alias Engine will create a Qt Application and start its own event loop to display Toolkit UI alongside Alias

The plugin will use the AliasBridge object to manage the Alias Python API server. The plugin_bootstrap.py script will called to bootsrap the Alias Engine. The Alias Engine will create a client to connect to the Alias Python API server.


Prep for Release

  1. Build and install the Toolkit Plugin to dist/Toolkit/plugin. See dev on how to build.
  2. Add the necessary embeddable Python packages to dist/Python{major}{minor}. See dist on how to create an embeddable Python package.