Sage-of-Mirrors / SuperBMD

A library to import and export various 3D model formats into the Binary Model (BMD) format.
38 stars 20 forks source link

Fixed materials not converting correctly if they have underscores in their name #8

Closed LagoLunatic closed 5 years ago

LagoLunatic commented 6 years ago

When materials are converted from BDL -> DAE, AssimpNet automatically converts parentheses in their names to underscores. So then when loading the materials back from materials.json for converting DAE -> BMD, there's code that converts underscores back to parentheses.

But that code causes issues for material names that originally had underscores in their name (like a material in the Hero's Charm model), since the underscores are converted to parentheses and then detection of which material is which doesn't work. So I changed how it compares material names so that it works correctly for materials that have underscores in them and also for ones that have parentheses in them.