Code Monkey home page Code Monkey logo

pyvfx-boilerplate's Introduction

pyvfx-boilerplate

Tests PyPI

A boilerplate for creating PyQt4/PySide and PyQt5/PySide2 applications running in Maya, Nuke, Blender, 3DS Max, Houdini, Unreal Engine or completely standalone.

Documentation

Version 3.x

  • The entire boilerplate was re-written so it could be packaged and distributed with PyPi.
  • Adding Blender, 3DS Max, Houdini, and Unreal Engine support.

For details, see CHANGELOG.md.

Noteworthy known issues

  • Does not work with Nuke 10.0v1 on OS X: #7
  • Maya palette glitchy in standalone mode with PySide/PyQt4 on OS X (disabled by default): #9
  • Window will not stay on top of Nuke (OS X) without Qt.Tool or Qt.WindowStaysOnTopHint: #12

Installation

Easy way:

pip install pyvfx-boilerplate

Long way:

git clone https://github.com/fredrikaverpil/pyvfx-boilerplate.git
cd pyvfx-boilerplate
python setup.py sdist bdist_wheel
pip install dist/*

Example usage

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)

pyvfx-boilerplate

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()

Modifying the boilerplate

  • See inheritance example above

Development guidelines

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 QtGui. The Qt.py module takes care of the remapping and makes for compatibility with PyQt4/PySide. Read more over at the Qt.py repository.

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

Issues

Something wrong, have a question or wish to file a feature request?

Open up an issue here!

Contribute

If you wish to contribute, pull requests are more than welcome!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.