Page MenuHome

Cache loading via animation system
Open, NormalPublic

Description

Currently the Cache Sequence modifier is used for loading geometry data from Alembic files, and the Transform Cache constraint is used for loading transformation data. This approach poses a few limitations:

  • A modifier is either generative or deforming, whereas the Cache Sequence modifier is both (depending on the particular frame-to-frame changes in the Alembic file).
  • Non-mesh geometry data (like curves) are troublesome to load, as the modifier system can only produce an evaluated mesh (T51311).
  • Non-geometry, non-transform properties, if loaded at all, are loaded at import time, but after that are static (T54050, T50725). This can be solved by having per-property F-curve modifiers (D2324), but this is cumbersome and unintuitive to handle.

This task proposes a new approach, adding a 'cache' step to the AnimData struct. If set, cached data would be loaded by the animation system first, before applying F-curves and drivers as usual. This would allow the cache loader to influence properties in a more general way:

  • It's a new system, so no pre-existing separation between 'generative' and 'deforming'.
  • Any ID datablock that supports animation can use this, so no distinction between mesh and non-mesh geometry.
  • Any property can be animated.

I'll study the current animation system, and then update this task with more technical details on how to approach this.

Details

Type
Design

Event Timeline

I don’t even think you'd need to care about RNA here, it could work directly on DNA (unless we want to expose the 'cache reader' system to python, but I would not go that way tbh, we already do not want to allow python-defined modifiers, so...).

Thing is, unlike the rest of the animation system, you need nearly no user input for that, people just select a 'cache source' (probably some path?), the cache reader type, and everything else is handle automatically based on what's inside the cache.

I'm all in favour of keeping things simple, so I'll update the task description for this.

UI-wise I think it would be a good idea to show that a property is driven from a cache, in the same way that it's now shown that something is animated with an f-curve or a driver. I don't know how this happens currently, but I think that this would at least require some exposure to RNA.

UI-wise I think it would be a good idea to show that a property is driven from a cache, in the same way that it's now shown that something is animated with an f-curve or a driver.

From a user's perspective: Since the animation comes from a separate file, I think it would make sense if the UI for this was like linked data (greyed out), and overriding cache animation would look like overriding linked data (currently this is a shade of light blue). Maybe there should be something to visually distinguish which file-type is producing the animation data (blend or alembic, eventually vdb and usd, too), but maybe it's best to have it all look the same, to encourage hybrid pipelines. If abc and etc. look and feel like native Blender data (in the UI), it will be easy to convince people to adopt it into their pipeline, since they already use those other formats.

As an avid Python programmer, I'm curious about the costs and benefits of adding Python/RNA support to this proposed animation cache system. I can't think of any reason to do so.