Haven-King / myron

An OBJ loading library for the fabric ecosystem
MIT License
27 stars 9 forks source link

Update to 1.17.1 #3

Closed jardhu closed 3 years ago

jardhu commented 3 years ago

Almost self explanatory, except that some changes were necessary:

Most importantly, when they're baked, MyronUnbakedModels would try to always invoke Myron.load() to create and build the obj mesh. The problem with this is with Item/BlockItem models that use a ModelIdentifier: Myron.load() seems to only support absolute Identifiers, like myron:models/misc/torus.obj, but a ModelIdentifier gets passed to Myron.load(). I am not sure if this is a 1.17 change, but this prevents inventory models from working.

I made MyronUnbakedModel store the Obj and material map that was loaded in AbstractObjLoader, which is then directly used to build the Mesh. This fixes inventory obj models not rendering properly.

jardhu commented 3 years ago

And here's my obligatory* screenshot showing this works with the test models and my own mod's OBJ model:

2021-08-05_13 44 08

* In a cheeky sense of the word, because I also did this with FOML.