Animate uniform Scaling with Drivers

29.01.2014 @ Tutorials(Animation, Blender, Drivers, Python, Tip)

Some­times we want to ani­mate a trans­for­ma­tion uni­form­ly in Blender but we find it’s divid­ed into dif­fer­ent chan­nels. In today’s tip we’ll cre­ate a dri­ver to ani­mate mul­ti­ple chan­nels from one.

First ani­mate the scale of your object as usu­al, or just add a cou­ple of  keyframes to get some ani­ma­tion data. Decide which chan­nel you want to ani­mate.

It can be any of them, I usu­al­ly choose X. Now go into the dopesheet edi­tor and delete the oth­er two chan­nels (Y and Z in this case). Now we can add dri­vers to them. Open the prop­er­ties bar and ctrl+click on the Y scale to type a val­ue. Type # fol­lowed by this:

    bpy.data.objects['My Object'].scale.x

Replace “My Object” with the name of your object but don’t remove the quotes though. You can check it’s name by select­ing it and look­ing at the bot­tom of the 3D view or in which one gets select­ed in the out­lin­er. Do the same for the Z val­ue. The hash (#) is the short­hand for quick­ly adding dri­vers in Blender, you could also right-click and select “add sin­gle dri­ver”. Once a dri­ver is added you don’t need to type the hash any­more.

Now you can dri­ve the scale val­ues (and F-Curve) for Y and Z using X. You can also do more advanced things like using for­mu­las and math func­tions. For instance if you want­ed your object’s height to be half it’s width, your Z scale dri­ver would be:

    bpy.data.objects['My Object'].scale.x / 2

The sky is the lim­it with dri­vers, not only for cre­ative or exper­i­men­tal uses but also to workaround issues like this. So Learn some Python and have fun.

All the posts you can read

No comments yet

Leave a Reply

Your email address will not be published.