Two questions about PyQt in Soft (re: Pick Sessions, UI Refresh)

535 views
Skip to first unread message

Tim Crowson

unread,
Aug 23, 2012, 5:01:53 PM8/23/12
to soft...@listproc.autodesk.com
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 | Fax  615.889.4768 | www.magneticdreams.com
tim.c...@magneticdreams.com

 

Steven Caron

unread,
Aug 23, 2012, 7:13:49 PM8/23/12
to soft...@listproc.autodesk.com
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

Tim Crowson

unread,
Aug 24, 2012, 9:55:39 AM8/24/12
to soft...@listproc.autodesk.com
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
--
 

 

Steven Caron

unread,
Aug 24, 2012, 3:09:49 PM8/24/12
to soft...@listproc.autodesk.com
so you are confirming the development of the ui using qt designer and .ui/.uic files is more dynamic? refreshes when you expect it to?

s

Tim Crowson

unread,
Aug 24, 2012, 3:16:29 PM8/24/12
to soft...@listproc.autodesk.com
Inconclusive so far, that comment was based strictly on how the code appeared. Haven't been able to test it yet: I've been sidetracked by a more insidious problem (see other thread) where Softimage insists on using its own Python rather than the system's on some of our boxes... (seems we might have to resort to installing pywin locally on each one, since we can't get pywin to play ball from our network site-packages).

-Tim
--
 

 

Tim Crowson

unread,
Aug 24, 2012, 4:31:18 PM8/24/12
to soft...@listproc.autodesk.com
Steve, I can confirm that yes, this does allow me to refresh as expected. It's actually quite fast. Close the tool in Soft, make some changes in Designer, save, and relaunch the tool in Soft. Changes appear instantly. Nice.


-Tim

On 8/24/2012 2:09 PM, Steven Caron wrote:
--

 

 

Steven Caron

unread,
Aug 24, 2012, 4:35:26 PM8/24/12
to soft...@listproc.autodesk.com
great news!

i dont get to use the pyqt interfaces as much as i want to (yet) and i want to hear more from the community on the ups and downs of jo's and my plugin.

i also am hoping some people could start sharing their examples? maybe some tutorials? wink wink

s

Tim Crowson

unread,
Aug 24, 2012, 4:51:45 PM8/24/12
to soft...@listproc.autodesk.com
Everything I'm working on now is internal pipeline stuff, but considering how blazingly fast I can get stuff up and running thanks to Designer and Eclipse, it will be a breeze to redo something like my Multi-Importer.

This has been a major win of the week for me. Thanks!
-Tim
--
 

 

Simon Anderson

unread,
Aug 25, 2012, 4:01:34 AM8/25/12
to soft...@listproc.autodesk.com
Starting to plan one soon man :) will have a tut out sometime in the future. At the moment bogged down with alot, but I have a plan in the pipe for a Qt tut.

Qt for the win man!! :D
--
-------------------
Simon Ben Anderson
blog: http://vinyldevelopment.wordpress.com/

Tim Crowson

unread,
Aug 27, 2012, 11:52:19 AM8/27/12
to soft...@listproc.autodesk.com
Following up...

This weekend I was able to use my MultiImporter tool as a test for getting my feet wet with Qt in Softimage. I've done some Qt standalone apps, and in Fusion, but the integration with Soft is still new to me.  I'm attaching the addon here if you want to have a look (if any of you can look at the code too, it would be very helpful to me, it's only 120 lines or so of actual code). This is no fancy app. Basically just a skin for looping import commands.



Here are some more questions I have:
1) HTML Links. They get formatted correctly, but clicking on them has no effect. Any idea about how to get HTML links working properly? Again, something that has worked fine so far in other implementations.

2) Proper Tool Termination. I think this one is a little over my head. There seems to be a memory leak: closing a tool never releases the ram consumed by it. It's not a lot of ram, of course, but it adds up quickly. I'm wondering if my tool is being closed improperly. I looked at Simon's issue on github, describing how events need to be disconnected, but my tool doesn't explicitly leverage Softimage events. Normally, I would handle the closing by running sys.exit(app.exec_()).

if __name__ == '__main__': # but since we're already in Softimage, this would just be 'def toolName_Execute():'
    app = QtGui.QApplication(sys.argv)
    app.processEvents()
    form = MainWindow()
    form.show()
    sys.exit(app.exec_())


But this fails in Soft, and I'm frankly not savvy enough yet to understand why. As it is now, I can't use sys.exit(), and although my tool ui closes, I'm not convinced the app itself has ceased running.

3) Weird FileBrowser Look. The look and feel of the filebrowser is a bizarre blend of the Windows and the Softimage designs. Quite buggy. Anyone have some insight into this?

4) QMessageBox question (not soft-related).  How do I customize the scale of standard buttons on a QMessageBox once a Stylesheet has been applied to the parent widget? In the 'About' message box, the 'OK' button is automatically scaled to fit the characters. Would like to set the scale of that button. Haven't been able to find info on this yet.

Anyway, you have the addon here if you want to install it and look at the code (again, it's really simple, not long at all). I'd be most grateful for feedback on how to fix these issues. If some are issues with the PyQtForSoftimage addon, we can add those to the list on Steve's github.

-Tim C.
MultiImporter_Qt.xsiaddon

Ana Gomez

unread,
Aug 27, 2012, 12:36:50 PM8/27/12
to soft...@listproc.autodesk.com
Congratulations for your window!

I'm going to try to answer some points, for the rest I would need more time to look them:

2) Proper Tool Termination

Try one thing and tell me if you are still loosing memory. Make these changes:

def MultiImporter_Qt_Execute():
    ...
    sianchor = sip.wrapinstance(long(sianchor), QWidget)     #With QDialog works too, but all what i've done, i've done in that way. Anyway, QDialog inherit from QWidget :D
    dialog = MuiltImporterDialog(uifilepath, sianchor)             #The parent used to be specified as last argument, change your init declaration if you still want this in that order.
    dialog.show()

I don't know why you are creating so many things. You don't need to create an intermediate dialog. I think that this is what remains alive.


3) Weird FileBrowser Look

The same has happend to me. I have changed the style and the palette. You have also changed the stylesheet.
I haven't tried yet, but I wanted to save the previous palette before changing it  and apply it to the file browser. It will look like as a normal window, but I think it would be better that the frankestein.

Bye




Tim Crowson

unread,
Aug 27, 2012, 1:01:03 PM8/27/12
to soft...@listproc.autodesk.com
Thanks Ana,

I'm still getting the memory problem even after making the change you suggested. I got rid of the extra dialog too. I've attached the update addon, for what it's worth.

I don't understand how to fix the filebrowser problem. What is strange to me is how it seems to inherit some of the Softimage look. If it was half-Windows, half-Qt, that would be something I could understand more easily. But half-Windows, half-Softimage... that's just strange.


By the way, I have one more question. Steve Caron put me on a good track to solving this myself, but I thought I'd ask it anyway. Right now, I can spawn more and more UIs by simply firing the command. I need to prevent the UI from launching if it already exists. I know I can use QApplication to get a list of Widgets and go from there, but should I do that in the Execute definition, or in the class constructor, or where?


Thanks for you help!


Tim Crowson
Lead CG Artist

Magnetic Dreams Animation Studio, Inc.
2525 Lebanon Pike, Building C. Nashville, TN 37214
Ph  615.885.6801 | Fax  615.889.4768 | www.magneticdreams.com
tim.c...@magneticdreams.com

 




--

 


MultiImporter_Qt.xsiaddon

Ana Gomez

unread,
Aug 27, 2012, 1:12:33 PM8/27/12
to soft...@listproc.autodesk.com
How are you cheecking the memory?

To prevent opening the window twice I use this:

...
for o_children in sianchor.children():
    if  isinstance(o_children, <myClassWindow>):
        return

...

One more thing. For the point...

1) HTML Links. Change the direction of the slashes in the url. If it doesn't work, write this before setting the text: 'box.setTextFormat(QtCore.Qt.RichText)'

Tim Crowson

unread,
Aug 27, 2012, 1:59:57 PM8/27/12
to soft...@listproc.autodesk.com
Ana,

- Your method for preventing multiple windows seems to work, but once I close the ui, I can't relaunch it (which makes me wonder if it's really gone. Still not understanding how to properly kill it on close).

- changing the direction of the slashes fixes the HTML links! Thanks for the tip!

Thank you, Ana!
-Tim C.
--

 

Steven Caron

unread,
Aug 27, 2012, 2:02:13 PM8/27/12
to soft...@listproc.autodesk.com
her example i dont believe was complete... if you find an instance you need to return the class then .show(). right?

s

Tim Crowson

unread,
Aug 27, 2012, 2:24:39 PM8/27/12
to soft...@listproc.autodesk.com
Actually, it might help if I could see the whole Execute() definition, so I can see snippets in context. Not just for preventing multiple windows, but also for properly closing the app.
-Tim
--
 

 

Ana Gomez

unread,
Aug 27, 2012, 2:24:45 PM8/27/12
to soft...@listproc.autodesk.com
Tim! I think I know what it is happening. You are right, your window is not being destroy when you close the window.
Write this on the init of your window: 'self.setAttribute(QtCore.Qt.WA_DeleteOnClose)'. Check the memory again and open several times the window, close it and open it.


Ana Gomez

unread,
Aug 27, 2012, 2:30:45 PM8/27/12
to soft...@listproc.autodesk.com
class MuiltImporterDialog( QDialog ):
    def __init__( self, uifilepath, parent ):
        QDialog.__init__(self, parent)
        QApplication.setStyle(QtGui.QStyleFactory.create('Plastique'))
        self.ui = uic.loadUi( uifilepath, self)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.setConnections()
        self.init_UI()

(.....)

def MultiImporter_Qt_Execute():
    srcDir = ''
    for plugin in Application.Plugins:
        if plugin.Name == 'MultiImporter_Qt':
            srcDir = os.path.dirname(plugin.Filename)
    uifilepath = os.path.join(srcDir,'MultiImporter.ui')

    sianchor = Application.getQtSoftimageAnchor()
    sianchor = sip.wrapinstance( long(sianchor), QWidget )
 
    for o_children in sianchor.children():
        if  isinstance(o_children, MuiltImporterDialog):
           return

   
    dialog = MuiltImporterDialog(uifilepath, sianchor) 
    dialog.show()



Tim Crowson

unread,
Aug 27, 2012, 2:41:02 PM8/27/12
to soft...@listproc.autodesk.com
Ah! I think that works, Ana! The ram is almost completely freed up when the window is closed now. A small percentage remains, but nothing like before. I can't thank you enough!
-Tim


On 8/27/2012 1:24 PM, Ana Gomez wrote:
Tim! I think I know what it is happening. You are right, your window is not being destroy when you close the window.
Write this on the init of your window: 'self.setAttribute(QtCore.Qt.WA_DeleteOnClose)'. Check the memory again and open several times the window, close it and open it.



--

 


 

Ana Gomez

unread,
Aug 27, 2012, 2:47:54 PM8/27/12
to soft...@listproc.autodesk.com
great news!!
How are you measuring the memory? I'd like to do it too.
I'll keep you informed on my progresses with the file browser.

Steven Caron

unread,
Aug 27, 2012, 2:50:37 PM8/27/12
to soft...@listproc.autodesk.com
great news!

tim can you log some issues on the github page? simply asking for the example python file to contain this attribute and another for an example showing how to check for other instances of your pyqt app?

this type of plugin really is just a connection of two APIs, knowledge of qt and how its APIs are essential, but in this case i would like to provide in the examples python file a hint as to how to avoid this issue you encountered.

s

Tim Crowson

unread,
Aug 27, 2012, 2:52:18 PM8/27/12
to soft...@listproc.autodesk.com
Big thanks to Ana and Steve for helping me sort through some of the trouble I was having. Much tighter stuff now. I'm attaching the latest version (1.12) for whoever is interested.
MultiImporter_Qt.xsiaddon

Miquel Campos

unread,
Aug 27, 2012, 2:55:05 PM8/27/12
to soft...@listproc.autodesk.com
Thank you Tim for share your code :)


----------------------------------------------------
----------------------------------------------------
Miquel Campos
Character & Animation TD
 www.akaosaru.com
----------------------------------------------------
----------------------------------------------------



2012/8/27 Tim Crowson <tim.c...@magneticdreams.com>

Tim Crowson

unread,
Aug 27, 2012, 2:56:02 PM8/27/12
to soft...@listproc.autodesk.com
Sure thing. I'll do that shortly!

Ana, as far as checking memory goes, I'm really a newbie, so I'm just looking at the Process list in the Task Manager. I'd love to know a more accurate way, because I know that only shows part of the information.

-Tim
--
 

Steven Caron

unread,
Aug 27, 2012, 2:59:23 PM8/27/12
to soft...@listproc.autodesk.com
thanks tim!

once this is 'finished' it would be great to see it on rray.de/xsi and link on the github page as projects using the plugin. a great, simple example.

s

Tim Crowson

unread,
Aug 27, 2012, 3:10:47 PM8/27/12
to soft...@listproc.autodesk.com
Right on. Still two things that need smoothing out, although they're strictly cosmetic:
1) the funky FileBrowser
2) the teeny tiny 'Ok' button in the 'About' dialog. I still don't know enough about Qt to fix that. I could use a brute force method by creating a new class for it, which would give me maximum control, but I'd rather just learn how to manipulate the built-in QMessageBox class better...

-Tim
--


 

Steven Caron

unread,
Aug 27, 2012, 3:12:18 PM8/27/12
to soft...@listproc.autodesk.com
take your time!

Luc-Eric Rousseau

unread,
Aug 27, 2012, 3:55:09 PM8/27/12
to soft...@listproc.autodesk.com
If Softimage is changing the look of the controls in your dialog box in an unpleasant way, use the method SuspendWin32ControlsHook before creating the dialog, and call  RestoreWin32ControlsHook afterwards

Steven Caron

unread,
Aug 27, 2012, 4:02:16 PM8/27/12
to soft...@listproc.autodesk.com
these are only exposed to the cpp api right? so i need to expose this to scripting in the QtSoftimage plugin...

s

Luc-Eric Rousseau

unread,
Aug 27, 2012, 4:28:30 PM8/27/12
to soft...@listproc.autodesk.com
On Mon, Aug 27, 2012 at 4:02 PM, Steven Caron <car...@gmail.com> wrote:
> these are only exposed to the cpp api right? so i need to expose this to
> scripting in the QtSoftimage plugin...

it's there in scripting

desktop = Application.Desktop
desktop.SuspendWin32ControlsHook()
desktop.RestoreWin32ControlsHook()

Steven Caron

unread,
Aug 27, 2012, 4:34:08 PM8/27/12
to soft...@listproc.autodesk.com
oh nice... thanks luc-eric!

@tim, give this a shot?

Tim Crowson

unread,
Aug 27, 2012, 5:14:36 PM8/27/12
to soft...@listproc.autodesk.com
Yeah, lemme see how this works...
-Tim
--
 

 

Tim Crowson

unread,
Aug 27, 2012, 5:32:54 PM8/27/12
to soft...@listproc.autodesk.com
Yes, that seems to do the trick! New version (v1.13) is attached.
Thanks Luc-Eric!

Now, any Qt experts who can tell me about button sizes for standard buttons on a QMessageBox?  ;-)


-Tim



On 8/27/2012 3:34 PM, Steven Caron wrote:
--
 
MultiImporter_Qt.xsiaddon

Steven Caron

unread,
Aug 27, 2012, 6:04:24 PM8/27/12
to soft...@listproc.autodesk.com
great news! sorry to ask this of you again, but could you log another separate issue on github? i ask because a) i am super busy and b) i can't get to it now and need a nice reminder

s

Tim Crowson

unread,
Aug 27, 2012, 6:08:05 PM8/27/12
to soft...@listproc.autodesk.com
No problem! :-)
-Tim
--

 

 

Tim Crowson

unread,
Aug 27, 2012, 6:10:49 PM8/27/12
to soft...@listproc.autodesk.com
I've also added a page about it on my site:
http://dynamiclens.com/wordpress/?page_id=750


-Tim


On 8/27/2012 5:04 PM, Steven Caron wrote:
--

Simon Anderson

unread,
Aug 27, 2012, 9:16:12 PM8/27/12
to soft...@listproc.autodesk.com
Hey Tim,

Will take a look at some code when im home later, and see if I can help you with making the button bigger.
--
-------------------
Simon Ben Anderson
blog: http://vinyldevelopment.wordpress.com/

Simon Anderson

unread,
Aug 27, 2012, 9:18:25 PM8/27/12
to soft...@listproc.autodesk.com
Nice tool also, its great seeing more and moer people releasing tools for softimage :) keep the community healthy and push soft! :D

Vladimir Jankijevic

unread,
Aug 28, 2012, 3:42:00 AM8/28/12
to soft...@listproc.autodesk.com
here is how to make a question message box with three different buttons. For the arguments: parent, title, question, buttons, default button. this example is not from a softimage plugin but I hope it helps though.

msgBox = QMessageBox()
msgboxReturn = msgBox.question( self, 'Title', 'Question?', QMessageBox.Yes | QMessageBox.Cancel | QMessageBox.Retry, QMessageBox.Yes )

cheers
vladimir
--
---------------------------------------
Vladimir Jankijevic
Technical Direction

Elefant Studios AG
Lessingstrasse 15
CH-8002 Zürich

+41 44 500 48 20

www.elefantstudios.ch
---------------------------------------

Ana Gomez

unread,
Aug 28, 2012, 4:38:39 AM8/28/12
to soft...@listproc.autodesk.com
Hello!!

For the size of your button I think you could try with

box.setStyleSheet('QPushButton{padding: 100px;}')

or

box.setStyleSheet('QPushButton{height: 100px; width: 100px}')

I don't know if you can manage it without playing with the style sheets.

Bye

Simon Anderson

unread,
Aug 28, 2012, 8:34:39 AM8/28/12
to soft...@listproc.autodesk.com

you can try this:

        sized_btn = QPushButton( "Sized" )
        sized_btn.setFixedHeight( 100 )
        mBox = QMessageBox()
        mBox.setText("BOB")           
        mBox.addButton(sized_btn, QMessageBox.AcceptRole)
        mBox.setStandardButtons( QMessageBox.Discard | QMessageBox.Cancel)
       
         mBox.setDefaultButton(sized_btn)
         mBox.exec_()

Simon Anderson

unread,
Aug 28, 2012, 8:37:12 AM8/28/12
to soft...@listproc.autodesk.com
What that does is allows you to add a QPushButton in place of a standard button, and allows you to specify the buttons role in the QMessageBox

Button Roles:
http://qt-project.org/doc/qt-4.8/qmessagebox.html#ButtonRole-enum

hope that is more along the lines of what you were trying to achieve.

Tim Crowson

unread,
Aug 28, 2012, 10:29:06 AM8/28/12
to soft...@listproc.autodesk.com
Thank everyone! Just to follow up...

1. Ana, I had no idea you could set button size and width via CSS. That worked! To be honest, although Qt classes and methods are well documented, I've had a hard time finding comprehensive descriptions of available stylesheet attributes. I've looked at the standard Stylesheet example page, and a few others here and there, but if there's a complete list of attributes covered by CSS, I'd love to see it! Simon, I didn't actually try your solution yet, but that looks like a great idea in case we need more control.

2. In my testing, I've been launching the tool via hotkey (alt-i in my case). It wasn't until last night that it hit me: I had not yet registered this command in a menu anywhere in Softimage! The command now appears under the File > Import menu.

So a new version (1.14) is ready. I'm attaching the full addon, or if you have it already installed, I'm also attaching the .py file for easy updating. Finally, I should point out that this was tested in Soft 2012. I have 2013 but haven't fully tested it yet. Can anyone tell me if this works in 2011? And again, just want to say thanks to everyone for helping me work through this stuff. It's a simple tool, but it's turned out to be a good learning ground.

-Tim C.
--

 

MultiImporter_Qt.zip
MultiImporter_Qt.py

Ana Gomez

unread,
Aug 28, 2012, 11:11:27 AM8/28/12
to soft...@listproc.autodesk.com

Simon Anderson

unread,
Aug 28, 2012, 7:25:09 PM8/28/12
to soft...@listproc.autodesk.com
Im not sure what Dev Environment you are using, but if you use eclipse and install pyDev for it, when you develop for Qt you get auto completion, wich can be very helpful.

Tim Crowson

unread,
Aug 29, 2012, 10:12:50 AM8/29/12
to soft...@listproc.autodesk.com
As a matter of fact, Simon, that's the exact setup I use! I especially like Eclipse's "interactive debugging", for lack of a better term, where it instantly highlights syntax errors, unused variables, undefinied variables, etc. Really speeds things up! So many other things to like about Eclipse too. So far, my workflow is to create a new addon directory from Soft, then set that as a PyDev project in Eclipse. I still use Sublime Text 2 every now and then for one-offs, but Eclipse my main environment.


Tim Crowson
Lead CG Artist

Magnetic Dreams Animation Studio, Inc.
2525 Lebanon Pike, Building C. Nashville, TN 37214
Ph  615.885.6801 | Fax  615.889.4768 | www.magneticdreams.com
tim.c...@magneticdreams.com



--

 


 

piotrek marczak

unread,
Aug 29, 2012, 4:17:49 PM8/29/12
to soft...@listproc.autodesk.com
Sorry for stupid question, but what’s advantage of using qt over PPG?

Tim Crowson

unread,
Aug 29, 2012, 6:07:16 PM8/29/12
to soft...@listproc.autodesk.com
That's not a stupid question. I'll answer as best I can. More experienced people can correct me and add their own voices. The PPG options in Softimage are substantially more limited than what Qt offers. And by 'substantially,' I mean not even in the same category. I can't possibly cover all the differences, but I can hit some practical highlights:

Under-the-hood stuff:
- A great variety of signals for defining more specific callbacks (not limited to on_clicked() or on_changed())
- Model view programming, to efficiently store and share data across your UI! This is big!
- The full power of the Qt library, which contains over 400 classes.
- UI files created in QtDesigner can be loaded into any app that runs a Python Qt library (as far as I know). So it's good for more than just Softimage stuff.

Look-and-feel stuff:

- Tab Widgets anywhere you want. You're not limited to placing them at the top
- Buttons defined to look any way you like
- Intelligent 'Layouts' that resize their contents elegantly (including Slider layouts which can be collapsed)
- Dockable widgets
- Tree views!
- Menu bars!
- Status bar!
- Toolbars!
- Extremely detailed control over the design via CSS.

I could go on, but perhaps we need some people to post more examples to really demonstrate how useful it is.

Tim Crowson
Lead CG Artist

Magnetic Dreams Animation Studio, Inc.
2525 Lebanon Pike, Building C. Nashville, TN 37214
Ph  615.885.6801 | Fax  615.889.4768 | www.magneticdreams.com
tim.c...@magneticdreams.com




Simon Anderson

unread,
Aug 29, 2012, 7:30:55 PM8/29/12
to soft...@listproc.autodesk.com
As Tim wrote, what ever you can imagen you can achieve with Qt, and usualy extremly rappidly due to the structure of the API. In the past I have writen entire project tracking systems, and some really fun and interactive tools.

The only down side to QT is that at the moment if you do develop a plugin and a user wasnt to run it they have to install a bunch of 3rd party plugins to get the software to run, but if your willing to do that then you can have some really great tools.

Eric Thivierge

unread,
Aug 29, 2012, 7:44:03 PM8/29/12
to soft...@listproc.autodesk.com
Also to note, if you're in a mixed pipeline but need the same tool (asset loader for example) creating the UI in Qt will keep it consistant across apps. Recently I ported my renamer tool to PyQt and it looks exactly the same in Maya as it does in Softimage. Small tweaks to the code obviously for the actual renaming.

PyQt is a pythonic way of creating UIs as well so if you're familiar with python programming, creating UIs will feel more natural than the Softimage PPG widgets. As Tim said above, it's infuriatingly hard to create nicely spaced UIs in Softimage out of the box.

Also if any of the devs are reading, please can we get a built in PyQt implementation? Pretty please? If I had a choice as to where my subscription money went, I'd put it all towards that. :D

--------------------------------------------
Eric Thivierge
http://www.ethivierge.com

Simon Anderson

unread,
Aug 29, 2012, 7:46:42 PM8/29/12
to soft...@listproc.autodesk.com
+1

piotrek marczak

unread,
Aug 30, 2012, 2:59:20 AM8/30/12
to soft...@listproc.autodesk.com
Thanks guys, im just installing it Usmiech
One more question if you don’t mind,
all Qt applications look the same,
maya, nuke, mari, sometimes is hard to tell which one you’re seeing in screenshot
does that mean you cannot ‘skin’ Qt window? Give it abit of SI look for example is not possible?
wlEmoticon-smile[1].png

Eric Thivierge

unread,
Aug 30, 2012, 3:04:41 AM8/30/12
to soft...@listproc.autodesk.com
Please don't give it a bit of SI look. Blah! Its so old school and needs some updating IMO. :)

You can "skin" the UI using CSS (Style sheets). See Ana's message above. You can change it according to some variable which determines which app you're in.


--------------------------------------------
Eric Thivierge
http://www.ethivierge.com


wlEmoticon-smile[1].png

Nick Angus

unread,
Aug 30, 2012, 6:34:07 AM8/30/12
to soft...@listproc.autodesk.com

+1

Tim Crowson

unread,
Aug 30, 2012, 10:11:07 AM8/30/12
to soft...@listproc.autodesk.com
+100

As for Qt apps looking the 'same', I think that's just because certain conventions work really well for 3D DCC apps (dark gray, lots of controls on the screen). Honestly, you can make apps look just about any way you like.
-Tim
--
 

 

piotrek marczak

unread,
Sep 7, 2012, 5:36:00 AM9/7/12
to soft...@listproc.autodesk.com
SignatureThanks Tim, good learning resource
btw

srcDir = ''
for plugin in Application.Plugins: # Isn't there an easier way to get this
path?
if plugin.Name == 'MultiImporter_Qt':
srcDir = os.path.dirname(plugin.Filename)

like this:
srcDir = ''
srcDir = os.path.dirname( Application.Plugins(
'MultiImporter_Qt' ).Filename )

From: Tim Crowson
Sent: Tuesday, August 28, 2012 12:10 AM
To: soft...@listproc.autodesk.com
Subject: Re: Some more questions about PyQt in Softimage

Ana Gomez

unread,
Sep 7, 2012, 8:04:35 AM9/7/12
to soft...@listproc.autodesk.com
Right!! And you can also get the path directly:

Application.Plugins( 'MultiImporter_Qt' ).OriginPath



On Fri, Sep 7, 2012 at 11:36 AM, piotrek marczak <piotrek...@gmail.com> wrote:
SignatureThanks Tim, good learning resource
btw

srcDir = ''
 for plugin in Application.Plugins: # Isn't there an easier way to get this path?

     if plugin.Name == 'MultiImporter_Qt':
         srcDir = os.path.dirname(plugin.Filename)

like this:
srcDir = ''
srcDir = os.path.dirname( Application.Plugins( 'MultiImporter_Qt' ).Filename )

From: Tim Crowson
Sent: Tuesday, August 28, 2012 12:10 AM
To: soft...@listproc.autodesk.com
Subject: Re: Some more questions about PyQt in Softimage


I've also added a page about it on my site:
http://dynamiclens.com/wordpress/?page_id=750

-Tim



On 8/27/2012 5:04 PM, Steven Caron wrote:
great news! sorry to ask this of you again, but could you log another separate issue on github? i ask because a) i am super busy and b) i can't get to it now and need a nice reminder

s


Cristobal Infante

unread,
Sep 7, 2012, 8:58:40 AM9/7/12
to soft...@listproc.autodesk.com
Hi Tim, sorry for the unrelated question, but where did you get that grey stylesheet from?

I am using QT designer to generate my UIs and it only offers a handfull of styles..

Tim Crowson

unread,
Sep 7, 2012, 9:47:01 AM9/7/12
to soft...@listproc.autodesk.com
Ah! It's so simple, of course!I swear I tried something like that at one point and came up with nothing. Thanks for posting this!
-Tim
--

 

 

Tim Crowson

unread,
Sep 7, 2012, 9:51:02 AM9/7/12
to soft...@listproc.autodesk.com
That style is my own, created via the Stylesheets in QtDesigner. Here's a primer on how that works: http://doc.qt.nokia.com/4.7-snapshot/stylesheet-examples.html
-Tim
--

 

Tim Crowson
Lead CG Artist

Magnetic Dreams Animation Studio, Inc.
2525 Lebanon Pike, Building C. Nashville, TN 37214
Ph  615.885.6801 | Fax  615.889.4768 | www.magneticdreams.com
tim.c...@magneticdreams.com

Confidentiality Notice: This email, including attachments, is confidential and should not be used by anyone who is not the original intended recipient(s). If you have received this e-mail in error please inform the sender and delete it from your mailbox or any other storage mechanism. Magnetic Dreams, Inc cannot accept liability for any statements made which are clearly the sender's own and not expressly made on behalf of Magnetic Dreams, Inc or one of its agents.

 

Reply all
Reply to author
Forward
0 new messages