Geometry Nodes: support packing bakes into .blend files #124230
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#124230
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "JacquesLucke/blender:bake-packed"
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?
Previously, it was only possible to bake to disk with geometry nodes. This patch adds support for storing the baked data directly in the .blend file.
By default, new bakes are stored in the .blend file now. Whether a new bake should be packed or stored on disk can be configured in two places: in the properties of the bake node and in the bake panel of the modifier. These settings don't affect existing bakes, only the next bake.
To unpack or pack an individual bake, there is a new operator button next to the bake button. The icon and the label below indicate where the bake is currently stored. The label now also contains the size of the bake.
To unpack or pack all bakes, the
File > External Data > Pack Resources / Unpack Resources
operators can be used. The unpack operator also has a new title that mentions the number if individual files separate from the number of bakes. This works better than just listing a number of files because a bake can consist of many files.@blender-bot build
WIP: Geometry Nodes: support packing bakes into .blend filesto Geometry Nodes: support packing bakes into .blend filesHey,
For the modifiers you call it "apply modifier", and here you call it "bake".
Is there any difference between the two? is there a reason you call it "bake" and not "apply"?
Does this mean that in the future you will change all modifiers to "bake modifier" instead of "apply modifier"?
Applying a modifier and baking a node are two fairly different thing. Applying the modifier removes the modifier and changes the underlying object geometry (i.e. you can go into edit mode and change the applied geometry). Baking just (temporarily) stores an intermediate result so that it does not have to be recomputed all the time.
There is no plan to do anything like that currently.
Some questions out of curiosity (you don't have to answer).
Why do modifiers act like that?
Why does it remove the modifier completely when you apply it?
Why do you need to apply them first (what does "apply" even do in concept)?
Why can't you edit them at any time?
If you bake a the whole geo node can you edit it (meaning if you put a bake node at the end)? if not why not?
This will be really useful to encapsulate simulated data as part of assets and seems to work great in terms of core functionality from my testing so far.
I do have some comments on UI/UX level. A lot of this is probably not really related to this PR specifically and pretty unsorted and incomplete for now, sorry about that.
Initial impressions/feedback:
Custom Path
or change the path itself and end up not reading the bake data back on next reload, while you don't see anything breaking immediately.Packed
the path should be greyed out and probably even uneditable. If there are any previous bakes that are still using that path it still shouldn't be edited anyways while the modifier target is set toPacked
We talked about that before. This is already implemented but I understand that it's not very obvious. The pack/unpack icon next to the bake button changes based on the setting in the modifier.
Yeah, I can create a separate PR for that after this patch. With some luck, it's fairly straight forward.
Well, it's tricky because there are also good reasons for being able to change the settings while there is still baked data:
I'm not sure how doable that is yet, but it may be possible to show some kind of warning when the bake settings are modified while it's in a baked state.
Also potentially tricky, because there may be individual bakes that do not inherit from the modifier.
Sounds reasonable.
Hm, not totally sure what you mean. How do you loose the bake path?
I mean, I did notice that, but especially with the button being greyed out this is not enough imo. After baking you see the state explicitly as well, not only in the icon.
Ah, I see... right...
Oh sorry, looks like I didn't finish typing the sentence. I'm not sure anymore what exactly I did, but I believe it was about removing or changing the modifier bake path after baking to disk.
I'm starting to wonder if it would make sense to explicitly split the bake target path for writing and the actual bake path for reading per bake, so that the actual path cannot get lost, by being defined implicitly.
Do you have a suggestion for how that should be displayed?
When unpacking an existing packed bake to disk (
bpy.ops.object.geometry_node_bake_unpack_single()
), there should probably be the same dialog that you get from doing the same with image data-blocks.Also, when doing that, I think it would make sense to change
Inherit from Modifier
to 'Disk' alongside writing to the custom path. Otherwise re-baking will change the target again and it seems more consistent to me.Maybe the button itself could just say
Bake Packed
orBake to Disk
to make it clear what will happen?About this point:
Wouldn't it make sense to gray out the path and custom path toggle in this specific case?
Reading through the whole PR, only saw two things that stuck out to me.
And in basic tests this definitely speeds up the process of opening Blender and using simulation nodes.
@ -251,1 +251,4 @@
constexpr bool contains(const IndexRange range) const
{
if (range.is_empty()) {
Not sure about this, it seems more obvious for the
start_
should be checked regardless of the size.Currently, I think that the start value shouldn't have any meaning. Any empty index range should be considered to be equal.
range.intersect(other).is_empty()
@ -327,0 +393,4 @@
if (data_size == 0) {
continue;
}
void *data = MEM_mallocN(data_size, __func__);
Seems like the packed file's implicit sharing should be used to avoid copying/freeing the data from the string. After this operation the implicit sharing info in the packed file should own the string.
When baking to disk, before the blend file is saved, it will bake as packed regardless.
I think that is generally fine, but there is not feedback at all right now.
When an absolute path is provided, I don't even think there is a need to pack it though, it could just work in that case.
Imo there should either be a popup informing the user that the file needs to be saved first to bake to a relative path, with the option to bake packed or at least there should be an info message after the fact.
Looks good now!
Didn't find an issue with it anymore. The more features we add to baking though, the more it becomes obvious that we're missing the top level overview of bakes in the scene. Besides that, I think, now there is a pretty intuitive insight for the bake target.
I do feel like it might make sense in the future to differentiate bake target path and existing bake location before and after bake as 2 separate paths. But that topic is a bit separate and can still be done in the future.
As a side-note. The Custom Range settings should probably be grayed out in the bake node for
Still
mode, in a separate PR.