caron / PyQtForSoftimage

A system for hosting PyQt applications inside Softimage's interface.
29 stars 10 forks source link

PyQT issues with Softimage 2014 SP2 #15

Open thurman99 opened 10 years ago

thurman99 commented 10 years ago

We are having some issues with some PyQt functionality in Soft 2014 sp2. I have a simple button press script that works with 2013, but will not work with 2014. If you run the pywin debugger, and uncomment the pywin.debugger.brk() line, and then press F5 to continue that script then it will work. Here is the script:

http://client.elementxcreative.com/public/code_sample/testPyQTButton.py

caron commented 10 years ago

thanks for this repro script... i am pretty sure i validated 2014 SP2 but i will check again tonight.

caron commented 10 years ago

ok the linked code doesn't have any pyqin.debugger.brk() line and it works in 2014 SP2 on my machine. it logs

# INFO : Inject Clicked
thurman99 commented 10 years ago

the line

pywin.debugger.brk()

is just below the InjectButton.setGeometry.

So you did not have any problems running it? It must be something else in our pipeline confilicting then.

I will send you another TreeView test. We cannot get the tree view to load either.

Thank you so much for looking at this. I hate to bug you about it.

Greg ----- Original Message ----- From: Steven Caron To: caron/PyQtForSoftimage Cc: thurman99 Sent: Wednesday, February 05, 2014 11:35 PM Subject: Re: [PyQtForSoftimage] PyQT issues with Softimage 2014 SP2 (#15)

ok the linked code doesn't have any pyqin.debugger.brk() line and it works in 2014 SP2 on my machine. it logs

INFO : Inject Clicked

— Reply to this email directly or view it on GitHub.

thurman99 commented 10 years ago

That is odd. I just got a response from the Soft developers. They were able to reproduce the problem.

They also tried it with 2013 using Python 2.7.3 externally and had the same issue.

I am sure that I sent you the right code. Here it is below:

''' ####################################################################### #######################################################################

BASE TEMPLATE FILE FOR CONSTRUCTING A PYQT INTERFACE IN SOFTIMAGE

Fill in below AuthorFirstName and AuthorLastName. The code will automatically fill in the Author section below. '''

AuthorFirstName = "" AuthorLastName = "" '''

Do a Find+Replace for TestPyQTTreeView and replace it with the name of the new tool to be developed.

####################################################################### ####################################################################### '''

PyQt BASE IMPORTS

import sip from PyQt4 import QtGui from PyQt4 import QtCore from PyQt4.QtGui import from PyQt4.QtCore import import pywin.debugger

class TestPyQTButton( QDialog ): def init( self, parent=None): QtGui.QWidget.init( self, parent ) self.resize(500,500)

self.InputWidget = QWidget(self) self.InjectButton = QPushButton(self.InputWidget) self.InjectButton.setText("INJECT") self.InjectButton.clicked.connect(self.clickedInject) self.InjectButton.setGeometry(180,120,120,40)

pywin.debugger.brk()

def clickedInject(self): Application.LogMessage("Inject Clicked")

###################################################################################################################

XSI Hooks

################################################################################################################### def XSILoadPlugin( in_reg ): from win32com.client import constants as c in_reg.Name = "TestPyQTButton_Tool" in_reg.Author = AuthorFirstName + " " + AuthorLastName in_reg.RegisterCommand( "TestPyQTButton_Init" )

Menu Hommand Hook! Change the first param to the correct menu placement.

in_reg.RegisterMenu(c.siMenuMCPEditID,"Make_TestPyQTButton",False,False)

def Make_TestPyQTTreeView_Init( in_ctxt ):

oMenu = in_ctxt.Source

oMenu.AddCallbackItem("TestPyQTButton","TestPyQTButton_Init_Execute")

return True

def TestPyQTButton_Init_Execute( in_ctxt=None ): sianchor = Application.getQtSoftimageAnchor() sianchor = sip.wrapinstance( long(sianchor), QWidget ) dialog = TestPyQTButton( sianchor ) dialog.show()

----- Original Message ----- From: Steven Caron To: caron/PyQtForSoftimage Cc: thurman99 Sent: Wednesday, February 05, 2014 11:35 PM Subject: Re: [PyQtForSoftimage] PyQT issues with Softimage 2014 SP2 (#15)

ok the linked code doesn't have any pyqin.debugger.brk() line and it works in 2014 SP2 on my machine. it logs

INFO : Inject Clicked

— Reply to this email directly or view it on GitHub.

caron commented 10 years ago

so they say they reproduce it? what other information have they given?

yes, that looks like the same code but it worked when i ran it last night

thurman99 commented 10 years ago

They tried the code with 2014SP2 with the internal python, and it would not work.

They tried it again with 2014 with external Python 2.7.3 and it would not work.

They tried it with 2014 with external Pyton 2.6.4 and it does work.

They also said with 2013 and external Python 2.7.3, it does not work.

That is exactly what I am seeing here.

----- Original Message ----- From: Steven Caron To: caron/PyQtForSoftimage Cc: thurman99 Sent: Thursday, February 06, 2014 12:20 PM Subject: Re: [PyQtForSoftimage] PyQT issues with Softimage 2014 SP2 (#15)

so they say they reproduce it? what other information have they given?

yes, that looks like the same code but it worked when i ran it last night

— Reply to this email directly or view it on GitHub.

caron commented 10 years ago

i will double check my configuration tonight...

thurman99 commented 10 years ago

I figured out what it was. What version of PyQT were you using?

The lastest version (4.10.3) breaks the tools. I put 4.9 for Python 2.7, and everything works fine now.

You must have an older version of PyQt, which was why it worked for you.

Thanks,

Greg
----- Original Message ----- From: Steven Caron To: caron/PyQtForSoftimage Cc: thurman99 Sent: Thursday, February 06, 2014 3:50 PM Subject: Re: [PyQtForSoftimage] PyQT issues with Softimage 2014 SP2 (#15)

i will double check my configuration tonight...

— Reply to this email directly or view it on GitHub.

caron commented 10 years ago

ok, interesting...

i should try compiling with a more compatible version of Qt/PyQt. ie. PyQt version 4.10.3 uses Qt 4.8.5.

caron commented 10 years ago

i found this issue on the mailing list...

https://groups.google.com/forum/#!msg/xsi_list/0hJqWGMf71I/Vu5Lj58qLbkJ

its me! haha i forgot this was an issue. i will have to update the docs

caron commented 10 years ago

i am using python 2.7.3 and pyqt version 4.7.3. i will try and investigate why the newer versions wont work but i can't promise anything

thurman99 commented 10 years ago

That is funny that you had the issue before with 4.10 and had posted about it.

No problem, we can just use the 4.9.4 version with Python 2.7. I am just glad that there is a good workaround for this. ----- Original Message ----- From: Steven Caron To: caron/PyQtForSoftimage Cc: thurman99 Sent: Friday, February 07, 2014 1:31 AM Subject: Re: [PyQtForSoftimage] PyQT issues with Softimage 2014 SP2 (#15)

i am using python 2.7.3 and pyqt version 4.7.3. i will try and investigate why the newer versions wont work but i can't promise anything

— Reply to this email directly or view it on GitHub.

csaez commented 10 years ago

There was a similar question this week in si-community (pyqt4.10.x) :) http://www.si-community.com/community/viewtopic.php?f=13&t=4866