Fix #68436: External Particle Disk Cache Playback Is Broken #117291
No reviewers
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#117291
Loading…
Reference in New Issue
No description provided.
Delete Branch "lichtwerk/blender:68436"
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?
This has been broken since 2.8.
The highlevel reason for this is that the "info file" (saved as frame
zero) was not written anymore.
Reason for that in turn is that when calling
BKE_ptcache_write
outsidethe bake job, the
PTCacheID
calldata
(a psys in our case) is not theevaluated particle system, causing a check for
totpoint
to fail (thesewere always zero).
Deeper reasoning is unclear, no further investigations were done as to
why/when this happened.
The solution proposed here is using the evaluated psys when writing the
info frame (and this is isolated to just this spot). File then gets
written and can/will be read when using this as an external disk cache
in another file.
I am aware that this is EOL, but this has been reported so often...
Maybe (just maybe?) this clicks with @Sergey ?
It does seem that write needs to happen from the evaluated state. And it also doesn't seem that we can pre-calculate pid of from the evlauated object earlier on, as it potentially might change (if
psys
is re-allocated as part of dependency graph evaluation and its copy-on-wtite thing).I can not think of a better solution than what you did for querying the evaluated pid before writing.
See an inlined comment about some variable use, which needs to be corrected. Should be simple though!
@ -3389,0 +3395,4 @@
Object *ob = (GS(id->name) == ID_OB) ? (Object *)id : nullptr;
ParticleSystem *psys = static_cast<ParticleSystem *>(pid->calldata);
ParticleSystem *psys_eval = psys_eval_get(baker->depsgraph, ob, psys);
BKE_ptcache_id_from_particles(pid, ob, psys_eval);
Original and evaluated pointers shouldn't be mixed without explicit comment why it is unavoidable. This should become
BKE_ptcache_id_from_particles(pid_eval, ob_eval, psys_eval);
Also note that we shouldn't override the content of the
pid
, but get its evaluated counterpart to a separate variable. Otherwise the second iteration of this loop will access the previously modifiedpid
state.Think it is fine now. Would be lovely if you tweak the cast style before land. Can happen without extra review iteration.
@ -3358,2 +3361,3 @@
if (cache->flag & PTCACHE_DISK_CACHE) {
BKE_ptcache_write(pid, 0);
ID *id = pid->owner_id;
Object *ob = (GS(id->name) == ID_OB) ? (Object *)id : nullptr;
Do not mix C and C++ style of casting, use the C++ one:
Object *ob = (GS(id->name) == ID_OB) ? reinterpret_cast<Object *>(id) : nullptr;