Community
Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bifrost Graph Editor Question: Write/Read Object Files (Read and Render) - Need help

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
Polytikal1
395 Views, 12 Replies

Bifrost Graph Editor Question: Write/Read Object Files (Read and Render) - Need help

Hello Everyone! I have been working on some pretty data heavy simulations, and thought it would be safest to cache to .bob files. I'm very confused on how to read and leverage these 200GB file series now. I have tried to create a new graph and to use the file cache node and "read" nodes to pull in the objects, and it doesn't seem to be working. In one case, I saw a spherical mesh without any of the textures or layered fluid simulations on top. What am I doing wrong? I've searched for answers on google and tutorials, but it's not clearly spelled out. Is there a comprehensive document on how to cache, write/read, integrate, and overall manage bifrost object files? I'd hate to have lost a week worth of time just for the caching period for these multiple simulation objects. 

12 REPLIES 12
Message 2 of 13
Polytikal1
in reply to: Polytikal1

Note: when I use the read node for .bob files on a new bifrost graph, it doesn't load textures or simulation. When I use the read file cache mode on the file cache node within the same bifrost graph of the simulation, the frame transition are as slow as when the object was being created, so I can't tell if it worked since viewport freezes. It's a heavy simulation. 

Message 3 of 13
Polytikal1
in reply to: Polytikal1

It turns out that all my bifrost objects are all ending up without textures when reading from cache file... What am I doing wrong?

Message 4 of 13
andimation1
in reply to: Polytikal1

Hi not sure if I can help you out but maybe can you provide any more information like a screenshot of how your graph is laid out maybe for easier troubleshooting?

 

I did have a quick go of caching a simple plane with a lambert material assigned and for me the material reference was lost in the cache like you've said. The cache doesnt seem to keep the material_reference_id string.

See my screenshots left is before cache right is after. You can see the bottom line is missing lamber2 in the object dump.

Screenshot 2023-01-08 110428.jpgScreenshot 2023-01-08 110435.jpg

 

In terms of workflow for me personally I've usually assigned materials after caching. I would simulate and get all the raw data cached and then apply any materials or any post processing manipulation to the data afterwards for an easier workflow.

Message 5 of 13
Polytikal1
in reply to: Polytikal1

Thank you! Is there a sample workflow for how to add materials afterwards? I've tried to variations of workflow, and neither produce the expected simulation. This is the simplest graph of all the sims I've worked on, but perhaps I am confused about placement of materials or terminals? Thank you for helping! 

Message 6 of 13
Polytikal1
in reply to: Polytikal1

Screenshot 2023-01-08 080458.png

Screenshot 2023-01-08 082754.png

Screenshot 2023-01-08 082512.png

Screenshot 2023-01-08 082419.png

Screenshot 2023-01-08 082323.png

    I'm tempted to send all versions but the variations across projects that I've spiraled into is adjusting the assign materials location, or removing it altogether in instances when the object was assigned a material, so duplication of material assignment in bifrost graph leads to anomalous displacement deformations on the object. I've seen material assignment across tutorials attached to objects pre- and post- cache node, and pre- and post terminal... If I can salvage the simulation by adding post, then I'd love to know how, but if you see any flags in the workflow shared, or problems with my understanding of materials assignment logic, then please let me know. Hard to debug the problem when it's taken so long for a cache and then you end up with a greyed-out sim/objects.

Message 7 of 13
andimation1
in reply to: Polytikal1

Hey there,

Thanks for doing those screenshots. Some of your terminals are reading before your file cache, so the graph might still be calculating whats behind your cache making it as slow. Just as a precaution could try turn them off after caching.

 

Another thing is baking instances to geometry would slow things down a lot especially if it's a lot of instances which are heavy geo. Is there a reason you need to convert them from instances? The instances or geometry do hold the material if assigned in Maya or in the graph but I am also having you issue of the BOB file cache not holding that data. Perhaps someone else on here has an answer to that one?

It's a huge infection type sim, then you could cache the points being instanced to. Then do your instancing or copying to points, then have a secondary cache of your baked instances, however even in my simple example the baked geometry really slows it down compared to instances. Then assign your materials afterwards since the cache isn't holding that for some reason, I don't see why it shouldn't. But here is an example of baked geo, still runs slow for me.

Screenshot 2023-01-08 225108.jpg

 

Heres a example of just the instances, no need to cache the instances since they run really fast compared to the above.

Screenshot 2023-01-08 225602.jpg

 

For the assigning materials for the aero, I would definitely do that after the cache anyway in case you want to change the material after the fact and don't want to simulate again. You probably know this one but if using the aiStandardVolume you can use voxel_fog_density for the density channel as that's what aero uses. In case thats why its not working. Here is an example for the aero.

 

Screenshot 2023-01-08 223610.jpg

Screenshot 2023-01-08 225654.jpg

 

Anyway I hope something of that is helpful. I'm afraid the bob cache not holding the assigned material looks to be an issue for me as well so maybe there is someone else here who can say why that is happening?

 

Cheers

 

 

Message 8 of 13
Polytikal1
in reply to: Polytikal1

I'm noticing in the print dump "(bool) false" for cache_hit ... is that an issue as well?

Message 9 of 13
Polytikal1
in reply to: andimation1

Thank you so much! I've been at this for weeks. Kind of trial by error, and may have missed some of the fundamentals. I will apply the materials post cache as you've suggested to see if that works, and the caching strategy. I hope that the mega folders of data I have will show some solid simulations, given that the time was already placed in. I'll turn off the terminals as you suggested. In regards to the aero simulation, I did use the references within the sample scenes, so the voxel_fog_density channel is there... The instancing strategy could certainly make it slow...I've been trying to create a something that can be pulled out and converted to a fluid outside of bifrost, but perhaps that's not the right approach here... 

Message 10 of 13
Polytikal1
in reply to: Polytikal1

When you apply "get_from_array", what values are you applying to index? I have been receiving warning messages that the input is not an object on several occasions, but I don't know if that's workflow related, or missing a value input somewehre..

Message 11 of 13
Polytikal1
in reply to: Polytikal1

FINAL QUESTION (in addition to last): When applying materials post cache, if that can only be done per one object, am I then forced to cache each object with a material prior to caching the whole simulation? If so, then I'll have to redo all the sims in order to have all the materials represented on the objects within the scene. 

Message 12 of 13
andimation1
in reply to: Polytikal1

Hey,

Not sure about the cache hit in the object dump. I'm assuming it's something to do with it coming from a cached object.

 

Oh you are instancing objects in order to mesh the points? There are meshing methods instead of using instances. You could convert the points to a volume and then convert the volume to a mesh for example.

 

Get from array does exactly what it implies. It will get from an array at an index. In my screenshots you can see I'm getting index 0 and index 1. As I fed 2 objects into the cache I get an array of 2 objects out. If I feed just 1 object in I will get an array of 1. Meaning index 0 will be the only object in the array. If you plug an object array to an output and put a watch point it will give you a number showing you how big the array is.

 

You could cache all objects and you would get an array of objects and apply your materials to each object in the array post cache if you want, like I described above. There's no one way to do things I'm afraid, whatever works for you. It's hard to give you any specifics without know the full scope of what you are trying to achieve. But no you don't have to apply a material prior to caching unless maybe the material is part of the simulation which I'm assuming it isn't.

 

 

 

 

Message 13 of 13
Polytikal1
in reply to: Polytikal1

You've just saved me on one sim. I used the infection effect and instances to build geo on a planet sphere, but couldn't get aero to work well by reapplying that strategy and connecting aero sim. The points to volume made it look ten times better. I used print_array to identify indices and had forgotten to apply integer value, so some time lost but you've helped me a lot here. Now that I'm this far, I will spend the next week trying to actually pull all this together in into an animation... With all the bifrost files that I have, any recommended tutorials on how to read and output all the frames of sim and animate. Does this require that export alembic and vdb to take it to the next level? Just jumped headfirst into bifrost graph, so it's been a rapid trial by error scavenging through tutorials (some a bit too old). 

 

Also, by animating materials, would that apply to a cloth and texture deforming during the scene? I'm not doing that, but just curious as to whether that would the exception you were alluding to...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums