huntfx
vfxwindow
Python

Python Qt Window class for compatibility between VFX programs

Last updated Feb 12, 2026
100
Stars
14
Forks
3
Issues
0
Stars/day
Attention Score
9
Language breakdown
Python 100.0%
Batchfile 0.0%
โ–ธ Files click to expand
README

VFXWindow

Qt Window class for designing tools to be compatible between multiple VFX programs.

The main purpose of the class is to integrate into the program UI, but it also contains helpful features such as safely dealing with callbacks and automatically saving the window position.

The intended usage is to make your window class inherit VFXWindow - which is an instance of QMainWindow. By calling cls.show(), it will launch the correct window type based on what program is loaded, and what settings were previously saved.

This is perfectly stable, but there is still plenty that needs improvement. Any help with extending existing application support or adding new applications is very much appreciated.

Installation

pip install vfxwindow

Basic Example:

from Qt import QtWidgets
from vfxwindow import VFXWindow

class MyWindow(VFXWindow): """Test window to show off some features."""

WindowID = 'vfx.window.test' WindowName = 'My Window' WindowDockable = True

def init(self, parent=None, **kwargs): super(MyWindow, self).init(parent, **kwargs) # Setup widgets/build UI here as you normally would self.setCentralWidget(QtWidgets.QWidget())

# Setup callbacks self.callbacks.add('file.load', self.afterSceneChange) # All apps have callback support for 'file.load' if self.application == 'Maya': # Maya supports before/after callbacks self.callbacks.add('file.new.before', self.beforeSceneChange) self.callbacks.add('file.new', self.afterSceneChange) # Also mapped to 'file.new.after' self.callbacks.add('file.load.before', self.beforeSceneChange) elif self.application == 'Nuke': self.callbacks.add('node.create', self.sceneChanged, nodeClass='Root') # Pass in a parameter self.callbacks.add('file.close', self.beforeSceneChange) elif self.application == 'Substance': # Matches "Substance Painter" and "Substance Designer" self.callbacks.add('file.new', self.afterSceneChange) self.callbacks.add('file.close', self.beforeSceneChange)

# Wait until the program is ready before triggering the new scene method self.deferred(self.afterSceneChange)

def afterSceneChange(self, *args): """Create the scene specific callbacks. These are being created in a callback "group". Subgroups are also supported.

Even though the callback is the same, the signatures can differ. See '/vfxwindow/<app>/callbacks.py' for the relevant signatures. """ if self.application == 'Maya': self.callbacks['scene'].add('node.create', self.mayaNodeAdded, nodeType='dependNode') if self.application == 'Nuke': self.callbacks['scene'].add('node.create', self.nukeNodeAdded)

def beforeSceneChange(self, *args): """Delete the scene specific callbacks.""" self.callbacks['scene'].delete()

def mayaNodeAdded(self, node, clientData): """Print out the node that was added in Maya.""" import maya.api.OpenMaya as om2 print('Node was added: {}'.format(om2.MFnDependencyNode(node).name()))

def nukeNodeAdded(self): """Print out the node that was added in Nuke.""" import nuke node = nuke.thisNode() print('Node was added: {}'.format(node.name() or 'Root'))

def checkForChanges(self): """Update the UI if it is has been in a "paused" state.

This is needed for Nuke and Substance Designer/Painter, because there's no way to detect if the window is closed or just hidden. For safety all callbacks will get paused, and upon unpausing, this method will be run to allow the window to correctly update. """ self.beforeSceneChange() self.afterSceneChange()

if name == 'main': MyWindow.show()

Support / Compatibility

โœ”๏ธ Working / โ” Untested / โŒ Not Working | | Standard Window | Docked Window | Callbacks | Tested Versions | Linux | Windows | MacOs | | ------------------ | -------- | -------- | -------- | -------- | -------- | --------- | ------- | | Maya | โœ”๏ธ | workspaceControl or falls back to dockControl for pre Maya 2017, saves/restores location of window."">โœ”๏ธ | โœ”๏ธ | dockControl, tested lightly on 2016."">2011-2016, workspaceControl."">2017+ | โœ”๏ธ | โœ”๏ธ | โ” | | Maya (Standalone) | โœ”๏ธ | | โœ”๏ธ | | โ” | โœ”๏ธ | โ” | | Nuke | โœ”๏ธ | registerWidgetAsPanel to dock window in a panel, saves/restores location of panel only when docked (not floating">โœ”๏ธ.") | checkForChanges(">โœ”๏ธ method which will be run each time the callbacks get reactivated.") | 9-14 | โ” | โœ”๏ธ | โ” | | Nuke (Terminal) | โœ”๏ธ | | โœ”๏ธ | | โ” | โœ”๏ธ | โ” | | Houdini | โœ”๏ธ | โŒ | โœ”๏ธ | 16-19 | โœ”๏ธ | โœ”๏ธ | โ” | | Unreal Engine | โœ”๏ธ | โŒ | โŒ | 4.19-4.23, 5.0-5.3 | โŒ | โœ”๏ธ | โ” | | Blender | โœ”๏ธ | โŒ | โœ”๏ธ | 2.8-4.2 | โ” | โœ”๏ธ | โ” | | Blender (Background) | โœ”๏ธ | | โ” | 3.1-4.2 | โ” | โœ”๏ธ | โ” | | Katana | โœ”๏ธ | โŒ | โŒ | 7 | โ” | โœ”๏ธ | โ” | | 3ds Max | โœ”๏ธ | โŒ | โŒ | 2018-2020 | โ” | โœ”๏ธ | โ” | | Substance Painter | โœ”๏ธ | substancepainter.ui.adddock_widget, does not save/restore location of window."">โœ”๏ธ | โœ”๏ธ | 8.3 | โœ”๏ธ | โœ”๏ธ | โ” | | Substance Designer | โœ”๏ธ | sd.getContext(">โœ”๏ธ.getSDApplication().getQtForPythonUIMgr().newDockWidget, does not save/restore location of window.") | โœ”๏ธ | 2019.3, 7.1, 12.3 | โœ”๏ธ | โœ”๏ธ | โ” | | Blackmagic Fusion | โœ”๏ธ | โŒ | โŒ | 9 | โ” | show/hide/setVisible."">โœ”๏ธ | โ” | | CryEngine Sandbox | โœ”๏ธ | SandboxBridge.register_window function, but I was not able to figure it out."">โŒ | โŒ | 5.7 | โ” | show/hide/setVisible."">โœ”๏ธ | โ” | | Standalone Python | โœ”๏ธ | | | 2.7 (Qt4), 3.7-3.9 (Qt5) | โ” | โœ”๏ธ | โ” | | Natron | โœ”๏ธ | โŒ | โŒ | 2.5 | โ” | โœ”๏ธ | โ” | | Gaffer |๏ธ ๏ธโœ”๏ธ | โŒ | โŒ | 1.5.6.0 | โ” | โœ”๏ธ | โ” | | RenderDoc | โœ”๏ธ | โŒ | โŒ | 1.33 | โ” | show/hide, and crashes when calling setVisible."">โœ”๏ธ | โ” |

* Hover over underlined fields to see any extra details/issues.

Features

- Automatically save/restore window position - Automatically dock window to application (if supported) - Move window to screen if out of bounds (Windows only) - Register application specific callbacks to be cleaned up on window close - Keep track of signals to remove groups if required - Set palette to that of another program - Auto close if opening a duplicate window - Close down all windows at once

Running with Non-Python Applications

Certain Windows applications have dispatch based COM interface, which will allow a link between Python and the application. See photoshop-scripting-python for an example on how to connect to an application.

Currently there is no way of launching VFXWindow from inside these applications.

Requirements

- Qt.py

Resources Used

- SimpleMayaDockingClass.py - Used for Maya docking code - pyvfx-boilerplate - Used to help with palettes, Nuke, and pre-2017 Maya

ยฉ 2026 GitRepoTrend ยท huntfx/vfxwindow ยท Updated daily from GitHub