PyQt For Softimage

1,176 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?

jo benayoun

unread,
Oct 18, 2011, 2:34:53 AM10/18/11
to soft...@listproc.autodesk.com
Hi Aloys !

Don't you observe a slowdown with the use of a timer ?

I actually don't use a timer, since it can consume not needed resources. 
With your method, all messages are handled every 20ms even if the app has no need of them.

Only keyboard and mouse events need to be handled for getting an almost complete working system (basic types of events are handled correctly) 
which is made by hooking softimage and sending events manually thru the QCoreApplication.

Just for instance, the use of the "WH_GETMESSAGE" constant in the hook registration make the callback handle all messages and will consume less resources than a timer.
But I find that excessive as the use of a timer  !
I don't know if something similar exists on Linux, but it can be more powerful. Maybe this is the C++ implementation you talk about.

jo

Aloys Baillet

unread,
Oct 18, 2011, 3:22:58 AM10/18/11
to soft...@listproc.autodesk.com
Hi,

Slowdown is not noticeable, but for we did go with the C++ version to make sure we would not impact anything.
Nothing to do for keystrokes as long as the Qt widgets are in a separate QMainWindow, it just works like magic :-)
There are keyboard hacks to do once you try to embed PyQt inside a CDH, but that's a different beast...

Cheers,

Aloys

Steven Caron

unread,
Oct 18, 2011, 3:26:55 AM10/18/11
to soft...@listproc.autodesk.com
wow, envy. the amount of work eric had to do to get pyqt running across softimage, max, and motionbuilder was intense!

Olivier Jeannel

unread,
Oct 18, 2011, 8:24:43 AM10/18/11
to soft...@listproc.autodesk.com
Hello list,
Me again still on the same subject .
Though, I understand it is not possible to change ParticleID or
ElementIndex.
I'm wondering if it would be possible to Set a "FakeID" number to the
points of a polymesh ?

Here's my scenario :
I have a few hundreds of particles emited, that are going from goal to
goal. The goals are Polymeshes (arabic pattern stuff like).
I need to put one particle on each point of the goal. There must be no
particle between 2 points, and no points without a particle on it (no
holes).

So far so good, I've made a nice little compound tha manage the goal
behavior nicely. The positioning of the particles is made by ParticleID,
wich means :
ParticleID 1 goes on to Goal PointID 1
ParticleID 2 goes on to Goal PointID 2
ParticleID 3 goes on to Goal PointID 3
etc.

But, my problem is that my goal polymeshes are not clean geometric
ordered objects. Meaning that Point1 can be very far from Point2. (As
opposite to a Sphere or a Torus where points have their IDs growing next
to each other).
So this create sometimes, un-elegant particles movement, that I'd like
to have a bit of control on.

So, as mentionned above, is it possible to Set a "FakeID" number to the
points of my goal polymesh ?
For example, can I use a translating "volume", and say that the first
vertex that is entering the volume gets a fake ID of 1, the next vertex
gets ID of 2, etc, etc ?

I have no Idea of the method to use just to "apply" a fake numberID to
some vertices. Or if it is even allowed.
..Or if it even a good idea ...


Alan Fregtman

unread,
Oct 18, 2011, 9:13:58 AM10/18/11
to soft...@listproc.autodesk.com
Uhmm... for a simple offset:

Get Point ID -> Add (+ 1) --> SetData[self.MyCustomIDOrWhateverYouWannaCallIt]

(By the act of getting the point ID you force the context to be per-point.)

Luc-Eric Rousseau

unread,
Oct 18, 2011, 9:51:37 AM10/18/11
to soft...@listproc.autodesk.com
I'm not sure about this.. a WM_GETMESSAGE hook will get called for
every message, thousands and thousands of messages, every tiny mouse
message, timer message, internal message, etc. The benefits of timers
is their messages collapse together if you're not keeping up with
them, so you'll only be called one. They're low-priority messages and
are only get called when there is nothing else going on. Now that
said, it's gotta be a little slow to run python code every 20ms..

jo benayoun

unread,
Oct 18, 2011, 4:46:19 PM10/18/11
to soft...@listproc.autodesk.com
Thanks Luc-Eric for the clarification.

I guess I was thinking the xsi's timer could consume more resources than needed. I was wrong !
My original point was to say, if we want to mimic the QtEventLoop, the use of this constant can do the trick.
But as I said, it sounds to me excessive as the use of a timer when we can handled only keyboard and mouse events which interest us !

(( My only gripe with CDH is that, to my knowledge, we can't launch it via the SDK. Is it missing or like this by design, or perhaps I missed something in the docs about it?  ))

Aloys Baillet

unread,
Oct 19, 2011, 1:52:21 AM10/19/11
to soft...@listproc.autodesk.com
Hi,

Ideally Softimage would create a new API so that one could add new event loop callbacks in a portable way, instead of relying on OS specific features.
Houdini gets this right with the hou.ui.addEventLoopCallback function (see http://www.sidefx.com/docs/houdini11.1/hom/cookbook/pyqt/part1/ ).

Regarding the CDH, I'm not sure I understand your comment Jo, but you can create a "Custom Display Host" view and set it's properties with the XSI SDK.

Cheers,

Aloys

jo benayoun

unread,
Oct 19, 2011, 3:57:16 AM10/19/11
to soft...@listproc.autodesk.com
Hi Aloys,

you point something interesting with the Houdini approach !
Concerning my question to Luc Eric on the CDH API, my bad, I was thinking to something else, quite sure of my point and no cancel button from where I was (I forgot to carve every word before letting them fall) ... :(
(( It was related to the "Layout::CreateView()" method and the possibility to create CDH from commands ... ))

Anyway, thanks !

Steven Caron

unread,
Oct 20, 2011, 3:04:20 AM10/20/11
to soft...@listproc.autodesk.com
hey gang

i updated the plugin to allow softimage events to emit signals to widgets.

you can get the code here...

or the new addon here..

there is a new example dialog...

Application.ExampleSignalSlot()

this dialog has two events/signals. if you make a new render pass and switch back and forth it will update the gui to the pass name. the other event is when softimage looses focus. it will log a message saying 'Good Bye!" and "Welcome Back!" when the application gains focus again. i didn't map every softimage event but i did map many of them. look at "sisignals.py" script and the "pyqt_example.py" script to learn how to connect our app up to any softimage event.

steven

ps, the way the events are being done is subject to change if i can find a more elegant and dynamic way. any feedback from anyone would be appreciated.

Steven Caron

unread,
Oct 21, 2011, 3:26:59 AM10/21/11
to soft...@listproc.autodesk.com
in case you had enough of me... too bad! here is some more updates. i was registering events without checking the version number, in the case the version didn't support this event (onRenderAbort, onCreateShader, onConnectShader, etc) it would fail loading the plugin. also i was using a newer feature of softimage, the suitils module. since its not available in the older versions i removed it and added the same functionality by hand.

s

Simon Anderson

unread,
Oct 21, 2011, 5:00:30 AM10/21/11
to soft...@listproc.autodesk.com
Great!, its awesome to see that its growing and progressing fast. we have already ported a few of our pipeline tools and its working hundreds! :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 Steven Caron [car...@gmail.com]
Sent: Friday, October 21, 2011 9:26 AM

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

Enrique Caballero

unread,
Oct 23, 2011, 9:39:54 AM10/23/11
to soft...@listproc.autodesk.com
same here steve, great work.

Simon Anderson

unread,
Oct 25, 2011, 11:27:37 AM10/25/11
to soft...@listproc.autodesk.com
Found a bug.

when you have a QLineEdit and you are entering text into it, the characters seem to get inputted twice.

Button interaction and list modification and everything else seems to work hundreds.

I think it may have to do with qt and soft listening to the kayboard.

Im running your most recent addon


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: Sunday, October 23, 2011 3:39 PM

Steven Caron

unread,
Oct 25, 2011, 12:34:43 PM10/25/11
to soft...@listproc.autodesk.com
i tested the qlineedit early on and didn't experience this, maybe i broke it recently. or...

did you properly remove the previous version of the plugin? because i changed the name of the events file, you could have the old events plugin running in parallel.

s

Cristobal Infante

unread,
Oct 25, 2011, 12:48:42 PM10/25/11
to soft...@listproc.autodesk.com
Hi guys,

I am just slowing trying to understand this framework, would really appreciate a bit help to go a bit faster.

So i've done my ui with designer and converted them to .py. What additional code would I have to add to this class
so that I am able to run this from softimage?

So far I am using this little code as ref:

import sys

from PyQt4.QtGui import *

app = QApplication(sys.argv)

button = QPushButton("Compile this shit", None)

button.show()

app.exec_()

Steven Caron

unread,
Oct 25, 2011, 1:04:12 PM10/25/11
to soft...@listproc.autodesk.com
dont use this code as ref. use the example code shipped with the plugin ;)

s

Cristobal Infante

unread,
Oct 25, 2011, 1:27:19 PM10/25/11
to soft...@listproc.autodesk.com
Cool just found it, will have a look at it and report back!

Cheers for putting this together by the way..

Cristobal Infante

unread,
Oct 25, 2011, 1:51:21 PM10/25/11
to soft...@listproc.autodesk.com
Ok, got it working outside the plugin environment, a simple question though.

Why doesnt it allow me to just duplicate a field for example:

self.lineedit = QLineEdit( "Hello World", self )
self.lineedit_B = QLineEdit( "Goodbye World", self )

Even if add it to the widget it fails? " : unexpected indent - [line 15]"

Steven Caron

unread,
Oct 25, 2011, 1:53:51 PM10/25/11
to soft...@listproc.autodesk.com
python 101, you can't mix tabs and spaces. i use spaces in place of tabs in most my editors. the default softimage script editor preference uses tabs. so either a) convert the script to use tabs b) you start using spaces instead. either way python wants you to be consistent.

s

Cristobal Infante

unread,
Oct 25, 2011, 1:58:21 PM10/25/11
to soft...@listproc.autodesk.com
Got it, not so used to python, but see exactly what you mean!

Cheers,
Cris

Dwayne Elahie

unread,
Oct 25, 2011, 3:05:26 PM10/25/11
to soft...@listproc.autodesk.com
Hi,

I was wondering how can you convert instanced models to geometry. I
believed there used to be a script available in the old netview.

Thanks,

Dwayne

Steven Caron

unread,
Oct 25, 2011, 3:11:37 PM10/25/11
to soft...@listproc.autodesk.com
http://rray.de/xsi/

search for instance. "Instances to Duplicates/Clones"

s

Alan Fregtman

unread,
Oct 25, 2011, 3:07:44 PM10/25/11
to soft...@listproc.autodesk.com
Are you looking for model duplicates or merged geometry? Or the model
only has one child?

Alok Gandhi

unread,
Oct 25, 2011, 3:17:02 PM10/25/11
to soft...@listproc.autodesk.com
Here you go:

# Author : Alok Gandhi

from win32.com import constants as c
xsi = Application
log = xsi.LogMessage

@mfxSI.tweakPrefs({'scripting.cmdlog':False})
def extractMesh():
    '''Make a group of all the instances for
       which you want to extract the mesh. Select
       the group and run the script, the meshes
       will be created under the null '_PAR_instanceMeshes'
    '''
    instGrp = xsi.Selection(0)
    instMeshNull = xsi.ActiveSceneRoot.AddNull('_PAR_instanceMeshes')

    for eachInst in instGrp.Members:
        mdl = eachInst.InstanceMaster
        dupMdl = xsi.Duplicate('B:%s'%mdl.FullName)(0)
        dupMdl.Kinematics.Global.Transform = eachInst.Kinematics.Global.Transform
        for msh in dupMdl.FindChildren('','',[c.siMeshFamily, c.siNurbsSurfaceMeshFamily]):
            msh.Properties('visibility').Parameters('hidemaster').Value = False
            xsi.ParentObj(instMeshNull,msh)
        xsi.DeleteObj('B:%s'%dupMdl.FullName)
    log('Meshes Extracted Successfully !!', c.siInfo)

extractMesh()

Alok Gandhi

unread,
Oct 25, 2011, 3:17:57 PM10/25/11
to soft...@listproc.autodesk.com
erratum:

just remove this line (it is from our library):

@mfxSI.tweakPrefs({'scripting.cmdlog':False})

Jens Lindgren

unread,
Oct 25, 2011, 5:23:41 PM10/25/11
to soft...@listproc.autodesk.com
In case anyone have missed it:
There's a setting for the Softimage script editor to insert four spaces instead if a tab when you press the Tab button.
 
/Jens

--
Jens Lindgren
--------------------------
Lead Technical Director

Eric Thivierge

unread,
Oct 25, 2011, 5:26:36 PM10/25/11
to soft...@listproc.autodesk.com
A little trick to conform all of your spacing to either spaces or tabs, set your preference to what you want (spaces or tabs) and select all of your code and hit tab then shift + tab. Should indent / unindent your code converting tabs to spaces or spaces to tabs.

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

Raffaele Fragapane

unread,
Oct 25, 2011, 10:37:12 PM10/25/11
to soft...@listproc.autodesk.com

Simon Anderson

unread,
Oct 26, 2011, 2:28:35 AM10/26/11
to soft...@listproc.autodesk.com
Your right, looks like they where running in parallel.

removed them both and did a reinstall of the addon and its working perfectly! :D

thanks


Simon Ben Anderson
Lead Developer + Lead Rigger
Triggerfish Studios
http://www.triggerfish.co.za
Sent: Tuesday, October 25, 2011 6:34 PM

Simon Anderson

unread,
Oct 26, 2011, 4:07:41 AM10/26/11
to soft...@listproc.autodesk.com
Hi,

I think I may have found another bug, when creating a QDialog and setting it to stay ontop with self.setWindowFlags( Qt.WindowStaysOnTopHint )
the dialog seems to not appear, but the code doesn't fail.

if you comment that line out then it appears.

any ideas?

Thanks
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 Simon Anderson [Simon.A...@triggerfish.co.za]
Sent: Wednesday, October 26, 2011 8:28 AM
To: soft...@listproc.autodesk.com
Subject: RE: PyQt For Softimage

Christophe MARTINS DA SILVA

unread,
Oct 26, 2011, 6:20:05 AM10/26/11
to soft...@listproc.autodesk.com
Hi, I try to compile this plugin but I have a lot of errors like
"undefined reference to `_imp___ZN3XSI7CStatusC1ENS0_4CodeE". It looks
like includes in qtsoftimage.cpp are not done as it should be. I tried
on several computer with different softimage versions but still not
work. I'm not familiar with cmake, mingw and other stuff like that so
do you have any idea ? I checked environnement variables, links in
CMakeCache.txt... Another question : Which argument do I have to put
to force 64 bits compilation and where ?

For more details on my process, I used cmake-gui to generate the
pre-compilation files and compiled with QtCreator.

Thank you for your help. Cheers !

jo benayoun

unread,
Oct 26, 2011, 7:24:18 AM10/26/11
to soft...@listproc.autodesk.com
Hi Simon,

I can't see the need for you to use this flag. What all people want until now is implement a Qt widget into the Softimage Application and make it acting like a "propertypanel". It make sense, when you minimize, maximize or whatever the softimage app, your custom widget do the same thing, since, windows handles are parented. So, set this window flag sounds like you want to make something else, but what ?

You still have the possibility to run qwidgets in a modal mode or in a complete external way of Softimage. For modality, use QWidget::setWindowModality() with the "Qt::WindowModal" flag. It should work !

Let me know, if you have a "special need".

jo

jo benayoun

unread,
Oct 26, 2011, 7:50:02 AM10/26/11
to soft...@listproc.autodesk.com
Hi Christophe,

I didn't write the CMake configuration nor build the plugin using CMake, so I think Steven, will be helpful more than I am.
But I will try ! :)

What compiler do you use ? on which os ? You say you build with QtCreator ? In that case, my advice will be to build with QMake.
Feel free to contact me on my mailbox !

jo

Simon Anderson

unread,
Oct 26, 2011, 7:52:41 AM10/26/11
to soft...@listproc.autodesk.com
Hi Jo,

Thanks alot for your help, yeah we designed a window that we would always like on the top while you are using it, but its not a train smash if its not.

will try your suggestions

Thanks again

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: Wednesday, October 26, 2011 1:24 PM

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

Cristobal Infante

unread,
Oct 26, 2011, 10:14:22 AM10/26/11
to soft...@listproc.autodesk.com
Thanks for all the help on python guidelines, I've manage to setup my scripting settings, and
used Eric's tip to normalize my codes.

Now moving into a next step in our development we are trying to connect to database directly from QT.
So has anyone had any luck connecting PYQT4 to a MySql database with windows?

we've been trying loads of different options, but its not having it.

from PyQt4.QtCore import *

from PyQt4.QtGui import *

from PyQt4.QtSql import *

 

# DB type, host, user, password...

db = QSqlDatabase.addDatabase("QMYSQL");

 

db.setHostName("akaweb");

db.setDatabaseName("cris");

db.setUserName("root");

db.setPassword("root");

db.open()

Simon Anderson

unread,
Oct 26, 2011, 10:21:36 AM10/26/11
to soft...@listproc.autodesk.com
There is a sql module in Qt, but we are using pySQL, and it work 100% every tool we use in our studio is a mixture of asset tracking and managing tools

so it is very doable :)

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 Cristobal Infante [cgc...@gmail.com]
Sent: Wednesday, October 26, 2011 4:14 PM

Cristobal Infante

unread,
Oct 26, 2011, 10:38:15 AM10/26/11
to soft...@listproc.autodesk.com
Hi Simon,

We are using MySqldb which interfaces between python and MySql,
I am guessing this is very similar to pySQL?

Just thought it would be more efficient to go straight from pyqt>Mysql to retrieve data for example.

But maybe is not really necessary and I should just stick to MySqldb.

jo benayoun

unread,
Oct 26, 2011, 11:17:54 AM10/26/11
to soft...@listproc.autodesk.com
Hi Cristobal,

for interacting with databases in Qt, you can use the QtSql Module which offers every needed features.
For doing so, you only need to derived from the QSqlRelationalTableModel or QSqlTableModel coupled with the use of the appropriate driver. 
Then use Qt mechanisms for displaying datas in views (list/ table/ trees / what you want). 
You can also edit these values by setting up a delegate.
You can find more infos on this pattern by typing (MVD, MVC, or MVP in google).

For instance, Qt is so flexible, you can build your own classes, models etc to interface a database. Actually, QSqlxx classes are all derived from qtcore/gui classes. 
You can easily write your own model directly derived from QAbstractItemModel(base class) then implement some databases patterns, like "Active Record", "Data Mapper", again, whatever you want.

If its your first time with Qt, there is a lot of available resources on internet (english / french / ...). My advice, is avoiding riverbank docs, and getting help directly from the qtdevnetwork.
Qt is not only a library, its a powerful and complete framework, in fact, you can almost avoid the use of other third party modules (almost, since riverbank didn't bind all modules/features).
You should maybe starts by learning to use qt bases before going to other modules !

hope to help !
jo

Michal Doniec

unread,
Oct 26, 2011, 11:31:11 AM10/26/11
to soft...@listproc.autodesk.com
Have a look at SQL Alchemy. I use it here for our asset tracking
system and it works quite well.
I'd recommend strongly abstracting database handling code from
interface code, but using QT custom views (all kind of tress etc) and
delegates can speed things up considerably in lots of cases -
personally I tend to do most of my filtering in views, so I don't have
to query the database too often (helps if db server is on the other
continent)

--
----------
Michal
http://uk.linkedin.com/in/mdoniec

It is loading more messages.
0 new messages