PyQt For Softimage

1154 views
Skip to first unread message

Steven Caron

unread,
Oct 13, 2011, 4:34:37 AM10/13/11
to soft...@listproc.autodesk.com
hey everybody

here is the project page which will host all the necessary code to use pyqt in softimage on windows.


its stripped down version of the relevant blur code from their google code site. it also includes the qtwinmigrate source code and the python wrappers to expose it to python and pyqt (this is the part that makes this all possible).

note this is incomplete at this time, i still need to setup the build system (cmake) for compiling against your python, pyqt, and qt version of choice. i expect the first binary release (with or without a polished build system) will be next week sometime. but if you are feeling adventurous everything you will need source code wise is available, not including some pre-requisites. i can list these pre-requisites for those interested.

steven


Olivier Jeannel

unread,
Oct 13, 2011, 7:33:43 AM10/13/11
to soft...@listproc.autodesk.com
Hello list,

I'm asking the question straightforward : How do you re order the point
ID of an object ?
I have an object
NbPoint = 121
Point ID = 0 to 120

I'd like to offset with a value of 120 so that the
Point ID = 120 to 240

each time I try to set some ID, Ice turns red or yellow.

Get Self.ID > Add 120 > Set Self.IDoffset turns yellow on the object.
And it doesn't work if I try to store that IDoffset in another Null object.

What is the good method ?
Arrays and me....

Thanks

Vladimir Jankijevic

unread,
Oct 13, 2011, 7:37:29 AM10/13/11
to soft...@listproc.autodesk.com
you can't! first, the ID attribute is a read-only one and second, the IDs must always be 0 to "last number of element -1".

why do you want this?
--
---------------------------------------
Vladimir Jankijevic
Technical Direction

Elefant Studios AG
Lessingstrasse 15
CH-8002 Zürich

+41 44 500 48 20

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

Olivier Jeannel

unread,
Oct 13, 2011, 8:04:19 AM10/13/11
to soft...@listproc.autodesk.com
I'm doing a looong one shot sequence with Particles (pearls) flying from goal to goal.
I'm doing this using States and StateMachine where MoveTowardsGoal are plugged.
I need each Particle to be precizely positionned on each point of the goal. So in MoveTowardsGoal I use UseInputPositionValues.
In the attached image you see I select the particles by IDs. So that Particle ID 22 belongs to goal PointID 22.
But I need for example, particle N°from 120 to 240 to stick respectively to goal Point ID from 0 to 120.

I tried to rescale my particle ID, but failed miserably. (That's why I wanted to try cheat with reordering pointID)

Hope I'm average clear...
Goal.png

Olivier Jeannel

unread,
Oct 13, 2011, 8:13:19 AM10/13/11
to soft...@listproc.autodesk.com
Ah Crap,
I found. Just substracted instead of adding to the ParticlesIDs.


Le 13/10/2011 13:37, Vladimir Jankijevic a écrit :

Enrique Caballero

unread,
Oct 13, 2011, 9:51:52 AM10/13/11
to soft...@listproc.autodesk.com
this is awesome, im currently using blurcore but i look forward to seeing your implementation

Alan Fregtman

unread,
Oct 13, 2011, 10:38:47 AM10/13/11
to soft...@listproc.autodesk.com
Random question... Can yours and Blur's implementation from the full
set of BlurTools coexist?

I know it's redundant, but say you wanted to have access to some of
the BlurTools and some future plugin by somebody said in its
requirements it needed your PyQtForSoftimage plugin, if I installed
yours while BlurTools are still installed, do they conflict?

And as a dev, will it be easy enough to detect either is installed and
pick one to use without having to change most of the UI coding? I
assume since yours is the Blur one stripped out, the function names
and such are mostly/almost the same?

Can't wait to try it when the compiler is ready. ;)
Cheers,

-- Alan

Xavier Lapointe

unread,
Oct 13, 2011, 10:41:24 AM10/13/11
to soft...@listproc.autodesk.com
That's really cool Steven, thanks for sharing (:

I was wondering, is this compatible with Linux? I'm scared that it isn't just by its name (WinMigrate). I saw some reference of windows.h in the code (but haven't looked how much it is involved).

Cheers!



2011/10/13 Enrique Caballero <enriquec...@gmail.com>



--
Xavier

Alan Fregtman

unread,
Oct 13, 2011, 10:42:32 AM10/13/11
to soft...@listproc.autodesk.com
> Get Self.ID > Add 120 > Set Self.IDoffset turns yellow on the object.

Self.ID is read-only.
Self.ID is only for particles, also. To get an index of Point IDs from
geometry, Get Point Position -> Get Element Index (as seen inside the
"Get Point ID" factory compound.)

May I ask.. why do you need to set it? Can't you use a custom
attribute with another name in whatever that needs it later in the
tree?

-- Alan

Mathieu Dufresne

unread,
Oct 13, 2011, 11:03:28 AM10/13/11
to soft...@listproc.autodesk.com

I think what you were looking for is the modulo node.

 

For example, if you have point IDs 0 to 8 and you modulo by 3, it will return the following:

 

Point. ID              Returned modulo

0             ->           0

1             ->           1

2             ->           2

3             ->           0

4             ->           1

5             ->           2

6             ->           0

7             ->           1

8             ->           2

 

So if you take your point Ids and modulo by 120, I think it should split out your particles just like you want them!

Olivier Jeannel

unread,
Oct 13, 2011, 11:09:30 AM10/13/11
to soft...@listproc.autodesk.com
Thank you Alan,

Didn't think of the Element Index....

I agree, it's not very clean. I started storing my datas in a Null at
the beginning.
But I'm still testing, changing animations and idea.
I kept going back and forth between the 2 Icetrees, finally I found
faster (and messier) to have everything under the same tree.

That's why ;)

Le 13/10/2011 16:42, Alan Fregtman a �crit :

Greg Punchatz

unread,
Oct 13, 2011, 11:13:27 AM10/13/11
to soft...@listproc.autodesk.com
You are kinda awesome dude- thanks!!


Greg Punchatz
Sr. Creative Director
Janimation
214.823.7760
www.janimation.com

Olivier Jeannel

unread,
Oct 13, 2011, 11:21:55 AM10/13/11
to soft...@listproc.autodesk.com
Thank you Mathieu, the Modulo worked well :)

Steven Caron

unread,
Oct 13, 2011, 1:13:04 PM10/13/11
to soft...@listproc.autodesk.com
hey enrique

when you say you are using 'blurcore' do you mean you are already using all the blur code available from their google code site?
also, note i have done very little to the code. i battled with re writing so i could release it under my own licensing terms but the amount of work there is very large. so really, its not my implementation.

s

Steven Caron

unread,
Oct 13, 2011, 1:20:35 PM10/13/11
to soft...@listproc.autodesk.com
there is possibility of conflicts for sure, but it shouldn't be on the Softimage plugin side since all that functionality is contained inside a workgroup. simply disconnect from one of the workgroups to avoid the conflict. where the issue could be is the version of PyQt installed might not be compatible with the wrappers i have made, also the QtWinMigrate.dll and .pyd will need to be installed in the same location so one could over write the other causing one system to cease to function. this is something to explore and i hope we can find a way to support PyQt inside Softimage that can coexist.

code should work without issue in both systems, i haven't changed any of the blurdev module which would cause an application not to run. the base classes required are the same, ie. the wrapped Dialog/Window classes.

steven

Steven Caron

unread,
Oct 13, 2011, 1:43:32 PM10/13/11
to soft...@listproc.autodesk.com
hey xavier

i knew this would come up but i honestly dont have all the knowledge and experience to answer this with 100% certainty. in short, this is a windows only implementation. BUT the idea is someone with the knowledge, *cough* aloys *cough*, could make changes to the code to support both operating systems. i personally dont want to leave linux out, here is some thoughts on the subject...

the softimage plugin can actually be portable, softimage provides the same functionality through their api on both operating systems. the issue is, as you pointed out, the qtwinmigrate wrappers. the whole point of this is to take a non portable MFC based application ( which softimage and 3dsmax are ) and slowly port it to qt sytem to provide cross-platform support. from what i understand softimage is made available to linux through mainwin ( i think its called mainsoft now? http://harmon.ie/OtherProducts ) so the question is, are the qtwinmigrate wrappers even needed on linux? probably not. if they are needed, how do i make them available to linux? in either case this functionality will need to be added and i am hoping some softimage/linux developers can provide that.

in my ideal world, i would like to remove the blurdev code and write a cross-platform plugin with more permissive licensing. and maybe even start using pyside instead of pyqt to continue the trend of more flexibility in licensing. but that is a dream ;)

steven

Xavier Lapointe

unread,
Oct 13, 2011, 4:42:20 PM10/13/11
to soft...@listproc.autodesk.com
Sounds like a good plan (:

Might give it a try since we're on linux at work, but having someone that has more knowledge with Qt / Softimage could definitely help. Seems quite more powerful than the pyqt setup I had previously using threading in Softimage.

Cheers

2011/10/13 Steven Caron <car...@gmail.com>



--
Xavier

Steven Caron

unread,
Oct 13, 2011, 4:45:12 PM10/13/11
to soft...@listproc.autodesk.com
faster maybe, but more powerful? i dont know...

were you able to get the event loops to coexist?
was the application parented under the softimage window?
did it direct keystrokes to the correct application?

s

Xavier Lapointe

unread,
Oct 13, 2011, 4:54:25 PM10/13/11
to soft...@listproc.autodesk.com
It was decent, but if the PyQt application crashed for any reason, it would kill Softimage also (not all the time, but that could happen). The Ui were independant, could bind shortcut (and pretty sure they respected their own scope), interact with Softimage, etc. Just felt less stable or fragile on the long run.

By powerful I meant faster/stable, and I guess that if both event loop could coexist, some action that were previously crashing could work with this binding.


2011/10/13 Steven Caron <car...@gmail.com>



--
Xavier

Steven Caron

unread,
Oct 13, 2011, 4:57:00 PM10/13/11
to soft...@listproc.autodesk.com
your previous work using threading was cross-platform though?

Xavier Lapointe

unread,
Oct 13, 2011, 5:02:54 PM10/13/11
to soft...@listproc.autodesk.com
Hmm, right.

We were on Windows, haven't tried on Linux.




2011/10/13 Steven Caron <car...@gmail.com>



--
Xavier

Simon Anderson

unread,
Oct 14, 2011, 10:56:54 AM10/14/11
to soft...@listproc.autodesk.com
GREAT!!!!!! just saw this ( a little late)

cant wait to test it!! :D

I know what im going to be doing this weekend!! YES PLEASE!!! :D

You have made me EXTREMLY happy!


From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] on behalf of Xavier Lapointe [xl.mail...@gmail.com]
Sent: Thursday, October 13, 2011 11:02 PM
To: soft...@listproc.autodesk.com
Subject: Re: PyQt For Softimage

jo benayoun

unread,
Oct 16, 2011, 12:53:00 PM10/16/11
to soft...@listproc.autodesk.com

Steven -> omg ! no offense, but seems to be a huge amount of code for what can be done in a few lines ... Basically, only
the win32 api is required to implement qt.

Here is an implementation of qt for softimage that I wrote a few months ago (roughly extracted from my lib). As I use more often
Qt with C++ (just prototyping with py), the module is all C++ code. Two xsi commands are provided, getQtSoftimageAnchor() and killQtSoftimageAnchor().
The last one is optional since the implementation takes care of memory leaks. Actually, we only need the anchor which is used
for parenting widget to softimage. From the python side, make a use of sip for wrapping the address returned by the getQtSoftimageAnchor() 
into a Py_QtObject. Then parent your custom widget to it. Like an anchor :)

You can download the zip here : http://www.jobenayoun.com/

Here is a sample:   

"""
sianchor = Application.getQtSoftimageAnchor()
sianchor = sip.wrapinstance(long(sianchor), QWidget)
mywidget = MyWidget(sianchor)
mywidget.show()
"""

That's all what you need ! No need to start the QCoreApp, the implementation takes care of that to.

Now, for the problem of keyboard mapping, from the C++ side, I use a KeyboardHookHandle which propagates events before they
are sent to Softimage. Its not a thing that I often use, but it works from my libs. It doesn't seems working from C++ to python.
I think, the blur's idea you introduce of handling xsi events, is a great workaround. You can easily implement it over the dll I provide.

With the dll, there is the source (that I package into a header for convenience). There is also a py file which serve as a demo. (you can see the
killQtSoftimageAnchor use into the closeEvent). Then, the qt dlls that I used for building the plugin. 
Note : you should probably rebuild the xsi dll, since my qt config is a custom one for working with msvc.

I hope, what I bring on the table, will be useful and helpful to the community.
As you guess, english is not my mother language, and I really hope to be clear enough. :)
I don't write often on the mailing list, so be indulgent :)
But feel free to contact me for anything !

For instance, using threading for making Qt working in XSI can be dangerous. As we don't know how the API was designed,
maybe an excessive use of patterns which are not thread-safe was made. (in other words, while a thread try to access to
a data which are modify by an another thread, it can be a risk that the data was modified before the first thread access to it) 

Xavier -> for Fedora, Softimage provides a method for retrieving the linux specific handle of the application. (C++)
Since Qt is also based on the local os api, it should be easy enough to parent both.
Let me know if I can help you guys !

For completeness, I want to add all that things are doable theorically via python and the use of the builtin module ctypes, which
let us to deal with c dlls. here is the start :

"""
import ctypes
WIN32API = ctypes.windll.user32
        ...
"""

NOTE : All is unfortunately not implementable via python, for example, most of hooking methods must be implemented inside dll.


Jo Benayoun

Steven Caron

unread,
Oct 16, 2011, 3:16:11 PM10/16/11
to soft...@listproc.autodesk.com
no offense taking jo, in fact i am very greatful for your contribution as it could save me a lot of work! the blurdev code provides a lot more than just qt to softimage, it has a lot of other functionality some specific to blur's environment but some are still useful. i kept most of it intact so others could use it in mixed pipelines, ie. the same app being run standalone, inside softimage, 3dsmax, motionbuilder etc.

i am going to look this over and evaluate it to see if its stable enough.

s

Steven Caron

unread,
Oct 16, 2011, 3:56:05 PM10/16/11
to soft...@listproc.autodesk.com
hey jo

so this seems to be very stable!

so from what you are saying, the events you are usually using from Qt through C++ work fine but since we are using python we need to use blur's method that uses softimage keyup and keydown events to direct the keystrokes? that means in your header file the 'listener' function doesn't do anything?

s

jo benayoun

unread,
Oct 16, 2011, 4:14:17 PM10/16/11
to soft...@listproc.autodesk.com
Steven,
Glad you enjoy the plugin.

The way of the plugin was designed, is mainly, for letting us to deal with Qt in a standalone way; I mean, you write your interface, and then you get the anchor as a parent, I do the same thing for Maya. It makes easiest to develop outside 3D packages and get the same working framework everywhere, thanks to Qt for making dreams come true ! :)

Concerning the listener callback, effectively, it works perfectly, if you write a 
                      
                    "Application().LogMessage('it's a plane, it's a bird, ...');"

events are handled correctly. What it doesn't work is propagating events thru Py_QtObject (wrapped C++ struct), But for sure if you propagate them thru other C++, it will work.
As its not in my needs, I never go deeper inside that missing feature. But as I took a look at the pySoftimage module, the way (you ?) Blur solve the events handling problem looks fine. So, why not ... :)

jo

Steven Caron

unread,
Oct 16, 2011, 4:27:05 PM10/16/11
to soft...@listproc.autodesk.com
ok thanks for the feedback, i am going to have to do some research and learn more about the subject.

99% of the code is blur's. when i worked there i used this system. when i left i missed using the system. so i took their bloated blur tools installer and extracted the necessary bits and pieces, kept their licensing, and provided my own sip wrappers since those were not included with their code. most of the hard work was done by eric hulser and matt newell.

anyways, i am going to extend your plugin with the key events from softimage and republish on github (with your licensing) for others to enjoy. i will also use cmake build system for those who wish to recompile the plugin on their own using a different version of qt.

s

Steven Caron

unread,
Oct 16, 2011, 5:11:15 PM10/16/11
to soft...@listproc.autodesk.com
hey jo

when i run an example code in the script editor i get an error, not a fatal error but this...

# Traceback (most recent call last):
#   File "<Script Block >", line 63, in closeEvent
# AttributeError: 'NoneType' object has no attribute 'closeEvent'

the app closes fine, does this have to do with 'deleteonclose' flag?

s

jo benayoun

unread,
Oct 16, 2011, 5:57:09 PM10/16/11
to soft...@listproc.autodesk.com
It looks like the underlying C++ object was already destroyed. You can check cpp structs states with the SIP module (sip.isdeleted() for example.).
Did you make a call to killQtSoftimageAnchor() before a supercall ?

The xsi plugin only deletes the anchor when the plugin is unloaded or the last child of the qtanchor was destroyed.

The Qt::WA_DeleteOnClose flag is set to avoid memory leaks, you can override it.
The implementation of Qt was designed in a comparable way of Python. It makes a kind of use of reference counting to delete objects.
If a widget has children widgets, qtengine don't destroy it, children needs it.

But we can force this with the Qt::WA_DeleteOnClose flag. When the widget is destroyed, a signal is sent to all its children (closeEvent), then the widget is destroyed. If you keep a pyobject, which wraps a c++ struct, alive, you get a "pointer" to an empty box. But SIP takes care to handle that op (potentially dangerous) and raise this kind of errors.  

So, we need just to take care of wirting apps respecting the order of construction/destruction.

jo
 .

Steven Caron

unread,
Oct 16, 2011, 6:00:18 PM10/16/11
to soft...@listproc.autodesk.com
thanks jo

this is the hard work that is in blur's code.

s

Steven Caron

unread,
Oct 16, 2011, 6:01:26 PM10/16/11
to soft...@listproc.autodesk.com
and btw, my example script doesn't call 'killQtSoftimageAnchor()' at all. it just behaves this way when i run the code from the script editor and not wrap it in a custom command.

s

jo benayoun

unread,
Oct 16, 2011, 6:40:39 PM10/16/11
to soft...@listproc.autodesk.com
Hum, you're right.

It seems to be an interpreter specific problem, as there is no loop that keep alive the global scope, objects are deleted, but variables kept.
We have still access to the local scope (the class members), but if we make a supercall to a variable defined at the global level, it will not be able to find the object (=None).
That is why, we don't have this problem on loaded modules.
I think the implementation is not in cause, its just the way of scripting works :D

(I will continue to explore this case later !)

jo

Ciaran Moloney

unread,
Oct 16, 2011, 6:46:24 PM10/16/11
to soft...@listproc.autodesk.com
Hey,
thanks both of you for sharing your code. This is a great thread to study.

Ciaran

Steven Caron

unread,
Oct 16, 2011, 6:50:11 PM10/16/11
to soft...@listproc.autodesk.com
thanks for your help, i am exploring this also with the help of the blur code as reference. we should be able to avoid this little annoyance in the long term.

s

Stefan Kubicek

unread,
Oct 16, 2011, 6:54:13 PM10/16/11
to soft...@listproc.autodesk.com
Group hug!


--
-------------------------------------------
Stefan Kubicek Co-founder
-------------------------------------------
keyvis digital imagery
Wehrgasse 9 - Grï¿œner Hof
1050 Vienna Austria
Phone: +43/699/12614231
--- www.keyvis.at ste...@keyvis.at ---
-- This email and its attachments are
--confidential and for the recipient only--

Steven Caron

unread,
Oct 16, 2011, 9:22:10 PM10/16/11
to soft...@listproc.autodesk.com
i have a .xsiaddon which i would like to test with some people. anyone interested?

64bit windows at this time only.

s

On Sun, Oct 16, 2011 at 3:54 PM, Stefan Kubicek <s...@tidbit-images.com> wrote:
Group hug!


thanks for your help, i am exploring this also with the help of the blur
code as reference. we should be able to avoid this little annoyance in the
long term.

s

On Sun, Oct 16, 2011 at 3:40 PM, jo benayoun <joben...@gmail.com> wrote:

Hum, you're right.

It seems to be an interpreter specific problem, as there is no loop that
keep alive the global scope, objects are deleted, but variables kept.
We have still access to the local scope (the class members), but if we make
a supercall to a variable defined at the global level, it will not be able
to find the object (=None).
That is why, we don't have this problem on loaded modules.
I think the implementation is not in cause, its just the way of scripting
works :D

(I will continue to explore this case later !)

jo




--
-------------------------------------------
Stefan Kubicek                   Co-founder
-------------------------------------------
         keyvis digital imagery
        Wehrgasse 9 - Grüner Hof

Eric Thivierge

unread,
Oct 16, 2011, 10:56:33 PM10/16/11
to soft...@listproc.autodesk.com
I'm in....

--------------------------------------------
Eric Thivierge
Currently: Digital Artist, Rigging at Animal Logic
http://www.ethivierge.com

Steven Caron

unread,
Oct 16, 2011, 11:01:23 PM10/16/11
to soft...@listproc.autodesk.com

Enrique Caballero

unread,
Oct 17, 2011, 1:54:41 AM10/17/11
to soft...@listproc.autodesk.com
Works quite nicely steven.  I notice that you are using Qdialog instead of the blurdev Dialog wrapper class.  I was under the impression that you were still using the blur implementation but without all of the extra stuff included, like treegrunt, and the python logger etc...

Steven Caron

unread,
Oct 17, 2011, 2:18:45 AM10/17/11
to soft...@listproc.autodesk.com
Well I am abandoning that because of the bloat. Jo's method is a lot simpler.

Tell me what features from the blur system are you missing? 

*written with my thumbs

Simon Anderson

unread,
Oct 17, 2011, 2:21:26 AM10/17/11
to soft...@listproc.autodesk.com
its AWESOME!!! working hundreds so far! now to bench it and give it a bit of strain :D

Simon Ben Anderson
Lead Developer + Lead Rigger
Triggerfish Studios
http://www.triggerfish.co.za

From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] on behalf of Enrique Caballero [enriquec...@gmail.com]
Sent: Monday, October 17, 2011 7:54 AM

To: soft...@listproc.autodesk.com
Subject: Re: PyQt For Softimage

Steven Caron

unread,
Oct 17, 2011, 2:38:27 AM10/17/11
to soft...@listproc.autodesk.com
Give thanks to Jo and blur. All I did was write a little python script to bring the two together and set the cmake build system up.

*written with my thumbs

Enrique Caballero

unread,
Oct 17, 2011, 5:05:24 AM10/17/11
to soft...@listproc.autodesk.com
I see , sorry I didnt read every email in this thread.  I'm testing your addon now and it seems quite stable. Although some of my menu colors and buttons no longer work, but I suspect that is because I am using an earlier version of QT. I am updating QT and PYQT to match the ones you compiled for and should be peachy!  I love this implementation as I was looking for something light to deploy to our workstations here.

Thanks so much for this guys, we've really needed this for a while.

javier gonzalez

unread,
Oct 17, 2011, 7:35:19 AM10/17/11
to soft...@listproc.autodesk.com
Hi, i have a question and excuse my ignorance, y search in google but isnt clear for me, what the use of Pyqt in Softimage, anyone has and example or a plugin a video maybe. Thanks
 
 
  
w2011/10/17 Enrique Caballero <enriquec...@gmail.com>

Simon Anderson

unread,
Oct 17, 2011, 8:30:04 AM10/17/11
to soft...@listproc.autodesk.com
if you want to know how to use Qt theres a great free pdf called http://www.qtrac.eu/pyqtbook.html

if you want an example of how this pyqt version works look under plugins > pyQtForSoftimage(addon) > Plugins > right click on PyQt_Example and click edit. you can see how there code works. alls you have to do is create your class and then instantiate that class and input the sianchor.

The benefits of pyQt is that you can create much more robust and prettier UI's, ui's that have images, videos, ability to draw on images. the vairables can be global, unlike PPG's where global lists and dictionaries dont really work. the tables are much more robust, you can have colours and import buttons where needed... its heaven :D

we have a tracking system that uses an SQL database, and with the ability of Qt we can make the artists interface amazing, simple and have very specific information.

Animations and pose libraries can have videos and images on buttons :D

We have had this stuff all half developed and then we hit the bugs that came with a normal direct import but with PyQtForSoftimage its 100% reliable so far with our tests that where bombing out everything seems to be very stirdy!

Hope that helps


Simon Ben Anderson
Lead Developer + Lead Rigger
Triggerfish Studios
http://www.triggerfish.co.za

From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] on behalf of javier gonzalez [javi09...@gmail.com]
Sent: Monday, October 17, 2011 1:35 PM

javier gonzalez

unread,
Oct 17, 2011, 8:51:26 AM10/17/11
to soft...@listproc.autodesk.com
Sounds great, thanks for the info.

2011/10/17 Simon Anderson <Simon.A...@triggerfish.co.za>

Enrique Caballero

unread,
Oct 17, 2011, 9:37:47 AM10/17/11
to soft...@listproc.autodesk.com
this implementation so far is a god send, so light and simple. The only drawback is that i somehow lost all of my window colors. Something to do with blurcore made my window colors different, not a huge deal though, im finally not being lazy and updating everything to a standard style sheet.

I absolutely LOVE this implementation, i will test it out a few more days before i release it to our entire studio  

Thanks again guys

Xavier Lapointe

unread,
Oct 17, 2011, 9:58:57 AM10/17/11
to soft...@listproc.autodesk.com
Whoa. Nice job Jo and Steven (:

Will need to give this a try.

As for the Qt/PyQT licensing, do you know what are the restrictions? Apparently we can't even use PyQt, we'll need to use PySide in order to be "legal" (the main reason why PySide exists).

Simon Anderson

unread,
Oct 17, 2011, 10:00:22 AM10/17/11
to soft...@listproc.autodesk.com
Hi,

One thing I have picked up on is the debuggin of a window, if you want to change something you have to restart softimage, doing a reload of the class or module doesn't seem to refresh it, neither does a refresh of the workgroup.

We are currently developing modularly outside of soft and then putting it all together for testing due to this.
If anyone has an idea about refreshing the plugin please let me know

a code snippet to make it work outside of softimage, the red text is added to make it work outside of soft and then we just remove( comment out) the bottom bit:

from PyQt4.QtCore import Qt
from PyQt4.QtGui import QDialog
from PyQt4.QtGui import QWidget
from PyQt4.QtGui import QPushButton
from PyQt4.QtGui import QLineEdit
from PyQt4.QtGui import QVBoxLayout

from PyQt4.QtCore import *
from PyQt4.QtGui import *

import sys
app = None

class EnvironmentGroupMaster( QDialog ):

    def __init__( self, parent = None ):
        QDialog.__init__( self, parent )
       
        self.tabUI                 = QTabWidget()               
        self.deptFilterUI     = QComboBox()                # ComboBox for The Categories
        self.assListUI         = QListWidget()                   # List Box with all the assets in the environment
        self.grpListUI         = QListWidget()                   # List Box with all the groups in the environment
        self.assetGrpListUI    = QListWidget()                   # List Box with all the
        self.createGrp_btn    = QPushButton()
        self.add_btn            = QPushButton()
        self.remove_btn        = QPushButton()
        self.clrList_btn        = QPushButton()
        self.isoSel_btn        = QPushButton()
        self.grpName_lbl    = QLabel()
       
        self.groupAUI         = QComboBox()                # ComboBox for the groups
        self.groupBUI         = QComboBox()                # ComboBox for the groups
        self.assListAUI         = QListWidget()                   # List Box with all the assets in the group
        self.assListBUI         = QListWidget()                   # List Box with all the assets in the group
        self.dupListBUI         = QListWidget()                   # List Box with all the assets in the group
        self.removeSel_btn    = QPushButton()
       
        self.assInfoGrp         = QGroupBox()                    # Layout group
       
        infoLayout = QGridLayout()
       
        self.setGeometry( 100, 100, 200, 100 )
        self.setWindowTitle( "Environment Grouper" )
        self.setToolTip( "This is used for creating better groups for Artists to interact with" )
       
        btn = QPushButton( "Log Message", self )
        btn.setToolTip( "This is a <b>QPushButton</b> widget" )
        btn.resize( btn.sizeHint() )
        btn.clicked.connect( self.helloWorld )

        lineedit = QLineEdit( "Hello World", self )
        lineedit.setToolTip( "Type Something" )
       
        layout = QVBoxLayout( self )
        layout.addWidget( lineedit )
        layout.addWidget( btn )

    def helloWorld( self ):
        Application.LogMessage( "Hello World" )
       
   
def XSILoadPlugin(reg):
    reg.Name = "SQUIRREL_EnvironmentGroupMaster"
    reg.RegisterCommand( "EnvironmentGroupMaster" )

def ExampleDialog_Execute():
    import sip


    sianchor = Application.getQtSoftimageAnchor()
    sianchor = sip.wrapinstance( long(sianchor), QWidget )
    dialog = EnvironmentGroupMaster( sianchor )
    dialog.show()
   

#------------------------------------------------------------
#         EXTERNAL TESTING AND DEVELOPMENT
#------------------------------------------------------------

if app == None:
    app = QApplication(sys.argv)
form = EnvironmentGroupMaster()
form.show()
app.exec_()

Thanks
Si.

Simon Ben Anderson
Lead Developer + Lead Rigger
Triggerfish Studios
http://www.triggerfish.co.za
Sent: Monday, October 17, 2011 3:37 PM

Hans Payer

unread,
Oct 17, 2011, 10:36:12 AM10/17/11
to soft...@listproc.autodesk.com
This is awesome. Thanks guys!!! worked first time. 

Hans

Steven Caron

unread,
Oct 17, 2011, 11:04:44 AM10/17/11
to soft...@listproc.autodesk.com, soft...@listproc.autodesk.com
Yes the blurdev modules had a buncha default palette settings. You should be able to do recreate all the same look/style. This lighter weight version means you can customize your environment without having to 'undo' blur's defaults.

*written with my thumbs

Steven Caron

unread,
Oct 17, 2011, 11:11:23 AM10/17/11
to soft...@listproc.autodesk.com
Licensing is tricky, but from what i understand unless you are
releasing a plugin as a product you have nothing to worry about.

But pyside is very interesting, there is no reason this couldn't work
with pyside. In fact if you are interested we could investigate this
together.

*written with my thumbs

On Oct 17, 2011, at 6:58 AM, Xavier Lapointe

jo benayoun

unread,
Oct 17, 2011, 11:11:30 AM10/17/11
to soft...@listproc.autodesk.com
Thanks to all for being so excited about it ! I didn't expect so !

xav' -> As I said it above, I make a use of the win32 API which make sense on windaube. I don't have doubts concerning a port on the linux platform, since this is an open environment and surely less restrictive the windows one. 
Let me know if I can help, as you know, I like experiencing new things !! :) 
For the licensing question, there is no problems. I was only sceptical when I saw the use of QtWinMigrate, which, if I am rigth, it is now a part of the Qt commercial license, but since I don't use it, ... all it's great !

Simon -> you seems right with your actual workflow ! The Qt integration was designed as an anchor. So write your ui outside xsi, then test it by parenting the anchor to your widget. You can't expect to got refreshing as the integration of the event loop is not really integrated inside Softimage.  (!= Maya which implements the Qt event loop and let us make a use of it). So, all changes you make during the running of the app will not be taken in count. You have to close it, and relaunch it. Just remember, Qt is very powerful and flexible, so i guess, a callback button in the title bar of your widgets which execute a rebuild of itself can be do easily !

Just for licencing informations, I would like to say, the source I provided to Steven is under GPL because I believe in the open source platform when its not in a unique way. So feel free to use it for you, your studio or else, but if you make something public with it, thanks to keep in mind the licence !

thanks again to all !
feel free to contact me if you have another questions, I will try to answer it :D
jo

jo benayoun

unread,
Oct 17, 2011, 11:20:45 AM10/17/11
to soft...@listproc.autodesk.com
oh (forgot the style question ...) !

Enrique -> I am currently developping a custom QStyle plugin which has the goal to make qtwidgets fit with the native look of xsi. 
(QStyle =! StyleSheets). Two of advantages of QStyle over SS are they don't run at runtime and can be integrated into the Designer. Originaly, it was developed for my personal use, so don't know when I will be able to provide it. But you are free to create your own stylesheets.

Steven -> why not ? honestly, I only use PyQt for prototyping before writing in Cpp (much more powerful and more features). But feel free to talk me about it in pm ! :)

Alan Fregtman

unread,
Oct 17, 2011, 11:22:17 AM10/17/11
to soft...@listproc.autodesk.com
May I? :)

>> � � � � Wehrgasse 9 - Gr�ner Hof

Simon Anderson

unread,
Oct 17, 2011, 11:24:59 AM10/17/11
to soft...@listproc.autodesk.com
Thanks Jo, now that you mention that refresh button hmmm.... something to try in the evenings :D


Si.
Simon Ben Anderson
Lead Developer + Lead Rigger
Triggerfish Studios
http://www.triggerfish.co.za

From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] on behalf of jo benayoun [joben...@gmail.com]
Sent: Monday, October 17, 2011 5:11 PM

To: soft...@listproc.autodesk.com
Subject: Re: PyQt For Softimage

Alan Fregtman

unread,
Oct 17, 2011, 12:00:01 PM10/17/11
to soft...@listproc.autodesk.com
Woops, meant to send it directly to Steven. Was just asking for the
plugin to try it myself.

Steven Caron

unread,
Oct 17, 2011, 12:21:41 PM10/17/11
to soft...@listproc.autodesk.com
It's on the github download page now

*written with my thumbs

On Oct 17, 2011, at 9:00 AM, Alan Fregtman <alan.f...@gmail.com>
wrote:

>>>> Wehrgasse 9 - Grüner Hof

Aloys Baillet

unread,
Oct 17, 2011, 11:33:54 PM10/17/11
to soft...@listproc.autodesk.com
Thanks for sharing Steve!

For the linux afficionados out there, you can get very simple and pure python implementation of PyQt in Softimage by just implementing a XSI Timer event and running this code, which emulates the Qt event loop:

def ALUIHelpers_Events_onTimer_OnEvent(ctx):
    app = QtGui.QApplication.instance()
    if app:
        app.processEvents()
        app.sendPostedEvents(None, QtCore.QEvent.DeferredDelete)

We found 20ms for the timer to be good enough for most UIs.
Lately, with the combination QOpenGL widgets and image players, we bumped up to 5ms and using a C++ implementation.
We have been using PyQt inside Softimage/Maya for the last two years and it's been great so far, it's good to see more people jumping on board and sharing code!

Cheers,

Aloys
--
Aloys Baillet
Lead Software Developer
Research & Development - Animal Logic
--

Steven Caron

unread,
Oct 18, 2011, 2:08:13 AM10/18/11
to soft...@listproc.autodesk.com
do you have to do anything for keystrokes?