Array of meshes into a for_each outputs all the meshes as 1 combined mesh. How do I get them as individuals?

Array of meshes into a for_each outputs all the meshes as 1 combined mesh. How do I get them as individuals?

mcw0
Advisor Advisor
867 Views
2 Replies
Message 1 of 3

Array of meshes into a for_each outputs all the meshes as 1 combined mesh. How do I get them as individuals?

mcw0
Advisor
Advisor

Sorry my brain is not working.  I have an array of meshes going intoa for_each node.  The output of the for_each node says it's a single mesh.  But the outport of the for_each node says it's an array of meshes.  And I hooked up a dump_object to print out the size of that array and it matches my input array.  But I still only get one final outmesh that is a union of all the meshes from the for_each loop.  What am I missing to separate them?  Do I have to use a build_array?

 

BIF.PNG

The for_each "out_mesh" port says it's an array.  And the output "outMeshes" is a hat shape.  But I'm only getting 1 bif mesh.

 

forEach.PNG

0 Likes
Accepted solutions (1)
868 Views
2 Replies
Replies (2)
Message 2 of 3

mjcg91
Collaborator
Collaborator
Accepted solution

Always pay attention to the port icons, they say a lot about what happens. If you look inside your for_each loop, you can see that your output port is an iteration target, meaning that it's going to returns each results of the loop into an array.

For_each compound only have iteration target allowed for output because this node compute things in parallel. If you want to manually build an array inside a loop, like based on some conditions, You can use either iterate or do-while, and use a port-state.

Though, it's the problem here. When you say you get a single bif mesh, do you mean only one bifShape in the Maya scene? If so that's perfectly normal. Bifrost generates one bifShape per output port, wether it is an array or not. You can also convert your BifrostBoard graph to a BifrostShape graph (from 2.2.0.0), and won't have to deal with bifShapes anymore. Each sub meshes is still accessable, like when using BifrostGeoToMaya, you can get each sub meshes individually out of the port.

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
0 Likes
Message 3 of 3

mcw0
Advisor
Advisor

Hi Maxime, I have access to all the output meshes in the bifrostGeoToMaya node.  It must be getting too late and I didn't notice it the first time.  Thank you.

0 Likes