Making a shape key with a value that is the average of other shape keys

I have an object called "Template" and it has several shape keys, one of which is called "Speaking". Another is called "[AVERAGE]", which I want to be the value of the average of all its other shape keys. This is for animation.

Where I'm running into the problem is with the RNA syntax.

Here is where I am trying to add the variable for the Shape Key named "Speaking" to the Driver of the Shape Key named "[AVERAGE]" and as you can see by the red - it's not a valid path:rm

Here is where I have found the RNA path of the object in the Outliner:

What am I doing wrong? I have tried various variations of syntax, but nothing has worked.

Thanks

2 Answers

The data_path on a driver variable is relative to the ID object you select, in your case objects "Template". The location x path from here would be "location.x" or "location[0]" for example.

Select key as an ID object instead and your keyset. An example path to "Key 1" key's value is demonstrated in image.

Alternatively from the mesh bpy.context.object.data.shape_keys which returns a pointer to a bpy.data.shape_keys keyblock.

Screenshot of average shapekey driver setup

PS. The panel on RHS is a shameless plug for my Driver Manager Addon.

• You rock! Thank you. I found what appears to be a download page for your add-ons but the page is blank when I visit it. Also, from your screen shot it looks like the button sizes are hard-coded and therefor not displaying correctly on Retina Display. Maybe looking at this bug report will be helpful to you - the same problem occurred in Blender's standard UI and was fixed. Nov 24, 2015 at 11:25
• @Mentalist github.com/batFINGER/batFINGER-blender-addons drop the folder sound_drivers into an addons folder. I've hardcoded in some scale_x and scale_y values on my interface to squeeze more info in. Nov 24, 2015 at 11:42

Please consider

[New Shape From Mix]

available from the Shape Keys panel. The menu below the plus + and minus -.

I suggest you use only the facilities of the shape key mechanism. Create a new shape key from some combination of two or more existing ones. This is a feature of shape keys that exists already.

When [Relative] is enabled the value [Value] can be animated. Influence or weight might have been a better name for discussion purposes.

If that does not provide enough flexibility or ease of expression you might consider creating another object001 which is not rendered. This object001 has has a simple property such as x-rotation that is used to control the influences of multiple shape keys. This paragraph is motivated by your comment below.

I believe you cannot put an arbitrary expression as a path.

• Ah, but you see... (and I should have mentioned this) this needs to animate. So creating a new shape key will not solve this. Nov 24, 2015 at 8:03
• Shape keys have weights which can be animated. Will that work to any degree? I am calling the Value on the panel under Relative ... the weight. Linear interpolation as one example. Nov 24, 2015 at 8:06
• Well the goal is to have a Shape Key that will react to the others when they are animated. For example, imagine there is a Shape Key for bass and another for treble, and then a third driven one that displays the averaged volume. So as the song plays, this averaging Shape Key is adjusting its position based on the waveforms of the bass and treble Shape Keys. I'm just picking a musical example because I think it's easy to imagine (my mesh uses other values, not musical waveforms). Nov 24, 2015 at 8:37
• See notes above please. Nov 24, 2015 at 8:58