rich_lord Posted November 22, 2012 Share Posted November 22, 2012 Hello Everyone. I`ve got a load of groups, piece1, piece2, piece3......etc which each contain a set of primitives. Each primitive in each group holds an attribute which holds the size of all the primitives in that group when summed together. The groups have a random size of geometry in them right now, but what id like to do is order them, so the group piece1 holds the smallest and the highest numbered group the biggest Is there any way to do this? Quote Link to comment Share on other sites More sharing options...
Macha Posted November 22, 2012 Share Posted November 22, 2012 (edited) Could you turn the values into ints (multiplipy by a large number) and then in a foreach rename the group according to the attribute number? The sorting would then be implicit in the naming of the group. Edited November 22, 2012 by Macha Quote Link to comment Share on other sites More sharing options...
rich_lord Posted November 22, 2012 Author Share Posted November 22, 2012 Macha - thats a cool idea! Thanks. I was really hoping to get a sequential ordering though, and I don`t think this is going to give me that. I want to be able to match the group number with the point number of another object so I can copy stamp various sized objects onto it at precise locations. I thought group number would be a nice way to order these objects into their size order for that purpose. Quote Link to comment Share on other sites More sharing options...
michael Posted November 22, 2012 Share Posted November 22, 2012 maybe a second foreach? take the sorted groups piece1, piece4, piece5, piece7, piece12, piece18 then rename them again using the total number of groups ? Quote Link to comment Share on other sites More sharing options...
rich_lord Posted November 23, 2012 Author Share Posted November 23, 2012 Thank you both. A combination of those techniques worked a treat! Here's a piccie to show nice sorted rubble pieces, copy stamped by their size. Cheers so much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.