h4lfheart / FortnitePorting

Automation of the Fortnite Porting Process
GNU General Public License v3.0
250 stars 45 forks source link

Fix bug where metadata unintentionally overwritten during Blender import #47

Closed RedHaze closed 6 months ago

RedHaze commented 6 months ago

Summary

As part of the initial implementation of pose asset importing, I copied the data to all character parts to ensure stuff like FaceAcc or other parts have similar transforms applied. Interestingly, this didn't seem to work as expected with styles (specifically Shady Zadie unmasked).

I noticed there's likely no need to copy pose asset data around given all parts are accessible during import_model in import_task.py. It turns out that in get_meta, properties from the metadata would be taken from the last part to contain a key for that data, even if it were empty. So I added a check to make sure the key has non-empty data associated with it when assigning to out_props.

Since get_meta for pose asset data is run for all parts, it should capture non-empty pose asset data from at least one of the parts if there's any available. So there shouldn't be any need to copy around pose asset data to all parts from C#. A warning in Blender console will print if multiple parts contain data of the same key. When this happens, later non-empty data is ignored.