Multiple character meshes using same shapekey names, how identify key ID of active mesh?

Hi, I’m trying to control character expression shapekeys using X-Pose Picker. All of my characters have shapekeys with some identical names like “Smile”, “Sad”, “Anger” etc. I’ve created a tab in X-pose picker where I can quickly change the value of these keys without having to exit pose mode to access object data properties.

Currently, if there is only one character loaded into the scene, these scripted expression buttons have no problem changing the shapekey. Once another character is added,[“Key”] adds a randomly assigned number to specify which Key.[“Key.009”].

So the following scenario will happen:
Char1 =[“Key.009”]
Char3 =[“Key.004”]

How can I script to retrieve the current active mesh key?

Not familiar with this addon thingy, but the current active object is

you can also get the currently selected objects as a collection from


1 Like

Thanks jaxtraw. I’ve tried bpy.context.selected_objects but don’t see a way to find the key ID through this. What I’m trying to accomplish isn’t related to the x-pose picker plugin.

When I select a character and change a shapekey, there’s a number following the key.


One character just says “Key” while the other character says “Key.009”.

Since the shape keys control expression and all characters share the same expressions, I wan’t to script buttons that target the current character and change the value of that shapekey by some amount.

Well I may be missing something here, apologies if so, but don’t you want the shape keys collection from the Active Object rather than the whole scene’s shape keys? That would be


so, like[‘Smile_HD’]

is this any help?

1 Like

You responded just as I finally got to it with the following. Thanks so much for your time and help![“Smile”].value=0

1 Like

And thanks for responding rather than just abandoning the thread :slight_smile:

1 Like