I would have imagined that frame_change_pre
is the event that happens, well, before the frame changes. Silly me!
The documentation states (emphasis mine):
Called after frame change for playback and rendering, before any data is evaluated for the new frame. This makes it possible to change data and relations (for example swap an object to another mesh) for the new frame. Note that this handler is not to be used as ‘before the frame changes’ event. The dependency graph is not available in this handler, as data and relations may have been altered and the dependency graph has not yet been updated for that.
I'm joking a little bit here but it's a serious question. How am I supposed to think about the event? It says that I can change relations and (rather vaguely) data, and that I can't depend on the dependency graph, but what sorts of things is that trying to tell me that I can't do? I would think that most things I'd want to do before a frame change would be to change data but the warning's got me spooked.
How should I think of it if not that event that happens pre-frame change?
depsgraph
is only available (not none) for post events. The first script here makes a set of dummy handlers to print to console when they are fired. blender.stackexchange.com/a/62870/15543 (remove startswith clause to get a full set. Be wary depsgraph update will fire a lot) The depsgraph is used (among other things) to obtain the modified data blender.stackexchange.com/questions/146559/… $\endgroup$frame_change_pre
andpost
Making pre after frame change, pre depsgraph update. $\endgroup$scene_update
handler was fired a lot, the depsgraph update a lot less. $\endgroup$