A boilerplate for creating PyQt4/PySide and PyQt5/PySide2 applications running in Maya, Nuke, Blender, 3DS Max, Houdini, Unreal Engine or completely standalone.
For details, see CHANGELOG.md.
pip install pyvfx-boilerplate
git clone https://github.com/fredrikaverpil/pyvfx-boilerplate.git cd pyvfx-boilerplate python setup.py sdist bdist_wheel pip install dist/*
Pip installs a program named
pyvfx-boilerplate as an example Run as standalone:
(you may need to additionally install PyQt4, PyQt5, PySide or PySide2 for standalone to work depending on your system configuration)
Run in script editor of Maya or Nuke:
import sys sys.path.append('/path/to/pyvfx-boilerplate') from pyvfx_boilerplate import boilerplate_ui bpr = boilerplate_ui.BoilerplateRunner() bpr.run_main()
Since the boilerplate relies on
Qt.py, you should design your application as if you were designing it for PyQt5/PySide2. This means creating widgets using
QtWidgets rather than
Qt.py module takes care of the remapping and makes for compatibility with PyQt4/PySide. Read more over at the
Tip: when you cannot rely on
Qt.py, create an issue (probably over at
Qt.py) and/or detect which binding is being used and write some custom code:
from Qt import QtCompat if QtCompat.__binding__ in ('PyQt4', 'PySide'): # Do something if PyQt4 or PySide is used if QtCompat__binding.startswith('PySide'): # Do something if PySide or PySide2 is used if QtCompat__binding == 'PySide2': # Do something if PySide2 is used
Something wrong, have a question or wish to file a feature request?
Open up an issue here!
If you wish to contribute, pull requests are more than welcome!