Search - User list
Full Version: foreach connected breakout to own geo
Root » Technical Discussion » foreach connected breakout to own geo
9krausec
I'm curious at thoughts on best approach to do the following-

Take one lump of geometry with various poly islands. Run over reach like a foreach connected, output each connected chunk into it's own geo container via object merge, parent under the original geo container.

I can do most of what I'm fixing to do via HOM, but I'm getting caught on how to get multiple outputs from a for loop. If anyone here has ideas on best approaches, I'd appreciate to hear it.

Best,
Clayton

Here's a visual of what I'm looking to do (doesn't make sense, but helps with the understanding perhaps)-
jsmack
You don't need the for each. The object merge allows groups to be used to merge a part of an object. For example, your connectivity node creates an integer attribute, named ‘class’ by default. In your geo container that is parented to the composite geo, create an object merge with the expressions:
objpath1: `opinputpath('..',0)+'/OUT'`
group1: @class=`opdigits('..')`
xformtype: None

Then you can copy and paste the geo node for each island you want to break out, or use python to create the nodes based on the class attribute's number of unique values. Name the nodes with a number at the end, “part0”, “part1”, “part2”, etc for the opdigits expression to work correctly. Or if using python to create the nodes, fill in the actual value instead of the digits expression.

That's how I've done this in the past.
9krausec
Just got around back to this today. Thank you for the reply! Your explanation makes great sense and I didn't think of it in that way. Knowing this will make it possible to do what I was looking to do with HOM. Very handy!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB