Motion baker… that works

Written by MentalFish. Posted in Computer Graphics

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

Tags: , ,

Trackback from your site.

Comments (17)

  • GuanoLad

    |

    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?

    Reply

    • Petter Sundnes

      |

      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?

      Reply

  • GuanoLad

    |

    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?

    Reply

  • Petter Sundnes

    |

    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.

    Reply

  • Simon Smalley

    |

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

    Reply

  • Simon Smalley

    |

    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?

    Reply

    • MentalFish

      |

      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.

      Reply

      • Simon

        |

        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 :^(

        Reply

        • MentalFish

          |

          No prob :)

          Reply

          • Simon

            |

            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 ;)

            Reply

          • MentalFish

            |

            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.

            Reply

  • Simon

    |

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

    Reply

    • MentalFish

      |

      How many email addresses do you have Simon? :D 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 :)

      Reply

  • Glen

    |

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

    Reply

  • Scott

    |

    Thanks for the script!

    Reply

  • Dan

    |

    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

    Reply

    • MentalFish

      |

      Thanks, glad to hear that :)

      Reply

Leave a comment