zturtleman / mm3d

Maverick Model 3D is a 3D model editor and animator for games.
https://clover.moe/mm3d
GNU General Public License v2.0
110 stars 22 forks source link

Load MD3 animation names even when not in "player model" mode #155

Open zturtleman opened 3 years ago

zturtleman commented 3 years ago

Loading MD3 player models parses animation.cfg to get the animation names. This isn't available for most standalone MD3 models. Misfit/Maverick save the animation names in the MD3 frames but frame names are ignored when loading MD3 models and hard coded "AnimFrames" name is used. MD2 importer however creates animations from frame names.

The main hold up (for loading MD3 frame names as animations, based on the MD2 importer) is that MD2 export/import has a hack to add an underscore between animation names ending with a number and the frame number (first frame of "example1" should be "example100" but an underscore is add as in "example1_00") and then Misfit/Maverick remove the underscore when loading the model. Otherwise Misfit/Maverick removes all trailing numbers and "example100", "example200" become one animation ("example"). Adding an underscore in MD3 frame names would break exporting models for Sonic Robo Blast 2 which is the only thing that I know uses MD3 frame names.

I've started working on more robust frame name parsing so that adding an underscore at export isn't needed. I need to more thoroughly test it and fix edge cases. (Which is complicated by licensing since I plan to also use this frame name parsing code in a non-GPL project. It would be a problem if changes to it are submitted to Maverick as GPL. So I guess it needs it's own file with zlib license or something.)

Originally posted by @zturtleman in https://github.com/zturtleman/mm3d/issues/147#issuecomment-716968473

quakemmo commented 3 years ago

Bumping this up for good measure!