Hi.
I’ve searched for similar subject for several hours, but sadly - no proper answer found. Maybe I’m not so good at searching stuff. In this case accept my apologies.
Anyway, I have following script here, which is trying to retrieve some animated property value over a number of frames
import bpy
C = bpy.context
D = bpy.data
C.scene.frame_current = C.scene.frame_start
while C.scene.frame_current <= C.scene.frame_end:
bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
print(D.masks[0].layers[0].splines[0].points[0].co)
C.scene.frame_current += 1
But even forcing redraw, which is not a good tone according to developer notes, does not giving a proper result. Every frame the value remains the same. Exactly what it was at a frame the script was executed on, to be specific.
A waaay back in a days i actually found a way to overcome this issue - creating a timer which puts script execution on hold, giving blender some time to redraw and update, but I still find this approach somehow clumsy, and I believe that there is a much more elegant way to solve this task.
Any ideas?