d0048 Posted February 19, 2019 Posted February 19, 2019 (edited) I am having trouble loading a model file exported directly from MagicaVoxel with textures, but the loader complains about the 1x256 texture palette image associated with the .mtl file for having broken aspect ratio. The stacktrace of the error: Spoiler [15:32:24] [main/ERROR]: Unable to parse metadata from minecraft_ml:textures/ml_blockbase.png java.lang.RuntimeException: broken aspect ratio and not an animation at net.minecraft.client.renderer.texture.TextureAtlasSprite.func_188538_a(TextureAtlasSprite.java:380) ~[cdq.class:?] at net.minecraft.client.renderer.texture.TextureMap.func_110571_b(TextureMap.java:238) [cdp.class:?] at net.minecraft.client.renderer.texture.TextureMap.func_174943_a(TextureMap.java:155) [cdp.class:?] at net.minecraftforge.client.model.ModelLoader.func_177570_a(ModelLoader.java:159) [ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelManager.func_110549_a(ModelManager.java:28) [cgc.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:121) [cev.class:?] at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:512) [bib.class:?] at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377) [bib.class:?] at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_191] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_191] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_191] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_191] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] My model, blockstate file and the corresponding textures are uploaded in attatchments.The model renders with texture correctly when imported into other model viewers like blender. ml_blockbase.mtl ml_blockbase.obj My resource dir structure: Edited February 19, 2019 by d0048 Quote
d0048 Posted February 19, 2019 Author Posted February 19, 2019 I managed to solve the issue by forcing the texture png file into a squre with montage pic_org.png -tile x512 -geometry +0+0 -duplicate 255 texture.png Quote
DoctorLOGiQ Posted February 19, 2019 Posted February 19, 2019 (edited) Yes, from my experience working with .OBJ models in Forge, the texture has to be a square texture, or rectangular (with a height which is a multiple of the width) with a .png.mcmeta file for animated textures. You also seem to have to flip the texture vertically in the blockstate JSON file using: "custom": { "flip-v": true } , which I usually place under the "model": definition. If you don't do this, you may find that your texture is upside-down. Edit: This is true when exporting a .OBJ file from Blender, I cannot confirm if this is the case when exporting your model from another application. Edited February 19, 2019 by DoctorLOGiQ Added a footnote to be clearer about a statement I made Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.