jmc2obj / j-mc-2-obj

Java-based Minecraft-to-OBJ exporter.
http://www.jmc2obj.net
352 stars 59 forks source link

Cusom OBJ models dont work anymore #171

Closed michal212345 closed 2 years ago

michal212345 commented 2 years ago

This custom Mesh for Oak_leaves doesn't work but the same code for the chest works perfectly fine...

`

Mesh
            <occlusion>transparent</occlusion>
            <mesh>
                    <mesh distance="1">models/leaves_1.obj</mesh>
                    <mesh distance="2">models/leaves_2.obj</mesh>
                    <mesh distance="3">models/leaves_3.obj</mesh>
                    <mesh distance="4">models/leaves_4.obj</mesh>
                    <mesh distance="5">models/leaves_4.obj</mesh>
                    <mesh distance="6">models/leaves_4.obj</mesh>
                    <mesh distance="7">models/leaves_4.obj</mesh>
            </mesh>
            <materials>leaves_oak</materials>
     </block>`

This spits out two issues:

First error Block minecraft:oak_leaves has invalid mesh definition. Ignoring. When the code is perfect

Second error when exporting ERROR: Couldn't find assets/minecraft/textures/leaves_oak.png in current resource packs The png exists I'm looking at it

This worked perfectly in 112 but doesn't work anymore in 113. No clear reason why, it just doesn't work, similar code for chest works perfectly fine.

mmdanggg2 commented 2 years ago

That block definition works fine for me if I replace the leaves_#.obj with eg pig.obj It might be a bad obj file. If you send them I can have a look. image

For the textures, they need to be the path from the textures folder in a resource pack so it will need to be minecraft:block/oak_leaves or just block/oak_leaves image

michal212345 commented 2 years ago

Hi, Thanks, I figured out the textures issues now, but I cannot figure out why the model doesn't inherently work when it was perfectly fine in 112 like I have mentioned before.

Thanks for taking the time to have a look.

leaves_1.zip

mmdanggg2 commented 2 years ago

This was happening because your obj file never set a material to use, because of the changes to textures in 113 this caused an error. I've added checks for this now and it will default to the unknown material. The <materials> tag still overrides this just fine.

michal212345 commented 2 years ago

When will you be able to compile and push the update?

mmdanggg2 commented 2 years ago

probably this weekend if nothing else comes up