Re: [scripting:python] external access to XSI
| Date : Tue, 2 Jan 2007 18:19:01 -0800 |
| To : XSI(at)Softimage.COM |
| From : "Steven Caron" <carons(at)gmail.com> |
| Subject : Re: [scripting:python] external access to XSI |
well here is a module that may come in handy for greg and others..
http://pexpect.sourceforge.net/
"Pexpect makes Python a better tool for controlling other applications.
Pexpect is a pure Python module for spawning child applications; controlling them; and responding to expected patterns in their output. Pexpect works like Don Libes' Expect. Pexpect allows your script to spawn a child application and control it as if a human were typing commands.
Pexpect can be used for automating interactive applications such as
ssh, ftp, passwd, telnet, etc. It can be used to a automate setup
scripts for duplicating software package installations on different
servers. It can be used for automated software testing. Pexpect is in
the spirit of Don Libes' Expect, but Pexpect is pure Python. Unlike
other Expect-like modules for Python, Pexpect does not require TCL or
Expect nor does it require C extensions to be compiled. It should work
on any platform that supports the standard Python pty module. The
Pexpect interface was designed to be easy to use."
enjoy!
steven
Yes, I've got experience with this. A couple of years ago we were
attempting to to import flight data of aircraft landing at a terminal. I
had position and attitude data and was attempting to import that into a
Maya scene. After numerous attempts trying to convert the data via a
Maya move file, I instead imported via the command port. Basically I had
too many aircraft to process the move files easily. I was able to
automate the whole process outside of Maya, process the data standards
conversion, import the external data into maya, generate the
connections, keyframes, etc, via command port. It worked really well,
.....and I got to use Perl to script my Maya scene instead of
MEL...Muwhahahahaa! In fact everything was automated straight from the
perl script I wrote, just start Maya, open the command port, write the
perl script with a port connection to Maya, and execute.
In the case of Maya I found it most useful because there are things you
just can't do well with MEL if they aren't directly tied to a MEL
function or Maya command. This is more to do with the fact MEL is
lacking decent regex tools and is not useful for anything not directly
associated with Maya. XSI doesn't exactly suffer the same restriction
because you have so many different language options for scripting. As
long as you can draw the data into your scripting session, you really
don't need to be outside of the application to get use of a decent
programming language. However, if you are trying to coordinate data back
and forth between two applications using perl or python to synchronize
between say Maya and XSI or XSI and some other scientific visualization
app, having a command port available in XSI would be quite useful.
Joey Ponthieux
NCI Information Systems Inc.
NASA Langley research Center
____________________________________________________________
Opinions stated here-in are strictly those of the author and
do not represent the opinions of NASA or any other party.
Ben Barker wrote:
> That sounds pretty cool. Anyone have experience using Maya's
> commandPort in production (or something similar) and care to share any
> thoughts? Seems like you could do some pretty useful things, besides
> sending X rated geometry to Graham's workstation during reviews.
>
> On 12/29/06, Luc-Eric Rousseau <lucer(at)softimage.com> wrote:
>>
>>
>> Well basically it's not possible to call scripting functions from
>> outside of
>> XSI,
>> because that means calling functions across two processes, and we don't
>> expose a socket port for scripting.
>>
>> So what that XSI 6.0 sample does is implement a server in XSI that
>> listens
>> to a network socket. Then, outside of XSI you send scripting
>> commands to
>> that
>> socket which are then executed in XSI.
>>
>> This could be used for example to force an update of a plug-in while
>> users
>> are running XSI.
>>
>>
>> -----Original Message-----
>> From: Kim Aldis
>>
>> Interesting -and useful - example but wouldn't it have been easier to
>> do the
>> same thing using only a few lines of Python or Perl code?
>>
>> > -----Original Message-----
>> > From: Stephen Blair
>> >
>> > Hi
>> >
>> > If you have XSI 6, take a look at the XSIServer example in the SDK
>> > example workgroup.
>> >
>> > Steve
>> >
>> > -----Original Message-----
>> > From: Greg Smith
>> >
>> > I was curious if it was possible to run a script outside of XSI that
>> > could control some aspect inside XSI. The simplest thing I would like
>> > to do is to invoke a XSIUIToolbox.Msgbox pop up inside xsi from an
>> > external script using string data collected from outside of xsi.
>> >
>> > Just Curious
>> >
>> > Greg
>>
>
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi
- Follow-Ups:
- RE: [scripting:python] external access to XSI
- From: "Kim Aldis" <XSI(at)kim-aldis.co.uk>
- RE: [scripting:python] external access to XSI
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: RE: shading geometry instanced to particles
- Next by Date: RE: shading geometry instanced to particles
- Previous by Thread: RE: shading geometry instanced to particles
- Next by Thread: RE: shading geometry instanced to particles
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |