Cache loading via animation system #69046

Open
opened 2019-08-22 12:03:58 +02:00 by Sybren A. Stüvel · 16 comments

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 (#51311).
  • Non-geometry, non-transform properties, if loaded at all, are loaded at import time, but after that are static (#54050, #50725). 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.

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 (#51311). - Non-geometry, non-transform properties, if loaded at all, are loaded at import time, but after that are static (#54050, #50725). This can be solved by having per-property F-curve modifiers ([D2324](https://archive.blender.org/developer/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.
Sybren A. Stüvel self-assigned this 2019-08-22 12:03:58 +02:00
Author
Member

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

Added subscriber: @mont29

Added subscriber: @mont29

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 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.
Author
Member

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.

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.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk

Added subscriber: @PixelTrader

Added subscriber: @PixelTrader

Added subscriber: @Josephbburg

Added subscriber: @Josephbburg

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.

> 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.

Added subscriber: @kevindietrich

Added subscriber: @kevindietrich

I just found out about this task/idea after trying to update D2324. One thing to note about D2324 (and any other potential system) is that the properties are read from a CacheFile whose evaluation is inside the dependency graph so we have to be able to set a relationship from the object (or ID) to the CacheFile. Now, D2324 does not work anymore for this very reason: there does not seem to be a way yet to set this dependency through the F-Curve Modifier's API (unless I missed something), therefore we do not have a valid CacheFile handle to read the data from because the object might be evaluated before the one for the CacheFile, and it is simply crashing.

I just found out about this task/idea after trying to update [D2324](https://archive.blender.org/developer/D2324). One thing to note about [D2324](https://archive.blender.org/developer/D2324) (and any other potential system) is that the properties are read from a CacheFile whose evaluation is inside the dependency graph so we have to be able to set a relationship from the object (or ID) to the CacheFile. Now, [D2324](https://archive.blender.org/developer/D2324) does not work anymore for this very reason: there does not seem to be a way yet to set this dependency through the F-Curve Modifier's API (unless I missed something), therefore we do not have a valid CacheFile handle to read the data from because the object might be evaluated before the one for the CacheFile, and it is simply crashing.
Author
Member

@kevindietrich Let's discuss that in D2324.

@kevindietrich Let's discuss that in [D2324](https://archive.blender.org/developer/D2324).

Added subscriber: @frameshift

Added subscriber: @frameshift

Added subscriber: @evantryan

Added subscriber: @evantryan

Added subscriber: @propersquid

Added subscriber: @propersquid

Sorry, I'm trying to wrap my head around this proposal. From my time working with Alembic, I found that there was essentially 3 cases that Alembic handled.

  • Shape data - Meshes, curves, and probably one or two others that I'm missing.
  • Required attributes - Attributes such as translate x/y/z, camera FOV, etc.

Custom attributes - Attributes such as ones on meshes that are driven by a rig and used to control shaders on the lighting asset.

If I understand correctly, this proposal handles both types of attributes, but I'm not sure how it will handle shape data.

Also, let me know if there's somewhere in the Alembic support improvements where I can lend a hand.

Sorry, I'm trying to wrap my head around this proposal. From my time working with Alembic, I found that there was essentially 3 cases that Alembic handled. - Shape data - Meshes, curves, and probably one or two others that I'm missing. - Required attributes - Attributes such as translate x/y/z, camera FOV, etc. # Custom attributes - Attributes such as ones on meshes that are driven by a rig and used to control shaders on the lighting asset. If I understand correctly, this proposal handles both types of attributes, but I'm not sure how it will handle shape data. Also, let me know if there's somewhere in the Alembic support improvements where I can lend a hand.

Note: This task might be superseded by #68933 (Collections for Import/Export)

Note: This task might be superseded by #68933 (Collections for Import/Export)
Philipp Oeser removed the
Interest
Animation & Rigging
label 2023-02-09 14:36:38 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
9 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#69046
No description provided.