A PySide/PyQt4 boilerplate for Maya, Nuke or standalone06 Oct 2013 #Python #Maya #Nuke #PySide #PyQt
Ever wanted to be able to run the same user interface in Maya, Nuke as well as completely standalone (with or without app-specific modifications) and on any platform, using PySide and/or PyQt?
– That’s exactly why I created a boilerplate Python script, which could serve as a good starting point for most PySide/PyQt projects to be used in the VFX pipeline.
As my experience is limited to some VFX applications, you are most welcome to fork or contribute to make it also run in other PyQt/PySide enabled applications.
- Download the files from GitHub and edit boilerplate.py
- Set the variable QtType to either ‘PySide’ or ‘PyQt’
- Edit in the path to the pysideuic module (if you’re using PySide/Nuke and loading a .ui file)
- Edit the variable uiFile to point to your .ui file
- Start coding your app in the HelloWorld class
Run the script in Maya
import sys sys.path.append('c:/path/to/dir/containing/the/script') import boilerplate boilerplate.runMaya()
Run the script in Nuke
import sys sys.path.append('c:/path/to/dir/containing/the/script') import boilerplate boilerplate.runNuke()
Run the script as standalone
More on usage and customization over at the GitHub project’s wiki.