Qt window class for designing tools to be compatible between multiple VFX programs.
Project description
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. Maya, Nuke, 3DS Max, Houdini, Blender, Substance Designer, Unreal and Fusion are currently supported, though any help to extend those would be appreciated, as well as support for any other applications.
Installation
pip install vfxwindow
Basic Example:
class MyWindow(VFXWindow):
WindowID = 'unique_window_id'
WindowName = 'My Window'
def __init__(self, parent=None, **kwargs):
super(MyWindow, self).__init__(parent, **kwargs)
# Setup window here
# Setup callbacks, but wait until the program is ready
self.deferred(self.newScene)
def newScene(self, *args):
"""Example: Delete and reapply callbacks after loading a new scene."""
self.removeCallbacks('sceneNewCallbacks')
if self.maya:
self.addCallbackScene('kAfterNew', self.newScene, group='sceneNewCallbacks')
elif self.nuke:
self.addCallbackOnCreate(self.newScene, nodeClass='Root', group='sceneNewCallbacks')
if __name__ == '__main__':
MyWindow.show()
Support / Compatibility
✔️ Working / ❔ Untested / ❌ Not Working
Standard Window | Docked Window | Callbacks | Tested Versions | Linux | Windows | MacOs | |
---|---|---|---|---|---|---|---|
Maya | ✔️ | ✔️ | ✔️ | 2011-2016, 2017+ | ✔️ | ✔️ | ❔ |
Maya (Standalone) | ✔️ | ✔️ | ❔ | ✔️ | ❔ | ||
Nuke | ✔️ | ✔️ | ✔️ | 9-12 | ❔ | ✔️ | ❔ |
Nuke (Terminal) | ✔️ | ✔️ | ❔ | ✔️ | ❔ | ||
Houdini | ✔️ | ❌ | ❌ | 16-19 | ✔️ | ✔️ | ❔ |
Unreal Engine | ✔️ | ❌ | ❌ | 4.19-4.23, 5.0-5.3 | ❌ | ✔️ | ❔ |
Blender | ✔️ | ❌ | ✔️ | 2.8-3.4 | ❔ | ✔️ | ❔ |
3ds Max | ✔️ | ❌ | ❌ | 2018-2020 | ❔ | ✔️ | ❔ |
Substance Painter | ✔️ | ✔️ | ❌ | 8.3 | ✔️ | ✔️ | ❔ |
Substance Designer | ✔️ | ✔️ | ❌ | 2019.3, 7.1, 12.3 | ✔️ | ✔️ | ❔ |
Blackmagic Fusion | ✔️ | ❌ | ❌ | 9 | ❔ | ✔️ | ❔ |
CryEngine Sandbox | ✔️ | ❌ | ❌ | 5.7 | ❔ | ✔️ | ❔ |
Standalone Python | ✔️ | 2.7 (Qt4), 3.7-3.9 (Qt5) | ❔ | ✔️ | ❔ |
Features
- Automatically save/restore window position
- Move window to screen if out of bounds (windows only)
- Keep track of callbacks to remove groups if required, and clean up on window close
- Keep track of signals to remove groups if required
- Display a popup message that forces control
- Set palette to that of another program
- Auto close if opening a duplicate window
- Close down all windows at once
- Create dialog windows automatically attached to the application (and return data)
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.
Special Thanks
- Blue Zoo - I've been building this up while working there
- Lior Ben Horin: Simple_MayaDockingClass.py - used for main Maya docking code
- Fredrik Averpil: pyvfx-boilerplate - helped with palettes, Nuke, and pre-2017 Maya
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file vfxwindow-1.8.0.tar.gz
.
File metadata
- Download URL: vfxwindow-1.8.0.tar.gz
- Upload date:
- Size: 49.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23eaabbeff86edf700eeddaf3914f66d90793d8553dd8ba16827a23b18da2963 |
|
MD5 | 0a2bb7526c966ea6418997b83f0517d1 |
|
BLAKE2b-256 | 96f2440fd4501aa8de017fd671c5e907e05b6536011d9238592747d8663b2686 |