from PySide import QtGui
import maya.OpenMayaUI as mui
import shiboken
import pymel.core as pm
import maya.cmds as cmds
def get_maya_window():
pointer = mui.MQtUtil.mainWindow()
return shiboken.wrapInstance(long(pointer), QtGui.QWidget)
###---Functions---###a
def move_keys(spinBoxVal):
curSel = pm.selected()
pm.keyframe(curSel, relative=True, tc=(spinBoxVal))
####---Window code---###
windowName = "myWin"
#check for window
if cmds.window("myWin", exists = True):
cmds.deleteUI("myWin", wnd=True)
#window
parent = get_maya_window()
window = QtGui.QMainWindow(parent)
window.setObjectName(windowName)
window.setWindowTitle("Anim Tools")
#font
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
#main widget
mainWidget = QtGui.QWidget()
window.setCentralWidget(mainWidget)
#Translate layout
translateLayout = QtGui.QHBoxLayout()
#Vertical layout
verticalLayout = QtGui.QVBoxLayout(mainWidget)
parent = get_maya_window()
verticalLayout.addLayout(translateLayout)
#Label
label = QtGui.QLabel("Shift Value:")
translateLayout.addWidget(label)
#SpinBox
spinBox = QtGui.QSpinBox()
spinBox.setRange(0,10000)
spinBox.setValue(50)
translateLayout.addWidget(spinBox)
#button
button = QtGui.QPushButton("Shift")
verticalLayout.addWidget(button)
button.setMinimumSize(100,40)
button.setFont(font)
button.setMaximumSize(400,40)
button.setStyleSheet("background-color:rgb(59,248,130); color: black")
button.clicked.connect(move_keys)# <---------This is where I don't know what to do!
#show window
window.show()
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/88c51f8c-e2fa-4142-9a18-fd47f321522f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.