# 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:
```python
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()
```
### Compatibility
- Maya (2011-2016, tested lightly on 2016) - standard, docked (`pymel.core.dockControl`), standalone, callbacks
- Maya (2017+, tested on 2017-2019) - standard, docked (`pymel.core.workspaceControl`), standalone, callbacks
- Nuke (tested on 9-12) - standard, docked (`nukescripts.panels`), callbacks
- Substance Designer (tested on 2019.3) - standard, docked (unable to save/load position)
- 3D Studio Max (2018+, tested on 2020) - standard
- Houdini (tested on 16) - standard
- Blender (tested on 2.8 - 3.1) - standard, callbacks
- Unreal (4.19+, tested on 4.23) - standard
- Fusion (tested on 9) - standard
- Standalone (Qt4, Qt5, tested on 2.7, 3.4+) - standard
### Generic 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)
### Maya Features
- Dock window using workspaceControl
- Save/restore position of workspaceControl window (floating+docked)
- Easy access to callbacks
### Nuke Features
- Dock window as a panel
- Save/restore location of panel (docked only)
- Easy access to callbacks
### Blender Features
- Easy access to callbacks
### Substance Features
- Dock window into panels
### 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](https://github.com/lohriialo/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](https://www.blue-zoo.co.uk/) - I've been building this up while working there
- [Lior Ben Horin](https://gist.github.com/liorbenhorin): [Simple_MayaDockingClass.py](https://gist.github.com/liorbenhorin/69da10ec6f22c6d7b92deefdb4a4f475) - used for main Maya docking code
- [Fredrik Averpil](https://github.com/fredrikaverpil): [pyvfx-boilerplate](https://github.com/fredrikaverpil/pyvfx-boilerplate) - helped with palettes, Nuke, and pre-2017 Maya
Raw data
{
"_id": null,
"home_page": "https://github.com/huntfx/vfxwindow",
"name": "vfxwindow",
"maintainer": "",
"docs_url": null,
"requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*",
"maintainer_email": "",
"keywords": "qt,pyside,pyside2,pyqt,pyqt4,pyqt5,gui,window,maya,mayapy,nuke,nukescripts,houdini,unreal,engine,ue4,blender,3dsmax,3ds,blackmagic,fusion,substance,designer,vfx,visualfx,fx,cgi,3d",
"author": "Peter Hunt",
"author_email": "peter@huntfx.uk",
"download_url": "https://files.pythonhosted.org/packages/13/e8/7e96f800adc5d5584203fea4ef99be594064a77f46b9aa7d5042e4cf0f3f/vfxwindow-1.7.1.tar.gz",
"platform": null,
"description": "# VFXWindow\r\nQt Window class for designing tools to be compatible between multiple VFX programs.\r\n\r\nThe 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.\r\n\r\nThe 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.\r\n\r\nThis 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.\r\n\r\n### Installation\r\n pip install vfxwindow\r\n\r\n### Basic Example:\r\n```python\r\nclass MyWindow(VFXWindow):\r\n WindowID = 'unique_window_id'\r\n WindowName = 'My Window'\r\n\r\n def __init__(self, parent=None, **kwargs):\r\n super(MyWindow, self).__init__(parent, **kwargs)\r\n # Setup window here\r\n\r\n # Setup callbacks, but wait until the program is ready\r\n self.deferred(self.newScene)\r\n\r\n def newScene(self, *args):\r\n \"\"\"Example: Delete and reapply callbacks after loading a new scene.\"\"\"\r\n self.removeCallbacks('sceneNewCallbacks')\r\n if self.maya:\r\n self.addCallbackScene('kAfterNew', self.newScene, group='sceneNewCallbacks')\r\n elif self.nuke:\r\n self.addCallbackOnCreate(self.newScene, nodeClass='Root', group='sceneNewCallbacks')\r\n\r\nif __name__ == '__main__':\r\n MyWindow.show()\r\n```\r\n\r\n### Compatibility\r\n - Maya (2011-2016, tested lightly on 2016) - standard, docked (`pymel.core.dockControl`), standalone, callbacks\r\n - Maya (2017+, tested on 2017-2019) - standard, docked (`pymel.core.workspaceControl`), standalone, callbacks\r\n - Nuke (tested on 9-12) - standard, docked (`nukescripts.panels`), callbacks\r\n - Substance Designer (tested on 2019.3) - standard, docked (unable to save/load position)\r\n - 3D Studio Max (2018+, tested on 2020) - standard\r\n - Houdini (tested on 16) - standard\r\n - Blender (tested on 2.8 - 3.1) - standard, callbacks\r\n - Unreal (4.19+, tested on 4.23) - standard\r\n - Fusion (tested on 9) - standard\r\n - Standalone (Qt4, Qt5, tested on 2.7, 3.4+) - standard\r\n\r\n### Generic Features\r\n - Automatically save/restore window position\r\n - Move window to screen if out of bounds (windows only)\r\n - Keep track of callbacks to remove groups if required, and clean up on window close\r\n - Keep track of signals to remove groups if required\r\n - Display a popup message that forces control\r\n - Set palette to that of another program\r\n - Auto close if opening a duplicate window\r\n - Close down all windows at once\r\n - Create dialog windows automatically attached to the application (and return data)\r\n\r\n### Maya Features\r\n - Dock window using workspaceControl\r\n - Save/restore position of workspaceControl window (floating+docked)\r\n - Easy access to callbacks\r\n\r\n### Nuke Features\r\n - Dock window as a panel\r\n - Save/restore location of panel (docked only)\r\n - Easy access to callbacks\r\n\r\n### Blender Features\r\n - Easy access to callbacks\r\n\r\n### Substance Features\r\n - Dock window into panels\r\n\r\n### Non-Python Applications\r\nCertain Windows applications have dispatch based COM interface, which will allow a link between Python and the application. See [photoshop-scripting-python](https://github.com/lohriialo/photoshop-scripting-python) for an example on how to connect to an application.\r\n\r\nCurrently there is no way of launching `VFXWindow` from inside these applications.\r\n\r\n### Special Thanks\r\n - [Blue Zoo](https://www.blue-zoo.co.uk/) - I've been building this up while working there\r\n - [Lior Ben Horin](https://gist.github.com/liorbenhorin): [Simple_MayaDockingClass.py](https://gist.github.com/liorbenhorin/69da10ec6f22c6d7b92deefdb4a4f475) - used for main Maya docking code\r\n - [Fredrik Averpil](https://github.com/fredrikaverpil): [pyvfx-boilerplate](https://github.com/fredrikaverpil/pyvfx-boilerplate) - helped with palettes, Nuke, and pre-2017 Maya\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Qt window class for designing tools to be compatible between multiple VFX programs.",
"version": "1.7.1",
"project_urls": {
"Documentation": "https://github.com/huntfx/vfxwindow/wiki",
"Download": "https://github.com/huntfx/vfxwindow/archive/1.7.1.tar.gz",
"Homepage": "https://github.com/huntfx/vfxwindow",
"Issues": "https://github.com/huntfx/vfxwindow/issues",
"Source": "https://github.com/huntfx/vfxwindow"
},
"split_keywords": [
"qt",
"pyside",
"pyside2",
"pyqt",
"pyqt4",
"pyqt5",
"gui",
"window",
"maya",
"mayapy",
"nuke",
"nukescripts",
"houdini",
"unreal",
"engine",
"ue4",
"blender",
"3dsmax",
"3ds",
"blackmagic",
"fusion",
"substance",
"designer",
"vfx",
"visualfx",
"fx",
"cgi",
"3d"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "13e87e96f800adc5d5584203fea4ef99be594064a77f46b9aa7d5042e4cf0f3f",
"md5": "bd7570c42f05ffe4ff381294eeb06764",
"sha256": "4613202b9644dd82714934c92f528658bf7c385abba314ed163b7a340e1bb922"
},
"downloads": -1,
"filename": "vfxwindow-1.7.1.tar.gz",
"has_sig": false,
"md5_digest": "bd7570c42f05ffe4ff381294eeb06764",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*",
"size": 46167,
"upload_time": "2023-10-16T12:12:16",
"upload_time_iso_8601": "2023-10-16T12:12:16.928643Z",
"url": "https://files.pythonhosted.org/packages/13/e8/7e96f800adc5d5584203fea4ef99be594064a77f46b9aa7d5042e4cf0f3f/vfxwindow-1.7.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-16 12:12:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "huntfx",
"github_project": "vfxwindow",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "vfxwindow"
}