Fabric Engine 2.2 and Python bindings – making it easier to build Fabric applications

May 11, 2016

Many VFX TDs and game studio Technical Artists would like to build standalone tools for their teams. Standalone tools can be tightly focused on the task at hand and can provide a streamlined interface versus building a custom tool within an existing application. Unfortunately, building out a complete application – however narrow the scope – is time-consuming and expensive. Fabric Engine makes it easy to build these kinds of custom standalone applications, but until recently it required a working knowledge of C++ to do so. This constraint often meant that people lacked the time, knowledge and/or inclination to build standalone tools with Fabric. TDs have often asked us ‘why can’t it be just a matter of editing a few files and pushing them out into production? Why don’t you let us use Python?’ Well, we’re pleased to say that we now have Python support in the latest release of Fabric.

The new Python bindings that are included in the Fabric Engine 2.2.0 release make it faster and easier for Fabric developers to create and share their applications. Let’s take a look at how the new Python-based FabricUI components help developers reduce the time to develop and iterate on applications to get them to their users faster.

With the new Python bindings for the FabricUI library, developers of all levels can enjoy the fast iteration and turn around times that come with developing in Python. The Python bindings are built against the FabricUI C++ library and come pre-built so there is no need to compile anything. The only requirements for developing on top of the Python bindings are the Fabric Engine 2.2.0 release, Python, and PyQt or PySide.

Technical Info

We see the release of the Python bindings as an essential step in allowing Technical Artists and TDs not well versed in C++ to take that next step into Fabric application development. Users can create new applications using the canvas.py and CanvasWindow.py files as templates. These files demonstrate how to setup the DFG and KL subsystems along with demonstrating how to instance the UICmdHandler for passing commands from the UI to the DfG graph. Advanced users will see how to setup a Fabric client and can use the sample files as a guide to build applications from the ground up as well.

Building custom applications is easy and only takes an experienced Python developer who’s worked with PyQt or PySide a few hours to get a custom application running built off of the provided samples. Custom widgets integrate easily by using standard signals and slots and you can have slots fire off commands to the graph by using the UICmdHandler(). This class allows users to pass simple JSON formatted string commands to the graph. These commands can be derived from observing what is logged in the Script Editor widget.

An aside for those craving nitty-gritty details: Previously, Canvas was delivered as a compiled C++ executable that was a simple wrapper around core Fabric functionality. It is now also available as canvas.py. The two are functionally identical. The only differences being the way one invokes them from the command line and the ability to very simply copy and modify the Python version into a task-specific application. To help you do this, various widgets such as the OpenGL Viewport, DFGWidget, Script Editor, Log Widget and more are provided as standard widgets. canvas.exe will be deprecated in a future release.

We’re looking forward to seeing what applications users are going to be creating and sharing in our community with hopes that users new to the platform will be able to pick it up and get running faster than ever. Watch below for a walkthrough of how we developed a simple and clean Alembic Viewer application as an example of how to use canvas.py as a basis to create a new and different application. .. Go forth and Python!