Skip to content

Instantly share code, notes, and snippets.

@AndresMWeber
Last active December 13, 2018 07:14
Show Gist options
  • Save AndresMWeber/2863a8a7f5ca377712d1bda52f8ef4d2 to your computer and use it in GitHub Desktop.
Save AndresMWeber/2863a8a7f5ca377712d1bda52f8ef4d2 to your computer and use it in GitHub Desktop.
import sys
from PySide2.QtWidgets import *
import maya.standalone as ms
import maya.cmds as mc
class Window(QWidget):
def __init__(self):
super(Window, self).__init__()
self.setupUI()
self.show()
def setupUI(self):
self.layout = QHBoxLayout()
self.setLayout(self.layout)
self.button = QPushButton("List Scene")
self.button_create = QPushButton("Create Node")
self.layout.addWidget(self.button)
self.layout.addWidget(self.button_create)
self.button.clicked.connect(self.list_scene)
self.button_create.clicked.connect(self.create_node)
def list_scene(self):
print mc.ls(type='transform')
def create_node(self):
print mc.group(em=True)
if __name__ == '__main__':
app = QApplication(sys.argv)
ms.initialize()
win = Window()
app.exec_()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment