Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyQT issues with Softimage 2014 SP2 #15

Open
thurman99 opened this issue Feb 5, 2014 · 13 comments
Open

PyQT issues with Softimage 2014 SP2 #15

thurman99 opened this issue Feb 5, 2014 · 13 comments

Comments

@thurman99
Copy link

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
Copy link
Owner

caron commented Feb 5, 2014

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

@caron
Copy link
Owner

caron commented Feb 6, 2014

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

caron commented Feb 6, 2014

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
Copy link
Author

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
Copy link
Owner

caron commented Feb 6, 2014

i will double check my configuration tonight...

@thurman99
Copy link
Author

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
Copy link
Owner

caron commented Feb 6, 2014

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
Copy link
Owner

caron commented Feb 7, 2014

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
Copy link
Owner

caron commented Feb 7, 2014

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
Copy link
Author

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
Copy link

csaez commented Feb 7, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants