Motionbuilder + unittesting

I want to have a nice process in place for unit-testing in MotionBuilder. Unfortunately, because there is no headless MotionBuilder this is not so straight forward.

I wonder if anyone else has done this and made it work nicely with packages like nose or pytest? Anyone have any hot tips to share?



Maybe something in here you can use:

Btw. I’m super curious about unit testing in content packages. If you have some info or references about this, please share :slight_smile:

The way we do this is to have MoBu start up and run a ZeroMQ REP server, then the pure Python process (client) can tell it to exec and eval stuff. I don’t have a MoBu version but I did have it working at one point (we stopped using it and I deleted all the mobu code). I did some testing of open-sourcing our tools if you want to take a look at a code dump (this depot is JUST a code dump, sometime next year we hope to have a full repository set up).

The base library we use for this pattern:
Our Maya REQ/REP system:
Base class that allows us to write normal test code that ends up being executed in Maya:

We use all of this extensively. Feel free to inspect and harvest the code to get going.

Thanks Rob,
I took a stab at using ZMQ last week actually, but wasn’t able to get it load in Mobu. Do you build it yourself? Pip install doesn’t work for me.

There doesn’t appear to be official builds for Python 2.6 x64, I did find one on Christoph Gohlke’s site but that fails to load in Mobu - MSVCR90.dll missing error. Putting MSVCR90.dll in Mobu path causes problems on Mobu startup.

Thanks for sharing your code Rob!