Created
February 14, 2017 21:16
-
-
Save marvolo3d/14c11cf3ec31cfd33b2c009a0cb46e96 to your computer and use it in GitHub Desktop.
Mari Palette
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mari | |
import PySide.QtGui as QtGui | |
class mariWidget(QtGui.QWidget): | |
def __init__(self): | |
super(mariWidget, self).__init__() | |
self._mainUISetup() | |
def _mainUISetup(self): | |
mainLayout = QtGui.QVBoxLayout() | |
self.setLayout(mainLayout) | |
btn_awesome = QtGui.QPushButton('awesome') | |
mainLayout.addWidget(btn_awesome) | |
# it is necessary to keep a reference to the widget in the global scope for this to work | |
# http://community.thefoundry.co.uk/discussion/post.aspx?f=204&t=118691&p=995770 | |
def run(): | |
try: | |
mari.palettes.remove("Cool Palette") | |
except: | |
pass | |
myWidget = mariWidget() | |
myPalette = mari.palettes.create("Cool Palette", myWidget) | |
return myWidget | |
palette = run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment