Order a joint chain by names

I created a number of joints under a main joint want to export these with a nice order to them like when you select order by name in the Outliner. I see that there is a reorder command in maya but wondered if anyone has tacked this before?

MO

I don’t have an actual answer to this, but you’ll need to ensure that both your export format, and your importer actually respect the order as well.
So it might not actually matter what order Maya exported the joints in if say FBX or Unreal just process them in alphabetical / random order.

if it’s just for cleanliness, reorder does what you want. But…

… If significant for the actual export behavior you’ll have support headaches. The Crytek maya exporter did that and it was a huge pain in the ass to work with (and literally none of the artists had any idea how too manually reorder nodes in the outliner). Plus its possible to fatfinger it and not realize why things aren’t working for a long, long time.

Joint order did matter for UE3. We had a problem with IK chains in Unreal lagging one frame behind the joint they were supposed to attach to. It turned out that Unreal was processing the target joint after it had already done the IK. Reordering the joints in the outliner fixed the problem.

I don’t know if that problem persists in UE4. It wouldn’t surprise me too much if it’s still there.

  1. Select the elements with your element order into the outliner, CMD + LMB
  2. Now CMD + G , now you have a new group with the right order
  3. Drag de elements where they comes into the hierarchy, every single element preserve the order into the outliner.

jRoboto,

You can also just run the reorder script, as Morass suggested, and there is no reason to make a new group:

Select each node in the order you want (or create a list in the order you want) and run this:

for each in cmds.ls(sl=1):
    cmds.reorder(each, back=True)

Nope, looks like UE4 is more tolerant about joint order. I’m not seeing the same problems as I used to in UE3.

Thanks Clesage.
When I use the code works without problem.