Jump to content
Sign in to follow this  
pelos

sort a list of node base on the node name?

Recommended Posts

i select some nodes on the network tab, and i do get a tuple,

i can make it a list, and then sort them. but is not always the same depending on the way the node were selected.

can i sort them base on node.name()

Share this post


Link to post
Share on other sites

You could write your own comparison function but in this case it's easiest to just use a key based on the name() function.

nodes.sort(key=hou.Node.name)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×