Simulation Nodes: File Format for cached/baked simulation states #105251
Labels
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#105251
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
For simulation nodes (#103032) we need to store caches on disk. The task here is to define the file format and directory structure for the cache.
Requirements:
Considerations
There are three main options with their own pros and cons which are explained in more detail below.
.blend Files
The main benefit of using .blend files is that they could easily be opended in Blender and we already have code to serialize and deserialize e.g. meshes to this format. There are a couple of different ways this could work:
Currently, .blend files cannot store instances and volumes. Appending to an existing .blend files is likely very slow. The files also store way more than would be necessary for a simulation. It's hard to optimize reading and writing .blend files for the simulation cache use-case because of a lot of existing code surrounding the file format that needs to keep working. We'd likely have to do a fair amount of changes to make .blend files suitable for simulation cache that does not waste lots of memory and fullfills our performance expectations, making the whole code even more complex.
Common Interchange Formats
Another possibility is to use e.g. Alembic or USD to store the simulation state. The main benefit here is that the individual frames can be opened in Blender and also in other software. While it is of course important to be able to export the simulated data in these formats, for exporting the "raw geometry data" they are not necessarily the right solution. With other file formats we always have to consider out to map Blender data to these and back in a hopefully lossless way.
From what we've seen so far, these formats don't work well with compressing data over multiple frames. Also I heard that we ran into performance problems trying to read animations cached into alembic in real-time.
Using a common interchange format would make it impossible for us to change the format to better suit our needs if that becomes necessary.
Custom Format
With a custom format with have the most flexibility. Also it's likely simpler to do than any of the other approaches, because we wouldn't have to figure out how to fit all the data we want to store into those formats. Shared data over multiple frames can just be part of the format description. The main concern with this approach is that we have to maintain a new file format in the long term, hence it should be kept as simple and straight forward as possible. Another downside is that we have to write new code to serialize geometry data like a mesh. Luckily, not all data in a
Mesh
data-block has to be stored, and all the important data generally is stored in plain arrays already. Volumes would like still be stored as openvdb files.There are of course many ways to design a custom format given the requirements. Currently, I have the following in mind:
GeometrySet
).One issue that none of these formats automatically solve is how to deal with referenced id data blocks like materials. However, a fairly straight forward and likely good-enough option can be to store just the library and material name on disk.
Conclusion
While there are still details to be figured out when actually implementing this, using a custom format seems to be the best approach, so we will focus on that from now on.
Data blocks cannot be a simulation layer
Dalai Felinto referenced this issue2023-03-09 14:49:32 +01:00
Simulation Disk Cache Formatto Simulation Nodes: Disk Cache FormatSimulation Nodes: Disk Cache Formatto Simulation Nodes: File Format for cached/baked simulation statesUpdated the description.