modelEditor + PyQt = problems

Become a member of the CGSociety

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

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

Hi!
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.setObjectName("MyWindow")
   		self.resize(800, 600)
   		self.setWindowTitle("PyQt Model Editor Test")
   		
   		self._cameraName= maya.camera(centerOfInterest=2.450351,
   						position = (1.535314, 1.135712, 1.535314),
   						rotation = (-27.612504, 45, 0),
   						worldUp = (-0.1290301, 0.3488592, -0.1290301))[0]
   		maya.cone()
   		modeleditor=maya.modelEditor()
   		maya.modelEditor( modeleditor, edit=True, camera=self._cameraName )
   		self.qtEditor=getControl(modeleditor)
   		
   		self.verticalLayout = QtGui.QVBoxLayout(self)
   		self.verticalLayout.setObjectName("verticalLayout")
   		self.verticalLayout.addWidget(self.qtEditor)
   
   		mel.eval('modelEditor -e -da "smoothShaded" '+ str(modeleditor))
   
   def show():
   		global myWindow
   		myWindow = MyDialog()
   		myWindow.show()
   		myWindow.qtEditor.repaint()


Running by:

import MS_SplashView; win = MS_SplashView.show()


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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 04:49 AM.


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