Skip to content

Instantly share code, notes, and snippets.

@paulwinex
Created November 2, 2018 09:28
Show Gist options
  • Save paulwinex/a53dd1f5e3d677cd9dc5394dd1f35ea9 to your computer and use it in GitHub Desktop.
Save paulwinex/a53dd1f5e3d677cd9dc5394dd1f35ea9 to your computer and use it in GitHub Desktop.
from pymel.core import *
from pw_ui import *
#w = qControl(melGlobals['gAEControlLayoutName'], QWidget)
#b.setParent(None)
def addButton():
select('persp')
def addCustomButton():
b = QPushButton('Open Camera Rig')
b.setMinimumWidth(120)
b.setMinimumHeight(62)
l = QHBoxLayout()
l.setContentsMargins(220,0,0,0)
l.addWidget(b)
ww = QWidget()
ww.setLayout(l)
w = qMaya.findChildren(QWidget, 'swatchDisplayForm_camera')[0].children()[0].addWidget(ww)
QTimer.singleShot(150, addCustomButton)
addButton()
'''
b = QPushButton('Open Camera Rig')
b.setText('')
b.setIcon(QIcon('c:/epic.png'))
b.setIconSize(QSize(58,58))
b.setFixedSize(QSize(64,64))
b.setFlat(True)
pal = b.palette()
pal.setColor(QPalette.Button, QColor(200,10,10))
b.setPalette(pal)
b.setAutoFillBackground(True)
l = QHBoxLayout()
l.setContentsMargins(151,0,0,0)
l.addWidget(b)
ww = QWidget()
ww.setLayout(l)
w = qMaya.findChildren(QWidget, 'swatchDisplayForm_camera')[0]
w.children()[0].addWidget(ww)
w.children()[1].hide()
l1 = QLabel('Apperture: 12')
l2 = QLabel('F-Stop: 1')
l3 = QLabel('Distance: 123')
lw = QVBoxLayout()
lw.addWidget(l1)
lw.addWidget(l2)
lw.addWidget(l3)
l.addLayout(lw)
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment