2
$\begingroup$

Say, I have an object with multiple shapekeys on it.

Unchecking "relative" option gives me "evaluation time" parameter. And the last shapekey has exact maximum value of the "evaluation time" parameter

How can I get this maximum value via python? (screenshot

$\endgroup$

1 Answer 1

1
$\begingroup$

If the keys are absolute, rather than relative, they are maintained in sorted order, by time frame. If you want to find the last key from the active object, use

bpy.context.active_object.data.shape_keys.key_blocks[-1]

to access the last shape key in the sequence. It will be the one with the maximum value. The field that contains the values is frame, so the maximum value will be found as

bpy.context.active_object.data.shape_keys.key_blocks[-1].frame

Obviously, you can replace bpy.context.active_object by whatever object you want to find the value for.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .