Page MenuHome

Can't read existsing Smoke cache
Closed, ResolvedPublic

Description

--- Operating System, Graphics card ---
Window 7 x64 8Gb
nVidia gtx460 1Gb

--- Blender version with error, and version that worked ---
2.67

--- Short description of error ---
I have two scenes. One is called smoke_domain_writer and the other is called smoke_domain_reader.
I want to generate a smoke cache in one BLEND file and then read that data and use it in another.
I assumed that is what the External checkbox is for in the Smoke Cache panel for the Domain.

--- Steps for others to reproduce the error (preferably based on attached .blend file) ---
Open up the attached BLEND smoke_domain_writer and click the Bake button. Wait for the cache to be generate then close that file.
Open up the attached BLEND smoke_domain_reader and browse to the folder where the smoke cache was just generated.
Click Play and nothing happens.

It would be nice if the smoke cache worked like the fluid cache and you could browse to existing data to display it in other files or scenes.

Is Blender supposed to be able to read it's own Smoke cache?

Event Timeline

Miika, could you please check on this?

if your cache files have a name like 536D6F6B6520446F6D61696E_000001_00.bphys , the _000001 is the frame number... and the name is 536D6F6B6520446F6D61696E, so enter 536D6F6B6520446F6D61696E into the file name part once the file path is set up and it should recognize it.

bit fiddly but it works

Hey,

I just started debugging this and immediately noticed that you have two slashes in front of the cache filename ("//smoke_test"). Naturally slashes are not allowed in file names so it fails there. When I changed cache name to "smoke_test" without slashes, it started to work.

Can you verify if this "fixes" it for you too?

You suggested solution does not seem to work for me on Windows 7 64bit.

I pulled down the two attached files to my desktop and opened up the smoke domain writer and removed the two slashes as you suggest. I clicked the bake button and I did get a smoke cache created on my desktop. It plays back fine in the writer.

The problem is in the reader. Even if I remove the slashes from the reader filename I still get "No valid data to read."

Can you post your working version of the reader for us to verify?

Thanks for looking into this.

Writer.blend seems to have two domains, so the one you need to change is that external one (domain_reuse). Then I saved both files with "correct" cache file names, baked the writer and reader seemed to work fine.

Or wait... Actually it does indeed use the "domain_bake" object cache. :)

What seems to be the key here, is to reload the reader file after changing the file name. If I just change it I get "no valid data to read". But after save + reload it loads fine.

Confirmed success!
You are correct, if I remove the // from the file name it does not work.
If I remove the // from the file name, save and reload, it does work.

My guess there is still a bug in there, however. It seems to me what is happening is that when the smoke cache read tries to open a file and fails (file not exist), it fails to close that file and thus all subsequent attempts to read from a new file name are moot because of a hung file handle.

It would be nice if you could change the file name without having to close and re-open blender. This way scripts could, in theory, change the cache to point to a new file on a frame_change event.

Good point, I will investigate that name change issue tomorrow. It likely affects all Blender tools that use point cache (external) so better get it fixed.

Committed a fix in r58830. I'm closing this now, but feel free to reopen if you find another related issue.

Miika Hamalainen (miikah) changed the task status from Unknown Status to Resolved.Aug 2 2013, 6:42 PM