I would like to set active shape key using Python. I know that I can use following code for this purpose:
bpy.context.active_object.active_shape_key_index = some_index
but, when I have several shape keys, then I don't know how to get this index from given shape key:
sh_key = bpy.context.active_object.data.shape_keys.key_blocks["shape_key_name"]
There is no attribute called index
in object sh_key
. I tried to use bpy.context.active_object.active_shape_key
, but this attribute is read only. Thanks for your help.