[Addon proposal] Add automated driver link for "custom properties" <> "shapekeys"

I am a coder, but no python coder and I have no idea how the Blender API works. However, over in the animation&rigging room we found a deficiency one of you could easily remove :slight_smile:

Imagine you have a face for instance with a wide variety of shapekeys. Now you want to control them with custom properties where you might have added other properties like IK/FK switches display/hide control elements and so on.
At the moment you got to wire them manually via drivers which can become quite cumbersome and wastes quite some time. Ideally would be to work with nodes, but that´s another story.

So the basic idea is:

You´ll have a button in the shapekey panel that allows to add a “custom property driver link” and/or a rightclick menu entry.
For better understanding I play 2 usecases:

Usecase 1: Custom Property for blink
You create your blink shapekey and name it.
You click the new button.
A dialog comes up, it let´s you choose either an existing custom property of the object or create a new one.
It let´s you choose the attribution of the property to the shapekey. 100%
It let´s you choose a range for the property and maps it to the 0-1 range of the shapekey.
You choose the shapekey you want to drive.
The script creates the driver and you got a working custom property in your property panel to drive the shapekey.
Ideally you should be able to rightclick the shapekey and bring the dialog up as well, with the selected shapekey already in the dialog, else if you have 100 shapekeys for a face for instance you got to browse through all of them.

Usecase 2: Property for a face that was is laughing in tears, so a mix of sad and happy, maybe a bit pain.
Either select the 3 shapekeys (happy, sad, pain) and rightclick and the 3 keys are already in the list, or click the button to bring the dialog up.
You choose the custom property in the dialog if there is an existing one, or create a new one.
Next you can choose the shapekeys if they are not already in the list and choose the attribution of the driver. Something like this:

property: happy_in_tears
range: 0-100 (mapped to 0-1 of the shapekey)
shapekey 1: happy: 50%
shapekey 2: sad : 30%
shapekey 3: pain: 20%

Once you click apply, it creates the drivers to drive all those shapkeys. Happy with 0.5val, 0.3val …

I think it is not a too complicated addon and would be a great addition to make animation a tad more comfortable.
So if any idealess python hacker or someone looking for a first project wants to jump on it, it´d be great.

Arexma - you can do away with the drivers entirely. Have a look at the “update” attribute of the property types. This lets you pass a function that gets called whenever a custom property changes and in that function you can set shapekeys or other parameters using python. It’s not so user-friendly since you have to program but it’s much more general.

I am sorry I don´t understand what you mean.