Assemble: control how many pieces? {[SOLVED]}

   560   3   0
User Avatar
Member
1010 posts
Joined: April 2017
Offline
Let's say my unpacked geometry contains 5000 pieces. Is there a way I can control the Assemble sop so it creates only 2 packed primitives?

In a primitive wrangle, I used:

i@class = 0;
if(@primnum > 2500)
    {
    @class = 1;
    }
//to have only 2 class values possible

...and in the Assemble after it, I checked the Piece Attribute and used "class" but it doesnt work...

-Olivier
Edited by olivierth - Nov. 24, 2023 14:02:45
User Avatar
Member
83 posts
Joined: June 2020
Offline
Is each "piece" a single prim? If not you don't want to use @primnum.
I would use a connectivity sop to give each connected piece a unique attrib first, then you can do:

i@class = 0;
if(i@attrib > 2500) i@class = 1;
User Avatar
Member
1010 posts
Joined: April 2017
Offline
That would not work because the Assembly is where it's not working.

I ended up not using a for-each loop with a Pack sop to do the trick.
User Avatar
Member
83 posts
Joined: June 2020
Offline
Sorry I thought Assemble took a piece attribute, that's what I get for trying to help from memory. You shouldn't need a loop though. Give half of your pieces one name and the other half another name and the pack sop should do what you want.
  • Quick Links