Does anyone know where I could find a tutorial or some kind of documentation on how to interact with Maya using outside means. Such as using a web page to control a character/scene or better yet having a local java GUI that can push and pull data from Maya.
The maya command port accepts communications over TCP/IP; if you google ‘maya python commandPort’ you’ll get a bunch of options. Anything that can send text over TCP can do it. The incoming text can be treated as if it were mel entered on the command line – or you can create a proc and have it handle the text that comes in for you using ‘commandPort(pre=your_command_here)’
The more modern way is to use a remote process module like RPyc or 0mq, as discussed here and here
Maya <-> Python <-> Python.net(CLR) <-> WCF over SOAP/HTTP <-> Other WCF .NET Applications
This is not for the faint of heart, and is best debugged with runes, tea leaves, and coding during a new moon. Also, it requires that you explicitly expose the data and methods you want to use externally.
We did the same route at Bungie, using Max and .Net . It was bad mostly because the folks in Max land (= me) and the folks who wrote the ‘other applications’ didn’t work closely enough together (or do enough documenting!) so that changes on either end caused problems. If I had to do it all over again I’d unit-test the crap out everything that went over the wire so neither side could give the other unpleasant suprises. I’d also invest time upfront in a good standard (shared) library of data types that both ends had so there was no crazy marshalling on either end.
Yeah, I’m busy right now moving all the functionality into a single assembly that is shared by all the separate apps and which stubs out all the methods and interfaces. The actual functionality will be provided/overridden by the actual apps. I’m hoping this will make things easier. It’s taken me far too long to wrap my head around it…
We’re using a wsgi server inside of maya with specific urls set up. I had originally thought to use the command port as it’s built in and all, but one cool thing we can do is have a webserver that can respond to the users IP with an http request to interact with maya. It’s one more moving part, but it’s a small one. And debugging is pretty easy if you handle all of the requests properly. After reading theodox and btribble, i’m gonna document the crap out of it on monday