[Bf-committers] Animating scene properties - getting to know the codebase

Joshua Leung aligorith at gmail.com
Mon Mar 13 05:20:43 CET 2017

Hi Alberto,

It's cool to see that you're interested in working on sequencer issues. We
could do with a few new sequencer devs :)

Before you get any deeper into these issues though, I need to point out a
few things here:
1) BKE_animsys_evaluate_all_animation()  is (or should only be) used for
the old depsgraph. The new depsgraph actually has proper nodes for
evaluating the animation on each datablock, so we don't need something like
this anymore. Therefore, at some point (maybe it's already done in the 2.8
branch) this stuff is going away.

This solves about half the problem (i.e. the part about
scheduling/triggering animation updates to run at the right times, for all
the time-remapping shenanigans involved with scene strips) here.

2) The other part of the problem is that since animation evaluation gets
applied directly onto the datablocks being animated, with something like
the sequencer's scene strips, you'll get problems where unkeyed values get
overwritten during the process of simply re-evaluating the strip (applying
all the anim there to make it correct, then recalculating the current scene
so that any things overwritten by the scene strip evaluation process gets
put back in place).

This second problem is basically being dealt with by the "overrides" work
in 2.8.

Between these two attack fronts, I think this bug (and a few similar ones)
should be able to be eliminated.


On Mon, Mar 13, 2017 at 11:13 AM, Alberto Mardegan <
mardy at users.sourceforge.net> wrote:

> Hi there!
>   I'm trying to fix https://developer.blender.org/T49658 (AKA
> https://developer.blender.org/T49261), which is the bug affecting the
> VSE when you insert a scene strip and its property animations get
> executed with the wrong time.
> I have a few questions, which I couldn't get answered by just studying
> the code:
> 1) In source/blender/blenkernel/intern/anim_sys.c, at the end of the
> BKE_animsys_evaluate_all_animation() function there's a loop which goes
> through all the scenes and animates their properties:
> https://git.blender.org/gitweb/gitweb.cgi/blender.git/
> blob/HEAD:/source/blender/blenkernel/intern/anim_sys.c#l2903
> Why is this done (as opposed to just animate the current scene)? Is it
> in order to support the feature of using scenes in the VSE, or are there
> also other cases?
> 2) In the function mentioned above, I need to keep track of the scenes
> I've already animated (you can have a look at
> https://developer.blender.org/D2558 to see what I'm doing) in order not
> to animate their properties twice. What's the best way to do that? Right
> now I'm using a linked list on the stack, but maybe it could be better
> to add a flag to the Scene or AnimData structure instead?
> 3) Am I right if I say that if the project has multiple scenes, the
> BKE_animsys_evaluate_all_animation() function is likely to perform a lot
> of useless computations? I mean, if a scene other than the current one
> contains a lot of meshes with animations, and this scene is not used in
> the VSE, all these animations are computed for no reason.
> 4) It seems that all meshes, lights, and all animatable things are
> stored as linked lists in the Main class. Why aren't they referenced in
> the Scene class (instead / as well)?
> What's the way to find all animatable things present in a scene? Or
> conversely, if I have a mesh, how can I tell in which scene it's being
> used?
> Last but not least: long live the VSE! :-)
> Ciao,
>   Alberto
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> https://lists.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list