Talking to motionbuilder?

Hello,

I found this thread about using Telnet to talk to MotionBuilder from the outside:

http://chrisevans3d.com/tutorials/mbui.htm

I’m looking to do stuff like:

  • Hook an IDE up with MB
  • Stream data between MB and Max/Maya
  • Batch MB files from an external tool

Is Telnet the way to go?

I had a go with some of the stuff you’ve written here…

  • Hook an IDE up with MB
    yes, telnet should be the way to go i’d say or perhaps make a device plugin that can evaluate python.

  • Stream data between MB and Max/Maya
    I tried this out with mixed results… I wanted to stream animation from MB to maya so when I move control in MB it would move in Maya.

I made a device plugin in MB and a custom mel command in Maya with a network socket.
My attempt to have streaming data didn’t work since on maya side, i had issues with threading. I couldn’t change data in the scene from outside of mayas mainthread. So in the end I had to run my socket inside of the mainthread and force maya to update the viewport at certain intervals. But in the end, I couldn’t get a decent framerate in maya (but then again, my network socket might not have been the best).
I also tried with baking animation from MB to maya, but it took a long time and defeated the purpuse of what I wanted to acheive .

MB 2012 has some maya<>MB integration i’ve seen, but no data streaming more like moving scenes between software.

  • Batch MB files from an external tool
    Look into FBXSDK, I’ve used it a bit for batching stuff, works well. Downside is that you lose the whole character system because thats something motionbuilder creates for you (or am I wrong?)

Thanks a lot Erik, that’s really helpful.

If you don’t mind me asking, what kind of frame rates were you seeing, when trying to stream animation into Max/Maya?

Cheers

less than 15 fps almost constantly.
but there was still stuff i didn’t try to optimize because we scrapped the idea:

  • I sent the values of all attributes every frame, just sending the ones that have updated might ease up the work.
  • Make sure your socket on Maya-side is not halting the code too much.

Cool - that would be plenty for my application :slight_smile:

Can hook up to WingIDE with these steps: http://www.jason-parks.com/artoftech/?p=30

You would probably have more flexibility if you have a service that sat between them that could be much smarter about the communication to Maya- it would also result in much better frame rates because all the processing could go on in another process on another thread, so all Maya would have to do is update its scene and not do anything else.

Yeah, thanks Jason. Already got that up and running and it’s awesome. Actually I’m the guy who recently spammed that post with comments :slight_smile:

What I’m looking to do additionally is run code, evaluate selected and then getting feedback on that, all from within wing. If your solution already provides some of this, I’ve missed it.

I have a lot of thoughts and ideas flying around in my head these days, that revolve around the fact that using multiple DCC applications is likely not going to go away at our studio.

So some kind of shared language/framework seems to be called for, so that all the applications can talk to each other and rely on commonly defined “application agnostic” data and functionality as much as possible.

However I don’t really have a lot of experience outside of working with Python inside the context of a single DCC app, using a few 3. party modules, making system calls, talking to perforce, saving data out to xml and text files and so on. So I’m not really sure how to approach these ideas.

I’d love to have all the packages be able to talk to each other - maybe though a third party. So you could have access to the same data and objects and would not have to wrap all your calls in strings. But I don’t know if that’s even possible? I’m talking about Python here.

Also what Erik said about utilizing an existing format that describes 3D data, might make a lot of sense. Cause in time I guess we’ll just end up having written my own to some degree. Though if the FBSDK is anything like the MotionBuilder API, I’m not so sure I want to date it :open_mouth: Has anyone got any experience? Possibly we already use and intermediary format in our engine for that I can capitalize on.

Argh… Sorry for the messy post! My head hurts a bit - but in a good way I think :slight_smile:

Sune

[QUOTE=Sune;11177]
What I’m looking to do additionally is run code, evaluate selected and then getting feedback on that, all from within wing. If your solution already provides some of this, I’ve missed it.[/QUOTE]

Sorry, nope, Sune. I don’t have any way to send commands from Wing to Maya’s live session Python interpreter. But there are a couple of ways of achieving fast testing of code. I understand sometimes you want to just check a single line but you can always just have tons of tabs named in the scripteditor and keep all your scratch code there.

  1. import and reload your entire script tool with a shelf button or couple of lines in Maya or MoBu’s script editor. Then it is 1 button press or 1 line highlight to refresh your code.

  2. unitTests. Wing has some nice unittesting features that allow you to run unittests on your code through a seperate mayapy instance. This only works for Maya because of the availabilty of mayapy.exe. You might be able to build up a unittest that acts as a little scratchpad and spawns an interpreter real fast and tests out your lines.

(Sorry to spam: unittest intro here: http://bit.ly/unittest_aot)

BTW: From Eclipse you CAN send lines directly to Maya and get feedback. How to is listed on Christian’s page: http://www.christianakesson.com/blog/?p=111

As far as sending stuff to MoBu and batching MoBu, unfortunately Motionbuilder was originally not even written with a scripting language. It took us many years to convince Kaydara to finally wrap their SDK with Python. It was an afterthought and it was not architected to run their scripting interpreter on it’s own via something like ‘mobupy.exe’ and no way to run MoBu commandLine w/o a UI.

Post deleted