GooberGunter Posted December 26, 2017 Posted December 26, 2017 (edited) Hey, I'm trying to load a model and I'm getting the following error when loading this model. This is my first time rendering an obj, I don't know if this is because models can't have more than 4 vertices, if there's something wrong with my .obj model, or if I missed something in the code. The crash happens when placing the block Spoiler [16:27:41] [main/FATAL]: Reported exception thrown! net.minecraft.util.ReportedException: Tesselating block model at net.minecraft.client.renderer.BlockRendererDispatcher.renderBlock(BlockRendererDispatcher.java:95) ~[BlockRendererDispatcher.class:?] at net.minecraft.client.renderer.chunk.RenderChunk.rebuildChunk(RenderChunk.java:203) ~[RenderChunk.class:?] at net.minecraft.client.renderer.chunk.ChunkRenderWorker.processTask(ChunkRenderWorker.java:122) ~[ChunkRenderWorker.class:?] at net.minecraft.client.renderer.chunk.ChunkRenderDispatcher.updateChunkNow(ChunkRenderDispatcher.java:172) ~[ChunkRenderDispatcher.class:?] at net.minecraft.client.renderer.RenderGlobal.setupTerrain(RenderGlobal.java:1012) ~[RenderGlobal.class:?] at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1369) ~[EntityRenderer.class:?] at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1312) ~[EntityRenderer.class:?] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1115) ~[EntityRenderer.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1207) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_151] 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:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_151] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.lang.ArrayIndexOutOfBoundsException: 4 at net.minecraftforge.client.model.obj.OBJModel$Face.bake(OBJModel.java:881) ~[OBJModel$Face.class:?] at net.minecraftforge.client.model.obj.OBJModel$Group.applyTransform(OBJModel.java:1084) ~[OBJModel$Group.class:?] at net.minecraftforge.client.model.obj.OBJModel$OBJBakedModel.buildQuads(OBJModel.java:1392) ~[OBJModel$OBJBakedModel.class:?] at net.minecraftforge.client.model.obj.OBJModel$OBJBakedModel.getQuads(OBJModel.java:1314) ~[OBJModel$OBJBakedModel.class:?] at net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer.render(ForgeBlockModelRenderer.java:117) ~[ForgeBlockModelRenderer.class:?] at net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer.renderModelSmooth(ForgeBlockModelRenderer.java:103) ~[ForgeBlockModelRenderer.class:?] at net.minecraft.client.renderer.BlockModelRenderer.renderModel(BlockModelRenderer.java:47) ~[BlockModelRenderer.class:?] at net.minecraft.client.renderer.BlockModelRenderer.renderModel(BlockModelRenderer.java:38) ~[BlockModelRenderer.class:?] at net.minecraft.client.renderer.BlockRendererDispatcher.renderBlock(BlockRendererDispatcher.java:80) ~[BlockRendererDispatcher.class:?] ... 22 more Edited December 27, 2017 by GooberGunter Quote
GooberGunter Posted December 26, 2017 Author Posted December 26, 2017 Ugh, It's because I didn't triangulate the faces... Quote
GooberGunter Posted December 26, 2017 Author Posted December 26, 2017 (edited) Update: so I got the model to load, but when the block's texture was being loaded, I got the following error, this one I can't figure out Spoiler STACK TRACE: [18:20:11] [Thread-5/INFO]: org.lwjgl.openal.AL.create(AL.java:156) [18:20:11] [Thread-5/INFO]: org.lwjgl.openal.AL.create(AL.java:102) [18:20:11] [Thread-5/INFO]: org.lwjgl.openal.AL.create(AL.java:206) [18:20:11] [Thread-5/INFO]: paulscode.sound.libraries.LibraryLWJGLOpenAL.init(LibraryLWJGLOpenAL.java:164) [18:20:11] [Thread-5/INFO]: paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1576) [18:20:11] [Thread-5/INFO]: paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572) [18:20:11] [Thread-5/INFO]: paulscode.sound.CommandThread.run(CommandThread.java:121) [18:20:11] [main/INFO] [FML]: OBJLoader.MaterialLibrary: key 'Ns' (model: 'grandsorcery:models/block/crystal.mtl') is not currently supported, skipping [18:20:11] [main/INFO] [FML]: OBJModel: A color has already been defined for material 'Material.001' in 'grandsorcery:models/block/crystal.mtl'. The color defined by key 'Ks' will not be applied! [18:20:11] [main/INFO] [FML]: OBJLoader.MaterialLibrary: key 'Ke' (model: 'grandsorcery:models/block/crystal.mtl') is not currently supported, skipping [18:20:11] [main/INFO] [FML]: OBJLoader.MaterialLibrary: key 'Ni' (model: 'grandsorcery:models/block/crystal.mtl') is not currently supported, skipping [18:20:11] [main/INFO] [FML]: OBJLoader.MaterialLibrary: key 'illum' (model: 'grandsorcery:models/block/crystal.mtl') is not currently supported, skipping [18:20:11] [main/INFO] [FML]: OBJLoader.Parser: command 's' (model: 'grandsorcery:models/block/crystal.obj') is not currently supported, skipping. Line: 192 's off' [18:20:11] [Sound Library Loader/WARN]: ERROR MESSAGE: [18:20:11] [Sound Library Loader/INFO]: Could not locate OpenAL library. [18:20:11] [Sound Library Loader/INFO]: Starting up SoundSystem... [18:20:12] [Thread-7/INFO]: Switching to No Sound [18:20:12] [Thread-7/INFO]: (Silent Mode) [18:20:12] [Sound Library Loader/INFO]: Sound engine started [18:20:16] [main/INFO] [FML]: Max texture size: 16384 [18:20:17] [main/INFO]: Created: 512x512 textures-atlas [18:20:17] [main/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [18:20:18] [main/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [18:20:19] [main/INFO] [FML]: Applying holder lookups [18:20:19] [main/INFO] [FML]: Holder lookups applied Edit: after doing some googling, it looks like forge's object loader doesn't support uv mapping yet, is that right? Edited December 26, 2017 by GooberGunter Quote
Matryoshika Posted December 26, 2017 Posted December 26, 2017 The ObjLoader does support UV-mapping. If you mean the "key x is not supported, skipping", you don't actally need those in the .mtl. You should be able to remove them without any effects on your nodel. 1 Quote Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials.
GooberGunter Posted December 26, 2017 Author Posted December 26, 2017 Ah ok, then perhaps my problem lies in this line: [18:20:11] [main/INFO] [FML]: OBJModel: A color has already been defined for material 'Material.001' in 'grandsorcery:models/block/crystal.mtl'. The color defined by key 'Ks' will not be applied! Quote
daruskiy Posted December 26, 2017 Posted December 26, 2017 14 hours ago, GooberGunter said: Caused by: java.lang.ArrayIndexOutOfBoundsException: 4 Quote
GooberGunter Posted December 26, 2017 Author Posted December 26, 2017 That’s an error I got when loading a .obj that didn’t have triangulated faces. Now the texture isn’t showing up Quote
Matryoshika Posted December 26, 2017 Posted December 26, 2017 Can you post your .mtl file? Also, what be sure that the normals for your model are correct. Quote Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials.
GooberGunter Posted December 26, 2017 Author Posted December 26, 2017 (edited) Yeah, here it is, also what's the easiest way to check normals, I've only been making models for about a week or two now. crystal.mtl Edit: I’ll recalculate the normals in a sec Edited December 26, 2017 by GooberGunter Quote
Matryoshika Posted December 26, 2017 Posted December 26, 2017 (edited) ... You don't have a texture... Textures are linked in the .mtl file, under a "map_Kd" key. Likely caused by an unsuccessful UV-mapping. It was never actually "added". Here's an example of a .mtl file with mapped textures. Oh, and for the future, please paste the contents of files like this to pastebin/github gist. Downloading (possibly malevolent) files from strangers can be off putting. Edited December 26, 2017 by Matryoshika 1 Quote Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials.
GooberGunter Posted December 26, 2017 Author Posted December 26, 2017 (edited) I had a feeling that was the problem, the tutorials I've seen for UV mapping haven't been the best for learning Of course, I'll keep it in mind next time, sorry about that, in fact, depending on the last time I updated my repository, the file might be there Edited December 26, 2017 by GooberGunter 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.