Why I can't get the object's location of every frame when rendering in blender 2.8?

I can’t get the correct PoseBone’s head value when playing animation in blender 2.8 with
context.active_object.pose.bones[0].head

#(some codes form my addos)
@persistent
def refresh_scene(scene):
    PoseBone=context.active_object.pose.bones[0]
    print("head==",PoseBone.matrix,PoseBone.head);#when rendering animation both pb.matrix and pb.head return ZERO
    

def register(): 
    bpy.app.handlers.frame_change_post.append(refresh_scene);

def unregister():
    bpy.app.handlers.frame_change_post.remove(refresh_scene); 
    
if (__name__ == "__main__"):
    register();

on the first frame and the second frame ,the posebone.head should has the different value.
but when rendering animation this value always return the first frame PoseBone.head’ value .it’s a bug or is there any way to get the other frame’s PoseBone.head value when rendering?
(by the way it ok with blender2.79 when playing and rendering return the same correct result)

I find that when rendering animation, the bones in the scene are not moving at all,
so I think this make it’s animated head value can’t be read.

anii
now I know why I can’t read the location of animated object in ervery frame ,because when rendering object stay stll. every frame I read an object’s location by script return the first frame value.

i’ve run into the exact same issue with a script i’ve made. did you ever find a workaround?

Running into the same issue myself, whether the property attempting to be read is a transform property or a custom property. While scrubbing the timeline, keyframed properties update fine, but during render, they stay fixed.

Am I missing something that’s changed from 2.79 to 2.80/81?

After 2.8, “frame_change_post” added “Depsgraph” parameter, and needs to get object information from Depsgraph.objects[xxx]. Note: “frame_change_pre” does not have Depsgraph