7
$\begingroup$

I have several objects in the scene, each of them has few shape keys. All shape key values change simultaneously with the same value. Every time I need to keyframe the animation I have to go to every object and keyframe each shape key's value. Is there a way to somehow make these values bound? So, if I change one 'master' key shape value, the rest of the key shapes in other objects change the value as well.

$\endgroup$
8
$\begingroup$

Yes, you can definitely do this with drivers. Here's how:

enter image description here

In this first image you can see that I've created 2 spheres, each with a Basis shapekey. Sphere 1 has a second shapekey called Sphere1Key, which changes the sphere to a fatter shape. This key is animated (keyframed) from 0 to 1 over 50 frames. You can see the value field is green due to the keyframed status.

The second sphere also has a second shapekey called Sphere2Key, which deforms the sphere in the same way.

enter image description here

For the Sphere2Key shapekey, I have right clicked on the value field and selected Add Driver.

With Sphere 2 still selected I open up the Graph Editor and switch from F-Curve Drivers mode with the dropmenu in the toolbar.

You can see in the left panel that the Sphere.001 is selected and I've also selected the Value for the Sphere2Key shapekey.

Now we just have to map the value from the first sphere's shapekey to this one.

To do this, press N to bring up the right property panel. In the Drivers area we want these settings:

  1. Change type to Scripted Expression.
  2. In Expr, add a variable name (I've used getSphere1KeyValue)
  3. Click Add Variable button
  4. In the variable name field paste in the name from the Expr box above (getSphere1KeyValue)
  5. Change the variable type to Single Property
  6. Change the Prop type to Key
  7. Change the selected Key id block to "Key" or whatever the name of the id block for the keyframed data for the Sphere1 shapekey value is (The available values list automatically when you click in this field. If you're not sure what it should be you can select Sphere1 and the switch to the Dope Sheet and find it there).
  8. Enter the RNA path to the sphere 1 key value into the Path field. You can get this value by right clicking on the Sphere1Key field in the shapekeys panel, and choosing Copy Data Path.
  9. The value for the Value field in the Driver panel should now update when you scroll the timeline back and forth.
  10. If the Sphere2 shapekey doesn't respond, you may need to click the Update Dependencies button in the driver panel. You should then see the Sphere2 shapekey copy the Sphere1 shapekey keyframed values in synchronization.

enter image description here

Note: you may notice in the gif that the numbers in the Value field are not changing while the animation runs. This is simply a UI display issue, the actual values are changing, as evidenced by the shape change in Sphere.001. If you hover the cursor over those fields you'll see them update.

$\endgroup$
  • $\begingroup$ Thank you very much for such detailed response, makes me want to get more into the drivers. $\endgroup$ – marcheenek Apr 9 '15 at 3:41
  • $\begingroup$ @marcheenek If you wanna play around the drivers, I started my journey into their world with this tutorial cgmasters.net/free-tutorials/… $\endgroup$ – Highstaker Apr 9 '15 at 3:51
4
$\begingroup$

As Todd mentioned, drivers can be used to achieve that. Yet I would prefer to create an additional object which will be a master control.

Generally I prefer an Empty for that (called Master in my scene). Also, here are the objects: a cylinder with a shape key that makes it taller, and a cube with a shape key that makes it wider:

enter image description here

  1. Select one of the objects, hover over one of its shape key's Value and press D, that adds the driver to it.
  2. Go to graph editor and press N to bring up the properties panel. Also, select Drivers at the bottom.

enter image description here

  1. Select your shape key at the left side. In the properties panel go to Drivers tab. If you don't have a variable there right away (var in my case), then click Add Variable.

enter image description here

  1. It can be easier to operate with the size of your master Empty in this case. Under the var select Transform Channel in the dropdown menu, select Master in Ob/Bone field and select Z Scale in Type (you can use Master's location or rotation instead, choose the corresponding entry in this menu then).

  2. Now you need to write an expression under Expr. I wrote var-1 in my example, because I wanted my shape key value to be 0 when the scale of my Master empty is 1. You can write whichever you need.

Note: You can write 3*var-1 (or any other multiplier) to make your shape keys affected more. I use it to scale when I create music visuals, because the curves baked from sound (which I apply to Master empties) are not editable by default.

enter image description here

  1. Now try scaling your empty. The object should react.

  2. Now go to your object (cube in my case), right click on the shape key Value > Copy Driver. Go to your another object, right click the Value > Paste driver.

  3. Now both objects should react to the change of the scale of the Master empty. If the second one doesn't, you may go to its driver properties in graph editor and click Update Dependencies.

  4. Now just go ahead and animate your Master empty's scale.

Hope it helps.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.