Say I have a list of cube objects in maya using python.
cubes = [‘cube01’,‘cube02’,‘cube03’]
How would I go about sorting that list based on their translate X value for example. So if-
cube01 translatex = 5
cube02 translatex = 3
cube03 translatex = 10
The list would be sorted to-
cubes = [‘cube02’,‘cube01’,‘cube03’]
This isn’t the exact thing I’m trying to accomplish, but it’s a simple example of what I’m trying to get done.