IllusionMods/HSPlugins

[PE] Reorganize FK bones inside OCIItem.listBones according to transform tree

RSkoi opened this issue · 0 comments

The order of FK bones inside the OCIItem.listBones list seems to be random. This can lead to inconveniences when iterating through said list. There should be a way to non-intrusively order said list based on the transform tree of the game object, i.e. the bones of the item.

  • (KK)PE orders its FKBoneEntries inside MainWindow._fkScrollRect according to the order of OCIItem.listBones
  • MoveController's scroll wheel function seems to also iterate over the bones with OCIItem.listBones

This is a minor QoL improvement for posing items and the order of bones is reset on scene load/restart again. I feel there is no need to save any additional data to the scene, as pressing a shortcut while having a variable amount of items selected shouldn't be too hard for users. Bones of characters don't need to be reorganized.


Take the following transform tree of the bones of an item:

The current order within OCIItem.listBones of this item is (or can be? I don't know whether this is deterministic) the following:

The expected order is:


Scrolling through the list before reorganizing the bones:

Notice the gizmos jumping around.

before.mp4

After reorganizing

Notice the different order of FK bone buttons (actually Toggles) inside KKPE.

after.mp4