Hey guys,
im following the digital tutors tutorial to crack QT designer but i have hit a block.
im trying to run the script using this:
import sys
Dir = 'c:/dtQT'
if Dir not in sys.path:
sys.path.append(Dir)
try: reload(masterScript)
except: import masterScript
masterScript.main()
but i am getting this error: # Error: SyntaxError: file line 6: invalid syntax
My py script is currently this:
#
#USER Interface creation for Maya
#
from PyQt4 import QtGui, QtCore, uic
from pymel.core import *
import pymel.core as pm
from pymel import *
import maya.cmds as cmds
from functools import partial
#Path to the designer UI file
ui_filename = 'c:/dtQT/test_ui.ui'
form_class, base_class = uic.loadUiType(ui_filename)
#Interface class
class masterScript_ui(base_class, form_class):
def__init__(self):
super(base_class, self).__init__()
self.setupUi(self)
self.setObjectName('test_ui')
self.setDockNestingEnabled(True)
self.connectInterface()
def connectInterface(self):
QtCore.QObject.connect(self.SelectionVertex, QtCore.SIGNAL("clicked()"),self.SelectionVertexWin)
QtCore.QObject.connect(self.SelectionEdge, QtCore.SIGNAL("clicked()"),self.SelectionEdgeWin)
#QtCore.QObject.connect(self.SelectionBorder, QtCore.SIGNAL("clicked()"),self.SelectionBorderWin)
QtCore.QObject.connect(self.SelectionPolygon, QtCore.SIGNAL("clicked()"),self.SelectionPolygonWin)
QtCore.QObject.connect(self.SelectionElement, QtCore.SIGNAL("clicked()"),self.SelectionElementWin)
def SelectionVertexWin(self):
mel.eval('global proc SelectionVertex(){SelectVertexMask;}')
mel.SelectionVertex()
def SelectionEdgeWin(self):
mel.eval('global proc SelectionEdge(){SelectEdgeMask;}')
mel.SelectionEdge()
#def SelectionBorderWin(self):
mel.eval('global proc SelectionBorder(){SelectEdgeMask;}')
mel.SelectionBorder()
def SelectionPolygonWin(self):
mel.eval('global proc SelectionPolygon(){SelectFacetMask;}')
mel.SelectionPolygon()
def SelectionElementWin(self):
mel.eval('global proc SelectionElement(){SelectToggleMode;}')
mel.SelectionElement()
#main
def main():
global ui
ui=test_ui()
ui.show()
if__name__== "__main__":
main()
My QT UI is called “test_ui.ui”
Really hope someone here can spot the problem because I am stumped!