Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / XSI SDK / Maya commandPort Equivalent In XSI
  RSS 2.0 ATOM  
2 pages: 1.2 last

Maya commandPort Equivalent In XSI
Rate this thread
 
30106
 
Permlink of this thread  
avatar
  • Total Posts: 22
  • Joined: 11 August 2008 01:55 PM

Hello o/

Is there a way to send remote commands to XSI like with maya and it’s commandPort command ? There is an example by Kim Aldis on XSI-Blog ( http://www.xsi-blog.com/archives/132 ) but the thing is that xsi is stuck untill something come through the socket or the connection timeout. It’s pretty annoying to have the software frozen :[ Anyone has an idea to achieve this ?

Thanks,

Thomax



Replies: 0
avatar
  • scaron
  • Posted: 14 September 2008 10:53 AM

XSI ships with an sdk example called, XSI Server, i have a friend that implemented a cross platform “command port” for XSI and Maya he got them to work as closely as possible.

http://softimage.wiki.avid.com/s...ver/netview_xsiserver.htm



Replies: 0
avatar

never actually used it but there’s a C# example of a TCP/IP XSI server in the SDK examples.
Did you try that one?



Replies: 0
avatar

Don’t wanna look dumb but I didn’t manage to get it works, when I connect the XSISDK workgroup I have a XSIServer addon. If I explore the directory I do notice there is a CSharp file : XSIServer.cs with this ‘in_reg.RegisterCommand("XSIStartServer",null );’ but when I try to execute this command in the script editor I get an error saying the command is not define.

Any clue about what to do ?



Replies: 0
avatar
  • scaron
  • Posted: 15 September 2008 07:55 AM

i am sorry but i have never used it… i just know it was used as a kicking off point to setup a platform independent command port from a SQL database to XSI or Maya



Replies: 0
avatar

Looks like the compiled plugin is missing from the XSI 7 install.
You’ll have to compile XSIServer.csproj first.



Replies: 0
avatar

Argh :| that suck, I don’t have Visual C here. Do You think express version would do the trick?



Replies: 0
avatar

Yes, I use the Visual C# 2005 Express Edition to compile CSharp plugins.



Replies: 0
avatar

Ok Thanx I’ll give a try tonight when I get back from work.



Replies: 0
avatar

Ok I have compiled the XSIServer and it’s working fine with the XSIClient. By the way I’m encountering problems if I try to connect through python :

Sending this from a python interpreter :

import socket

cXSI 
socket.socket(socket.AF_INETsocket.SOCK_STREAM)
cXSI.connect(("127.0.0.1"10000))
cXSI.send("Hello")
cXSI.close()

Lead to an instant XSI crash.

Doing a Telnet :

telnet localhost 10000
h

Result in :
[I]// ERROR : Unknown request: h[/I] ,
that sounds normal to me

The same Telnet on maya result in a
[I]h;[/I]
[I]// Error: Cannot find procedure “h”. //
[/I]That also sound ok.

But the same python code as the one above used for XSI lead to this in Maya :
[I]Hello;
// Error: Cannot find procedure “Hello”. // [/I]
Normal behavior too.
Does that anyone has an idea of what can be wrong with the connection ?



Replies: 0
avatar

I did some more tests, with some success but still crashing using this :

import socket

cSocket 
socket.socketsocket.AF_INETsocket.SOCK_STREAM )
cSocket.connect( ( "localhost"10000 ) )
cCommand "script|C:/DOCUME~1/KELSOL~1/LOCALS~1/Temp/sIBL_XSI_Import.js"
cSocket.send(cCommand)
# cXSI.close() This Line Is Commented

The script is executed correctly but I did noticed that XSI is not crashing if I don’t close the connection :

cXSI.close()

If I uncomment this line I get an instant crash and If I don’t close the connection, crash happen after a while (~5 secs) when I execute the connection stuff a second time
. Anyone have a clue of what’s happening ?



Replies: 0
2 pages: 1.2 last