Transform conversion successful!

loocas | 3ds Max,Maya,technical | Wednesday, June 25th, 2008

Just a quick note about my latest, successful :) , transform conversion in a real production environment. If you’ve read my last article about the transformation matrices and how they can be used for manipulating object positions, rotations and scale, you’ll remember I also wrote about an example of converting 3ds Max object transform matrix into Maya’s xform matrix. All I needed was some real-world scenarion where I could successfully test out this method as it was, to me, untested territory. It finally came on the project we’ve been working on at UPP. I have several characters set-up and rigged in 3ds Max that I then transfer between various software packages we use here (mainly Maya and XSI). Obviously, the problem is the Up axis that is different in 3ds Max, which is the Z axis, in Maya and XSI it’s the Y axis. The problem isn’t the translation of objects, that’s easy, the main problem is the rotation of objects that needs to be converted to the different axis scheme.

Max to Maya matrix conversion

The concrete problem I had to solve was a prop, a motorcycle (an old, steampunk-like machine), that was already baked into individual point cache files. The prop is consisted of around 1000 pieces and baking the 400f animation takes about 1 hour. The problem was that a simplified version of the bike was animated in MotionBuilder, then the secondary animation was taken care of by my rig, which then gets baked and transferred over to Maya for rendering. Unfortunately when facing extreme deadlines, errors tend to happen. One such error happened from the animation side, the bike was offset in its reference node (if you’re familiar with MotionBuilder, you know this isn’t a good thing). The other thing is the point cache baking that drives its offset data from the parent, NOT from the world origin! Well, PointOven does that, but PC2 doesn’t. The final result was that in Max the bike was offset by a certain translation value and to make it even worse, it was slightly rotated. FBX transferred this offset correctly, but point cache data didn’t take the offset into account and calculated the vertex data from the reference position, which acts in the hierarchy as the identity matrix (matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0]) = no offset.

A “safe” solution would be to re-cache the whole prop, which would be a waste of time, as I said, it takes around an hour to do, besides in the particular shot we worked on there were five motorcycles and five riders, which is a sh*t-load of data, if you ask me! So, instead of recaching the data, I identified the problem as a simple, stationary, matrix offset in 3ds Max. I wrote a function that coverted and formatted the 3ds Max matrix3 value into Maya matrix4 value and run a single line of code in Maya to offset the root of the prop with all the caches on.

All this took me about 5 minutes to do instead of an hour and something doing it the conventional way – fixing the error in MotionBuilder, replotting the animation, re-caching the meshes and then re-importing the newly created caches in Maya. Of course I fixed the error later, when I had the time, so that next time we don’t have to offset anything, but in a critical time, such a deadline is, this was the best solution I could have came up with. So, I consider my experimental matrix conversion method as proven and I’ll be looking forward to start fully utilizing this method in my future rigs/systems/tools as that’s a very powerful, yet simple way of bridging various 3ds apps together when it comes to animation data transfer.

2 Comments »

  1. Hi there,

    Just read this post of yours. I was just wondering whether FBX correctly exports animation data from 3ds Max to Maya and vice-verca, without causing this offset problem?

    Cheers,
    ak

    Comment by amitkhanna — January 26, 2011 @ 14:01

  2. Hi there, amitkhanna,

    recently, I haven’t had any issues with transferring anim data between 3ds Max and Maya. So, I’d say, FBX is pretty usable.

    Comment by loocas — January 26, 2011 @ 16:34

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress | Theme by Roy Tanck