Motion baker… that works

Home/Computer Graphics/Motion baker… that works

Motion baker… that works

My latest LScript is a motion baker script for LightWave that bakes such things as items animated through Denis Pontonnier’s DP Kit + Node Item Motion and other “non standard” ways of animating in LW.

It also bakes all selected items, and on a test of 100 nulls, it took about 12 seconds to bake them over 100 frames, so 10.000 keys set in total. To make sure that it bakes the correct value, it runs through the timeline once, extracting the values from each selected item, and then afterwards applies those values to the respective channels: position, rotation and scale.

Once it is done baking, it goes back to the frame you were at when triggering the script, nothing grand, but just a little extra touch to make it a nicer workflow. As far as I can tell, this script will bake other tricky animations such as expression based animations and the like. Give it a spin and see if it works in your projects.

Thanks to Mikael Burman for suggesting and testing the script!

Edit: updated the script to have a GUI so you can specify the range of frames to bake.

Download MFMotionBaker

By | 2009-09-24T19:34:24+00:00 September 24th, 2009|Computer Graphics|30 Comments

About the Author:

30 Comments

  1. GuanoLad 2010/03/19 at 06:17 - Reply

    I’m having trouble with the generated keys not including its Parented Object’s motion.

    I think it needs to have its motion calculated relative to an Origin point, then applied to a new object or Null, so the resulting path is not affected by the Parent and subsequently exaggerated.

    Can that be done?

    • Petter Sundnes 2010/03/19 at 06:33 - Reply

      The parent wont be baked unless it is also selected, so the best way around it is to go to the scene editor and select children recursively. If thats not what you are after, could you send me an example scene of how it is not working?

  2. GuanoLad 2010/03/19 at 07:39 - Reply

    Thanks for the quick response.

    That didn’t seem to work, but then I may have misunderstood.

    I’m applying this to a Camera Path. It’s Parented to two Nulls affecting its position and bank, while it’s Targeted to another Null that is affecting its pan and tilt. (based on the motion tracking advice here: http://bit.ly/cR1W3p )

    Does that make a difference?

  3. Petter Sundnes 2010/03/19 at 07:42 - Reply

    Then I would suggest that you replace the camera with a third null, and just use a motion modifier on the camera to make it follow that third null, so when you bake the camera, it will be correct in world space.

  4. Simon Smalley 2010/05/25 at 15:38 - Reply

    Awesome plugin! You just made my life a whole bunch easier! Thanks!

  5. Simon Smalley 2011/09/21 at 11:22 - Reply

    Thanks again for an awesome plugin. I have a slight issue with it in that when I bake an object that has rotation more than 360 degrees, lets say 0 – 720 degrees over 100 frames… the baked keyframes only bake from 0-360 degrees and then jump back to 0 for the 2nd rotation. I have a lot of animations with huge rotations to bake, from 0 to 3600 degrees etc… so it is causing me a few problems having to adjust the baked keyframes by hand in the graph editor. Is there going to be an update which can handle rotations past 360 degrees?

    • MentalFish 2011/09/21 at 11:52 - Reply

      I am not sure why it does not bake the same value as shown in the GUI, at the same time, a rotation only goes from 0 – 360 x revolutions so there could be something with it not taking that into consideration. Will have to look into it.

      • Simon 2011/09/21 at 13:29 - Reply

        My apologies, it turns out that your motion baker works perfectly. I am using a 3rd party plugin (match goal orientation) alongside your motion baker and it turns out that it’s that one that only does 0-360 degrees in world space, and not yours.

        Sorry :^(

        • MentalFish 2011/09/21 at 13:32 - Reply

          No prob πŸ™‚

          • Simon 2011/11/30 at 16:28

            Hi, I seem to be getting the same issue again with the motion baker…using curve constraint on a null, baking it using MFMotionBaker and the result is as described above, where it only seems to bake between 0-360 degrees.

            Any ideas?

            Thanks in advance πŸ˜‰

          • MentalFish 2011/12/01 at 10:58

            As before, the script only bakes the value it finds in the animation curve of the item. If it bakes between 0 – 360, then thats the value of the curve I would guess. I haven’t looked at the scripts lately, but I might give it a nother looksy soon, to ensure LW11 compatabily and perhaps convert them to Python.

  6. Simon 2011/12/01 at 14:27 - Reply

    Ah ok, so its the curve that’s causing the null to snap back rather than the baker…thanks. Sorry, should have checked that.

    • MentalFish 2011/12/02 at 16:52 - Reply

      How many email addresses do you have Simon? πŸ˜€ I keep having to approve your posts as each of them specifies different emails πŸ™‚ Anyway, feel free to post feedback in any way or form πŸ™‚

  7. Glen 2012/02/21 at 16:00 - Reply

    Plug-in works great! Using it at work for our projects and it makes things easier. Thanks for the work!

  8. Scott 2012/02/24 at 21:33 - Reply

    Thanks for the script!

  9. Dan 2012/05/03 at 14:11 - Reply

    Brilliant Lscript!! ..so many people on the forums have been having problems with motion modified motion not baking properly ..curve constraint for one, and none of the usual baking options work …but your’s did perfectly …great job! Thanks

    • MentalFish 2012/05/03 at 14:39 - Reply

      Thanks, glad to hear that πŸ™‚

  10. erikals 2012/05/26 at 14:14 - Reply

    ello Senior!

    another LW resque :]
    just wanted to share a link to a MFbaker video Cageman made some time ago… might be handy for newbies..

    thanks again πŸ˜€

    linky –
    http://forums.newtek.com/showthread.php?t=116845

  11. pvfx 2012/12/05 at 06:22 - Reply

    Sorry if this is a dumb question, but does your baker script work for a simple IK rigged character? I tried it with mine and the knees and hands aren’t working. Does this bake IK too?

    • MentalFish 2013/01/02 at 06:21 - Reply

      Pardon my late reply, but yes, it should work on any type of item. Are the knees and hands consisting of some sort of special items in the rig?

  12. Logan 2013/04/09 at 16:42 - Reply

    Hi There! Thank you for the script, it’s exactly what I’m looking for…but I’m not quite sure how to use it the way I mean to.

    What I mean is, I’m trying to bake an IK animated character’s bones to operate in FK. I don’t know how to go about this. The most intuitive way (i.e., baking the bone’s position through the animation and turning the IK off to check if it worked) isn’t giving any results. Other than setting limits, my animation has nothing particularly special. What am I doing wrong?

    A short screen capture of my issues:
    http://dl.dropbox.com/u/48192128/Motion%20Baker%20issues.mov

    • MentalFish 2013/04/10 at 08:32 - Reply

      Select the animated items, run the LScript and you should be able to bake the keyframes πŸ™‚ You can add the script as a button in the LightWave interface like any other plugin as well. Let me know if you have any troubles with it.

      Edit: I just saw your animation and see what you mean. Does the bone have some sort of “Target Item” or similar that overrides any baked keys?

      • Logan 2013/04/14 at 17:03 - Reply

        To my knowledge, the only things affecting the bones are IK chains in the arms, legs, and tail, as well as the parenting structure of the bones. In the animation, the arm goals show as the orange boxes. The lower arm bones (the examples in the video) don’t have a direct target item, but they are affected by their direct children, which have the arm goals as goal objects.

  13. Charles 2013/04/13 at 16:51 - Reply

    Your script saved the day, after hours of trying other methods MF Motion Baker had me up and running in about 2 minutes!

    Thanks!

  14. William Goodson 2013/05/24 at 13:02 - Reply

    Hi, I am interested in exporting IK animations using match goal orientation to Unity. Everything I have tried including this plugin doesn’t seem to work. When I import my fbx into Unity it continues to ignore the IK animation even though all the objects,nulls, and bones are baked using your plugin. Am I doing something wrong? Should this work? Is there a better working order when making animation for Unity? Thank you so much for your help. This problem has been plaguing me for far too long.

    • MentalFish 2013/05/25 at 10:38 - Reply

      Woohoo, another LW -> Unity user πŸ™‚ Could you provide me with the LightWave scene, I’ll take a look. Also, what version of LW are you using?

  15. Ryan Roye 2013/09/14 at 06:17 - Reply

    I just wanted to let you know I consider this one of the most important tools in my animation workflow. This program really is a boon to animators of Lightwave!

    • MentalFish 2013/09/16 at 10:55 - Reply

      Thank you so much for the kind words πŸ™‚

  16. Charles 2014/02/26 at 22:14 - Reply

    I ran into a situation where MF Motion Baker would not work for a parented null, but it did work when the null was linked through Motion Options using controller limits with β€œWorld” and β€œSame as item” checked

  17. Shawn Brady 2014/08/22 at 18:43 - Reply

    love it. worked for me right out of the box.

Leave A Comment