Ah! I think I was looking at an older Example file. Looking at this new
one, yeah, that seems like a good way to go.
Good to know about the Pick Session stuff. Thanks!
-Tim
On 8/23/2012 6:13 PM, Steven Caron wrote:
1) you can launch softimage code from a pyqt app, so use a normal
pickelement, pickobject, or pickposition. then process the return
values in your python code.
2) i haven't done enough development using uic files so i haven't the
experience with this but could you instead use the pyqt_example.py way
of using uic files and let me know if that refreshes?
https://github.com/caron/PyQtForSoftimage/blob/master/src/pyqt_example.py
s
On Thu, Aug 23, 2012 at 2:01 PM, Tim Crowson
<[email protected]
<mailto:[email protected]>> wrote:
Finally found some time to get Steve Caron's PyQtForSoftimage
plugin up and running. Working great so far! Big thanks to Steve
and any other contributors! Among other things, I'm impressed with
how much more responsive PyQt is in pulling data from Shotgun.
I have two questions:
1) Are Pick Sessions possible?
2) I'm having an issue where my PyQt UIs don't refresh unless I
restart Soft. Instead of compiling a .ui file, or even coding the
UI by hand in the constructor, I'm using Pyqt4.uic to interpret
the UI at runtime. Like so...
/
--------------------------------------------------------------------------------------
from PyQt4 import uic
from PyQt4.QtGui import QMainWindow
form_class = uic.loadUiType(r"Path\to\my\uiFile.ui")
class MainWindow( QMainWindow, form_class ):
def __init__(self, parent):
QMainWindow.__init__(self, parent)
self.setupUi(self)
def XSILoadPlugin( in_reg ):
in_reg.Name = "someTool"
in_reg.Author = "Tim Crowson"
in_reg.RegisterCommand( "someTool" )
def someTool_Execute():
import sip
sianchor = Application.getQtSoftimageAnchor()
sianchor = sip.wrapinstance( long(sianchor), QMainWindow )
ui = MainWindow( sianchor )
ui.show()/
/--------------------------------------------------------------------------------------
/
So far, this works really well. I'm getting my form_class outside
any class or function definition, so Softimage runs this at
startup. But this means that my form_class does not get updated by
simply 'Reloading' the plugin or running 'Update All' from the
plugin manager (should it?). I have to actually restart Softimage
to see any UI updates. I'm wondering how I can go this route and
update my UI without having to restart Soft.
--
*Tim Crowson
*/Lead CG Artist/
*Magnetic Dreams Animation Studio, Inc.
*2525 Lebanon Pike, Building C. Nashville, TN 37214
*Ph* 615.885.6801 <tel:615.885.6801> | *Fax* 615.889.4768
<tel:615.889.4768> | www.magneticdreams.com
<http://www.magneticdreams.com>
[email protected] <mailto:[email protected]>
--
Signature