How to find the top Nth primitives with the longest length?

   2619   2   0
User Avatar
Member
22 posts
Joined: Oct. 2021
Offline
Hi everyone! I'm wondering if we can find the top Nth primitives with the longest length. For example, if I have 10 primitives with 4 having a longer length than the other 6. I can used "measure" node and "group expression" (@length > 0.5), but if I tweak a certain node before those ones, I need to change the expression value from the "group expression" node to choose the correct primitives. Is there any way to just choose the top 4 longest length so I don't need to keep changing the value from the "group expression" node?
User Avatar
Member
9380 posts
Joined: July 2007
Offline
use Sort SOP to sort by your length attribute and check Reverse to start from largest
then Blast SOP to keep just first N primitives
Edited by tamte - Jan. 13, 2022 13:44:18
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
22 posts
Joined: Oct. 2021
Offline
Oh my, that totally works! Thank you so much for the help!
  • Quick Links