How does one reorder child bones within an armature ?

Hi there, I just resolved this issue for myself by patching the BVH exporter module in Blender’s source code. With my changes, there is now an extra option to “Sort Child Names” for each bone (1). I simply export the armature using this feature, and then reimport back into the scene. This is actually very useful for my project asset pipeline independently of the issue originally reported above since we make heavy use of BVH motion capture data anyway and need consistent node name order, but since it seems quite helpful to those who may be seeing this post through some search engine, I thought I’d share here as well. Hopefully this option might eventually get adopted through a pull request as an official contribution for non-developers as it is already proving to be useful for our team. According to my findings while researching this issue, it appears that a decision was made a while ago to preserve the original bone ordering because of certain expectations placed upon the BVH format by the “Second Life” video game (2).

(1) https://github.com/PierceLBrooks/blender-addons/commit/3f005e5f7df5fe4626a517a3c75c4aec07625d69
(2) https://projects.blender.org/blender/blender-addons/src/branch/main/io_anim_bvh/export_bvh.py#L40