Jump to content

How to create custom 3D models with wavefront obj (in 1.10.2) ?


Recommended Posts

Posted

I have a problem with my mod. I don´t know how to create custom models from wavefront obj files. I watched some tutorials but it still isn´t working for me. I hqave the OBJLoader and I have the blockstate file (https://pastebin.com/eCLFEfmw), the mtl file (https://pastebin.com/f8QC47WD) and the obj file (https://pastebin.com/PaQ4AEdh ) but it won´t work. Every time I start the test client it gives me this error: https://pastebin.com/NtB3zgUT . Please give me a simple answer because I´m not good at creating custom models. I know things about java but there is still much for me to learn.

Posted (edited)
Caused by: java.io.FileNotFoundException: 110core:models/item/110core.hektometer.json

You haven't shown your code, but it looks like you're putting your domain (mod id) into the path part of your resource location (in addition to the domain part, where it actually belongs).

Edited by desht
Posted (edited)

Yeah, I can see a few problems here offhand...

 

  • Stop using getItemModelMesher() and start using setCustomModelResourceLocation().  And do your model registration in an event handler for ModelRegistryEvent.
  • Don't use upper- or mixed-case resource locations. "blockHektometer" is bad, "block_hektometer" is good.
  • Using getUnlocalizedName() to determine the model resource location like you do in ModBlocks#registerRender() is horrible practice.  The block/item registry name should be considered the source of truth, not the translation key.  (So derive your translation keys and model resource locations from your registry names)
  • Start using RegistryEvent.Register<Block> /  RegistryEvent.Register<Item> for registering your blocks and items (and other resources like sounds...), and move away from doing that explicitly in an init() method.  See https://mcforge.readthedocs.io/en/latest/concepts/registries/
Edited by desht
  • Like 1
Posted (edited)

Um, this stuff:

25 minutes ago, desht said:
  • getItemModelMesher() -> setCustomModelResourceLocation().
  • -> And do your model registration in an event handler for ModelRegistryEvent.
  • "blockHektometer" -> "block_hektometer"
  • getUnlocalizedName() -> registry name
  • -> Start using RegistryEvent.Register<Block> /  RegistryEvent.Register<Item>  See https://mcforge.readthedocs.io/en/latest/concepts/registries/
Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Ok, so, one, that tutorial is out of date

Two, that tutorial does some awful, awful things.

 

Show your main class.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

ok...... I made everything exactly like the tutorial but I still get the same error. And what does this mean: "Caused by: java.io.FileNotFoundException: 110core:models/item/block_hektometer.json" ?

Posted

FileNotFoundExceptions mean that the file....was not found

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

How do you expect to display the item in the inventory?

By registering an item model.

And where do you think it goes to go find that model?

At the resource location you give it.

So what does it expect to find there?
A JSON file.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

You need an item model that has a parent of the block model's json

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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



×
×
  • Create New...

Important Information

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