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
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.
It's not been fun but is cool to control xsi from Maya.
--------------------------------------------
Eric Thivierge
Technical Director
http://www.ethivierge.com
--------------------------------------------
Eric Thivierge
Technical Director
http://www.ethivierge.com
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
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
-----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.
Do you experience this on your end?
--------------------------------------------
Eric Thivierge
Technical Director
http://www.ethivierge.com
________________________________________
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
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
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
Technical Director
http://www.ethivierge.com
-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
Thanks again for all the help and examples.
--------------------------------------------
Eric Thivierge
Technical Director
http://www.ethivierge.com