Fast-64 / fast64

Blender based editor for scenes, meshes, and more in first-party N64 games
GNU General Public License v3.0
317 stars 73 forks source link

Support ZAPD bone enums for skeleton import #396

Closed m000z0rz closed 3 months ago

m000z0rz commented 4 months ago

The Majora's Mask decomp uses limb enums on their assets, which changes the generated .c files for objects enough that skeletons won't import. This patch series adds a script to check how many files import skeletons from a decomp folder (currently only 3/176 or 1.7% successful) and adds handling for parsing these limb enums and using their when adding limbs. After these changes, 166/174 (95.4%) import skeletons without throwing exceptions.

I did most of my manual testing by:

  1. Open blender
  2. In Fast64, set the game to OOT
  3. In the OOT settings under OOT File Settings, set the decomp path to a checkout of the Majora's Mask decomp (with make setup complete) so assets are extracted
  4. Under the OOT Skeleton Exporter section, import a skeleton from the MM decomp.
    1. I typically tested with the Deku Buter using
      1. Skeleton: gDekuButlerSkel
      2. Object: object_dnj
      3. Actor Overlay: ovl_En_Dno

Alternatively, you can use the test script introduced in the first commit. cd to scripts/oot and run

python3 make_all_skeletons.py <path to your mm decomp> <output dir> ["1" to import animations too]

For example, with the MM decomp checked out to ~/git/mm and with make setup complete there, I run

python3 make_all_skeletons.py ~/git/mm test-out 1

And when it completes, I can open the blend file generated at scripts/oot/test-out/assets/objects/object_dnj/object_dnj.blend to see the Deku Butler successfully imported with all its animations.

Yanis002 commented 4 months ago

oh also you should add a oot subfolder for the content of the scripts folder I think

m000z0rz commented 4 months ago

Thanks for the review @Yanis42 ! I added testing instructions to the PR description and pushed updates that I think should resove the issues you found.