Sorting objects by poly count with Xpresso

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  10 October 2009
Sorting objects by poly count with Xpresso

I'm trying to create an Xpresso expression tag that will:
  1. Iterate through every object in a scene
  2. For each polygon object, get the polygon count
  3. Append the polygon count for each object to its name (i.e. "Chair" becomes "02485 Chair")
  4. 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.

Built Light
  10 October 2009
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.

  10 October 2009
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 06:57 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.