Skip to content

Instantly share code, notes, and snippets.

@bohdon
Created January 24, 2023 15:49
Show Gist options
  • Save bohdon/b04ebbe55fe464b9d342b12d4c73e730 to your computer and use it in GitHub Desktop.
Save bohdon/b04ebbe55fe464b9d342b12d4c73e730 to your computer and use it in GitHub Desktop.
Sort the selected Maya nodes by name.
import pymel.core as pm
def sort_by_name(nodes):
# get sorted list of nodes
sorted_nodes = sorted(nodes)
for node in sorted_nodes:
pm.reorder(node, back=True)
sort_by_name(pm.selected())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment