ultimate-research / ssbh_lib

Reading and writing SSBH file formats in Rust
MIT License
8 stars 3 forks source link

investigate compensate scale for AnimData #91

Closed ScanMountGoat closed 2 years ago

ScanMountGoat commented 2 years ago

This is configurable per transform for uncompressed transforms and per track for compressed transforms. It appears to toggle if the bone's descendants can inherit its scale. This appears to be slightly different than inheriting scale from parent bones (#101).

ScanMountGoat commented 2 years ago

Processing all anim files in Smash Ultimate shows that scale compensation is always identical for all frames in a track. It might not be worth the increased API complexity to allow people to animate scale compensation on a per frame basis.

ScanMountGoat commented 2 years ago

It makes sense to handle this at the level of an entire TrackData object using a single boolean. This would require error checking when reading uncompressed transforms, since they have the possibility of setting different values per frame. This behavior has been verified in Smash Ultimate in game.

One option is to remove the compensate_scale field from the Transform type and create a separate private type for binary reading/writing. This avoids breaking the existing reader/writer code.

It may be worth investigating adding support to change this value per frame again at a later time. For now, removing the field prevents people from encountering a potential error when trying to set per frame scale_compensation for compressed tracks and simplifies the API.