ktisis-tools / Ktisis

A robust posing tool for creating screenshots in FFXIV's GPose mode.
GNU General Public License v3.0
198 stars 50 forks source link

Correct Handling of Partial sklbs with >1 Root Bone #139

Closed sleepybnuuy closed 3 months ago

sleepybnuuy commented 6 months ago

Issue

via two different discord issue reports, Ktisis has historically failed to handle propagating bone transform changes to portions of partial extra skeletons which have more than 1 root node or binding point. propagation is applied to all bones in the partial skeleton when transforming the first-identified root node in the partial, and does not apply when transforming bones that should parent/propagate to those in the partial related to any latter root nodes. this behavior is present on v0.3 and main branch

this can be observed with the extra sklb loaded by the Far Eastern Schoolgirl's and Schoolboy's Hakama, as well as any other sklbs which define multiple root nodes (usually used with long-sleeved gear for physics)

Gap

HavokPosing's interpretation of partial skeletons assumes:

Fix

to avoid rewriting the entire HavokPosing file or establishing a completely new way of handling child-parent bone relations (ala VFXEdit's use of LayerOffset values to determine roots/priority, or brio's custom mapping into bone relationships), this commit:

Addtl Fixes

  1. correct a NullReference exception which can occur from HavokPosing when a partial skeleton index exists but has no data behind it due to the character having changed gear, but not fully reinstanced/cleaned out partial data. if a null subPartial is identified in Propagate, should be skipped to prevent jitters and error throws - https://discord.com/channels/975894364020686878/1004359659613859910/1233494906547474523
  2. prevents BoneEnumerator from adding an additional copy of a multi-root partial skeleton's secondary/tertiary binding bones in the same hierarchy position as the main skeleton's version of that bone. multi-roots should now correctly parent both/all sections to the root skeleton, rather than just one (thanks Cordelia for showing me this) - https://discord.com/channels/975894364020686878/1004359659613859910/1233279681915125771