Jump to content

(1.12.2)Problems trying to load .obj model with a 256x1 palette image as texture


Recommended Posts

Posted (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

ml_blockbase.png

Screenshot_20190219_153616.png

 

My resource dir structure:

image.png.207dfefaae1ee5bb8efc1cc6aeb4fc7b.png

Edited by d0048
Posted

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
 

Posted (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 by DoctorLOGiQ
Added a footnote to be clearer about a statement I made

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I tried do download the essential mod to my mod pack but i didnt work. I paly on 1.21 and it should work. I use neoforge for my modding. The weird things is my friend somehow added the mod to his modpack and many others that I somehow can´t. Is there anything i can do? 
    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.