Originally Posted By: jcl
2) Bones indexes start with the root bone, so there should be no forward references. I'm not sure if the SDK sorts the indexes, but I believe it doesn't.

Ok, I got this, as expected, though:

- given: two bones b1 and b2 and b1 is the parent of b2
- if you save them in order (first b1, then b2) and the index of b1 is lower than b2's (no forward referencing), the bones and the parent' reference is correctly saved
- other than that (wrong order or wrong ordered indices), the bones are saved, too; but as root bones

Conclusion: Sort your bones yourself before you push them into the SDK! The underlying graph-theoretical problem is the problem of Topological Sorting, which you have to solve. Best way to embed that is to do it right when you add a bone to your model (or when you remove it).