modelEditor + PyQt = problems

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  10 October 2012
Question modelEditor + PyQt = problems

I've try to run modelEditor example from Autodesk help. Working well:

Then I've create PyQt custom UI:

from PyQt4 import QtCore, QtGui
   import maya.cmds as maya
   import maya.mel as mel
   import maya.OpenMayaUI as mui
   import sip
   def getMayaWindow():
   	'Get the maya main window as a QMainWindow instance'
   	ptr = mui.MQtUtil.mainWindow()
   	return sip.wrapinstance(long(ptr), QtCore.QObject)
   def getControl(controlName):
   	ptr = mui.MQtUtil.findControl(controlName)
   	return sip.wrapinstance(long(ptr), QtCore.QObject)
   class MyDialog(QtGui.QDialog):
   	def __init__(self, parent=getMayaWindow()):
   		super(MyDialog, self).__init__(parent)
   		self.resize(800, 600)
   		self.setWindowTitle("PyQt Model Editor Test")
   						position = (1.535314, 1.135712, 1.535314),
   						rotation = (-27.612504, 45, 0),
   						worldUp = (-0.1290301, 0.3488592, -0.1290301))[0]
   		maya.modelEditor( modeleditor, edit=True, camera=self._cameraName )
   		self.verticalLayout = QtGui.QVBoxLayout(self)
   		mel.eval('modelEditor -e -da "smoothShaded" '+ str(modeleditor))
   def show():
   		global myWindow
   		myWindow = MyDialog()

Running by:

import MS_SplashView; win =

And here I have a strange behaviour, seems that I've try to "inject" wrapped modelEditor by wrong way:

Please help me to get this script working.

Thank you in advance!
  10 October 2012
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 11:58 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.