I tried to use frame_change_pre to animate my scene in a fully python generated way ( No keyFrame ). The scene worked fine in viewport but stood still in render.
So I went for the onion strategy : I striped my file of the most complicated objects and python function. The result is the following minimal file ... that still has the same problem. Here is the Python code :
def frame_handler(scene, depsgraph):
frame = scene.frame_current
M = scene.objects["M"]
current_world = scene.world
x = current_world["x"]
M.location = (x,x,x)
print(str(x))
# Event Listener Frame Change
bpy.app.handlers.frame_change_pre.clear()
bpy.app.handlers.frame_change_pre.append(frame_handler)
Edit : As I said in the comments, the problem comes from x = current_world["x"] Accessing this custom variable during render is the problem. If I change it with x = frame/30 ... I get the motion ...
Any idea to solve this would be welcome and would let me add back a few onion layers ... T H A N K S.
bpy.app.handlers.render_pre
orbpy.app.handlers.animation_playback_pre
? $\endgroup$