PDA

View Full Version : Sorting objects by poly count with Xpresso


jackb602
10-22-2009, 07:29 PM
I'm trying to create an Xpresso expression tag that will:


Iterate through every object in a scene
For each polygon object, get the polygon count
Append the polygon count for each object to its name (i.e. "Chair" becomes "02485 Chair")
Arrange the objects in the object manager from highest to lowest polygon count


I plan to iterate through every object in the scene using a hierarchy node. Is there a way for Xpresso to check what type of object it is dealing with? For example, getting the polygon count of a Null Object returns an error.

Another question I have is how to force a number or string to include leading zeros. A simple cube with six polys for example, should be renamed "00006 Cube" or something similar.

Finally, can Xpresso be used to rearrange objects in the object manager? The easiest solution would be to sort the objects alphabetically, which is where the leading zeros become important.

Jack

JDP
10-22-2009, 11:55 PM
1. If achievable would be slow, possibly use coffee node.
2. + 3. in the set up you want would need coffee again.
4. You would have to do this with a script or plugin.

All in all better suited to a script or plugin.

HTH

CGTalk Moderation
10-22-2009, 11:55 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.