opening an asset/model/scene from outside of Softimage

54 views
Skip to first unread message

Simon Anderson

unread,
Oct 14, 2010, 4:28:08 AM10/14/10
to soft...@listproc.autodesk.com
Hi List,

I was wondering if anyone knows if its possible to open a scene or
import a model into an already open Softimage Application, but from
outside of Softimage.

I know you can run a command in CMD and tell Soft to start and open a
scene or asset automatically, but is it possible to tell Soft to import
an asset from outside of Soft, accessing Soft threw win32com or some
kind of component or port

I remember reading a blog where someone was sending data from Soft to
Excel, and that got me thinking if it was possible to do something like
send a command to the Softimage Application.

Reason I ask is, I want to run some code that will let a user select a
model and then automatically add that model to whichever Softimage
window was open, but not have the user doing this in the Softimage
Application

Thanks
Si

Eric Thivierge

unread,
Oct 14, 2010, 7:28:34 AM10/14/10
to soft...@listproc.autodesk.com

Yes though it hasnt been easy getting it to work. Basically setup a UDP socket server via python running inside a xsi plugin. Had to thread it too so as the while loop that was listening for data wouldn't lock xsi while doing so.

Then we are sending pickled data through the external client on the same port.

I had to side step the fact that you can't run xsi commands from within the python thread by dumping the data to a user data blob prop on the scene root. From there you have to just read the data from a timer plugin that keeps checking for the data and eval the command.

It's not been fun but is cool to control xsi from Maya.

Ciaran Moloney

unread,
Oct 14, 2010, 7:31:17 AM10/14/10
to soft...@listproc.autodesk.com
<ethiv...@gmail.com> wrote:

It's not been fun but is cool to control xsi from Maya.


Shouldn't that be the other way around?

Simon Anderson

unread,
Oct 14, 2010, 7:51:44 AM10/14/10
to soft...@listproc.autodesk.com
Thanks :),
sounds quite complicated , I think maybe ill stick with running my scripts from NetView, and then if i have enough time will try doing what you did.
It sounds really interesting :)

Thanks again for the help

Luc-Eric Rousseau

unread,
Oct 14, 2010, 9:22:34 AM10/14/10
to soft...@listproc.autodesk.com
As discussed on this list a few days ago, there is s C# SDK sample
included with XSI that does that.
http://softimage.wiki.softimage.com/sdkdocs/examples/Addons/XSIServer/netview_xsiserver.htm

Eric Thivierge

unread,
Oct 14, 2010, 9:27:20 AM10/14/10
to soft...@listproc.autodesk.com
If you have the ability to use C#. :( If I'm allowed I'm going to see
if I can share the core setup I built in python. No promises.

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

Raffaele Fragapane

unread,
Oct 14, 2010, 8:49:49 PM10/14/10
to soft...@listproc.autodesk.com
Not according to marketing, sorry :)

Eric Thivierge

unread,
Oct 14, 2010, 9:42:00 PM10/14/10
to soft...@listproc.autodesk.com
Well, I think we all know where I stand on the topic... just saying,
its cool to send commands to XSI from any python shell. It is also
possible to do vice-versa as well.

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

Marc-Andre Belzile

unread,
Oct 15, 2010, 11:50:32 AM10/15/10
to soft...@listproc.autodesk.com
Hi,

check out si_tcp_server.py in the attached zip file, the plugin implements a tcp server that should allow you to send requests to XSI from a tcp client (such as tcpclient.py also included in the zip file). The plugin installs a menu where you can start/stop the server from xsi.

-mab

si_tcp_server.zip

Eric Thivierge

unread,
Oct 15, 2010, 12:42:35 PM10/15/10
to soft...@listproc.autodesk.com
Hey mab where was this 2 weeks ago!! :\ hahaha

It's a great example actually. You're able to run commands within it
handler which I wasn't successful in. I'll be picking yours apart for
that.

Also, the lag is pretty killer between cycles. Did you try threading the server?

I went the SocketServer module route myself. Running pretty smooth but
I have been having to write data to scene nodes and read them in a
separate timer plug-in and eval() the received data... dunno.

I really appreciate you posting this!

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

Marc-Andre Belzile

unread,
Oct 15, 2010, 1:48:32 PM10/15/10
to soft...@listproc.autodesk.com

-----Original Message-----
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Eric Thivierge
Sent: Friday, October 15, 2010 12:43 PM
To: soft...@listproc.autodesk.com
Subject: Re: opening an asset/model/scene from outside of Softimage

Hey mab where was this 2 weeks ago!! :\ hahaha

It's a great example actually. You're able to run commands within it
handler which I wasn't successful in. I'll be picking yours apart for
that.

Also, the lag is pretty killer between cycles. Did you try threading the server?

[mab] Yes, I tried the multi-threading implementation but it didn't work out very well. Actually, the lag doesn't
come from reading the socket but from serving the request (CreatePrimitive in my example). The gain of reading
sockets in a different thread doesn't seem that important since you'll eventually have to execute the client request
in the XSI UI thread anyway. Instead, I prefer using a timer to read the socket and process the request in one go.
I find it more reliable than having to use multi-threading which is quite challenging to make it work.

winmail.dat

Eric Thivierge

unread,
Oct 15, 2010, 3:17:37 PM10/15/10
to soft...@listproc.autodesk.com
The lag I was referring to is that as the server is running if you try
to rotate around the scene it goes for a second, pauses, goes for a
second....

Do you experience this on your end?

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

Marc-Andre Belzile

unread,
Oct 15, 2010, 3:43:16 PM10/15/10
to soft...@listproc.autodesk.com
Probably because the event timer logs a message every second.

________________________________________
From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] on behalf of Eric Thivierge [ethiv...@gmail.com]
Sent: Friday, October 15, 2010 3:17 PM

winmail.dat

Jules Stevenson

unread,
Oct 18, 2010, 3:38:30 AM10/18/10
to soft...@listproc.autodesk.com, Eric Thivierge / XSI Database
Hey Eric and all, I've been unsuccessfully trying to send this to the
list for nearly two weeks now (seems the googlemail to gmail switch
did bad things). It's a multithreaded xsi socket server python
implementation (it will accept multiple connections at the same time -
unlikey you'd ever need this, but you never know). It passes objects
to the main event loop, there's no lag and it should generally behave
itself. It's still a work in progress and has not been production
proven, but hopefully there will be something there to get your teeth
into.

Eric, if this doesn't make it to the main list (which it probably
won't) and it's useful to you, could you please post it on?

Cheers,

Jules

On Fri, Oct 15, 2010 at 8:43 PM, Marc-Andre Belzile

xsiserver.rar

Eric Thivierge

unread,
Oct 18, 2010, 7:55:35 AM10/18/10
to Jules Stevenson, soft...@listproc.autodesk.com

Hey Jules,

Thanks for sending it. I'll take a look when I get in this morning. I came up with a solution using the socketserver module which has a simpler threading mechanism.

I'm still unable to run commands from the thread which is killer. Looking forward to checking it out.

Thanks for posting again. Cool stuff like this is really fun to work with!

On Oct 18, 2010 3:38 AM, "Jules Stevenson" <droo...@googlemail.com> wrote:

Hey Eric and all, I've been unsuccessfully trying to send this to the
list for nearly two weeks now (seems the googlemail to gmail switch
did bad things). It's a multithreaded xsi socket server python
implementation (it will accept multiple connections at the same time -
unlikey you'd ever need this, but you never know). It passes objects
to the main event loop, there's no lag and it should generally behave
itself. It's still a work in progress and has not been production
proven, but hopefully there will be something there to get your teeth
into.

Eric, if this doesn't make it to the main list (which it probably
won't) and it's useful to you, could you please post it on?

Cheers,

Jules

On Fri, Oct 15, 2010 at 8:43 PM, Marc-Andre Belzile

<Marc-Andr...@autodesk.com> wrote:
> Probably because the event timer logs a message every sec...

Eric Thivierge

unread,
Oct 18, 2010, 9:35:28 AM10/18/10
to Jules Stevenson, soft...@listproc.autodesk.com
Looks like we're essentially doing the same thing. Setting the data to
a readable location then using a event to fire off the commands. :)

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

Marc-Andre Belzile

unread,
Oct 18, 2010, 10:13:40 AM10/18/10
to soft...@listproc.autodesk.com, Jules Stevenson
Outside ICE and rendering, XSI is not very multiple-threading friendly. You have no other choices than executing client requests through the Softimage main thread.

-mab


________________________________________
From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] on behalf of Eric Thivierge [ethiv...@gmail.com]

Sent: Monday, October 18, 2010 9:35 AM
To: Jules Stevenson; soft...@listproc.autodesk.com


Subject: Re: opening an asset/model/scene from outside of Softimage

Looks like we're essentially doing the same thing. Setting the data to

winmail.dat

Eric Thivierge

unread,
Oct 18, 2010, 10:20:34 AM10/18/10
to soft...@listproc.autodesk.com
As I've discovered. :) Not a big deal. Just have to write some
interpreter functions for the received data but not bad.

Thanks again for all the help and examples.

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

Reply all
Reply to author
Forward
0 new messages