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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

For Each 'Component'?

Message 1 of 10
396 Views, 9 Replies

For Each 'Component'?

Hi everyone, I recently re-watched: Bifrost Visual Programming Masterclass - Part 1 of 2 - YouTube


One question: @ 9 mins where the author is connecting the 'for each' node, I see 'points' and 'faces' can be evaluated. is there a way to perform a 'for each' per 'component' (like say, for an object that contains fragments/sets of "detached" polys, but is still one single mesh)? 


My end goal would be to do what is done in this tutorial, but to have "chunks of geo" driven by the averaged particles instead of simply detaching all the faces of the object (a bit like packed prims...). I hope that makes sense, apologies if this has been covered elsewhere, thanks in advance for any insight!



Message 2 of 10
in reply to: julie.rothfarb

Not sure if I follow something like this?  There is a compound on the rebel package called "compute_centroid_from_points" 





Message 3 of 10
in reply to: sepu6

That looks very promising. I'll try this as soon as I out as soon as I can tomorrow and follow up.


Thanks in advance!

Message 4 of 10

Quick follow up question when you have a moment:



-I added a sphere and detached groups of polygons (tested this by moving polys away from the other polys)

-Middle click dragged this sphere into BF graph and did my best to recreate what I saw in your flow

-Noticed My Mesh isn't showing the sphere as an array, and that the next nodes are expecting an array...


As expected I get: 


// Error: Error: while compiling top level compound 'bifrostGraph_DetachSphereShape', around the node 'bifrostGraph_DetachSphereShape::get_from_array':
The input of 'get_from_array' must be an array. It is currently 'Amino::Object' /



1) Are you doing something special to your geo to get an array output? (I tried manually changing the port type, but I only got error messages).

2) I notice you've made your "compute_centroid_from_points" node editable/imported, are you doing anything special with it apart from renaming inputs?


Thank you for taking the time, it means a lot! I see lots of BF tuts on particles but not as many on dealing with meshes like this. 


Message 5 of 10
in reply to: julie.rothfarb

1. did you grab all of the meshes and drop them into BF?
2. I did my own get centroid but right after I realized that the rebel package had one which is doing the same thing. 




Message 6 of 10

I see where I was thinking differently. 🙂

When I extract the my sets of detached polys into separate objects and group them (as you did) it work perfectly, thank you! I'm also glad to see that UVs come across.


What I wasn't explaining well (I should've included a cap of my outliner) is I'm hoping to keep my detached polys within the original object. I'd like to traverse through each of those components (computing their centroids, etc) in place of doing all the faces as the original tutorial had done.


Any thoughts on how to evaluate those detached components/elements in a single object? Either way thank you for the pointers on this, super beneficial!

Message 7 of 10
in reply to: julie.rothfarb

Can you share a .hip file of what would you do in H, so I can see it and check what you want to accomplish in BF? 

Message 8 of 10

Hi Sep6,


Thank you so much for your help and reply. At some point in the future I'll try to assemble a quick node flow in H with packed prims (likely won't be for awhile, things are super busy at work). 


Essentially I want to be able to make the forEach work not for every face in a mesh but for all the "detached" polygon elements contained within a single mesh. 


Very much appreciate your time, for anyone looking to accomplish this with a group of objects you're response here will surely be a lifeline. I'm going to leave it open for the time being in case one of us has a brainstorm and we can nail this down.


Thank you!  

Message 9 of 10

I'd do it with a property, so if faces are detached, their "detached" property would become 1, else 0.  (You'd need to make the custom property), then you could traverse by that.  You'd probably be looking at a port feedback system though, so maybe I just made it more complex than it needs to be?  But with a custom property you could perform a check for that in a bool array (find all in bool).  Hope this makes sense

Jason Brown
Software Developer, Bifrost
Message 10 of 10

Hi Jason, thank you so much for the reply, I'll try to reply back with a few particular follow up questions in the coming days after I see what I can find about each of those items.


(I'm fairly new to BF but used VS in H and UE so those concepts sound to me like the right general ideas).

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

Post to forums  

Autodesk Design & Make Report