import os
import functools
from PySide2 import QtWidgets, QtCore, QtUiTools, QtGui
from shiboken2 import wrapInstance
import maya.cmds as mc
import maya.OpenMayaUI as omui
import makeRobotBug
'''
import thisModule
reload (thisModule)
thisModule.run()
'''
def getMayaWindow():
''' pointer to the maya main window '''
ptr = omui.MQtUtil.mainWindow()
if ptr:
return wrapInstance(long(ptr), QtWidgets.QMainWindow)
def run():
''' builds our UI '''
global win
win = GeometryGenerator(parent=getMayaWindow())
#win.show()
class GeometryGenerator(QtWidgets.QDialog):
def __init__(self,parent=None):
super(GeometryGenerator,self).__init__(parent)
#self.resize(400, 300)
## From Pysideuic compiled code goes here
#############################################################
self.gridLayout = QtWidgets.QGridLayout()
self.verticalLayout = QtWidgets.QVBoxLayout()
self.pBtn_makeRobot = QtWidgets.QPushButton("MAKE ROBOT")
self.verticalLayout.addWidget(self.pBtn_makeRobot)
self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
##############################################################
self.setWindowTitle("WIN CONTROLLED IN PYTHON")
self.setLayout(self.gridLayout)
self.show()
self.makeConnections()
def makeConnections(self):
''' connect events in out UI '''
self.pBtn_makeRobot.clicked.connect( self.createGeometry )
def createGeometry(self):
print("Create geometry pressed")
if self.pBtn_makeRobot.isChecked():
makeRobotBug.makeRobotBug()I am building a UI. When the button is checked the code should call a module called "makeRobotBug" and an object will be placed into my scene. It's not working and I am not getting any error messages either, which is kind of strange.
--
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/f5f84975-7091-4d77-827d-8acfdd3fb5c4%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.
Sorry I mean this documentation. Heres the link https://deptinfo-ensip.univ-poitiers.fr/ENS/pyside-docs/PySide/QtGui/QAbstractButton.html#PySide.QtGui.PySide.QtGui.QAbstractButton.animateClick
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/f5f84975-7091-4d77-827d-8acfdd3fb5c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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/0a533217-a133-4280-88b0-44e860f26b1b%40googlegroups.com.