Can someone help me debug this? (or let me know that yes, I have found a bug)
In the console if I ask for a shape key’s value, it gives me the correct value based on which frame I’m on, but if I do the same thing in a while loop seeking through the frames, it always returns the same value. Weird. For instance:
In the console:
>>> Eyes = bpy.data.objects['Plane'].data.shape_keys.key_blocks['eyes']
>>> Eyes.value
0.41718316078186035
>>> bpy.ops.anim.change_frame(frame=5)
{'FINISHED'}
>>> Eyes.value
0.3277439475059509
That works, but if I write:
while i < LastFrame:
i=i+1
bpy.ops.anim.change_frame(frame=i)
print(Eyes.value)
This just spits out a sequence of repeating, equal, values.
(Also as usual, am I just working wrong? What I really want is to be able to select all the shape key values, query max and min, then scale to normalize, but, y’know, Documentation…