Using .obj (Wavefront) models - Rabbitminers/Extended-Bogeys GitHub Wiki
Why use wavefronts (.obj)?
To allow for more freedom with both scale and shapes when modelling your new bogeys we recommend you use .obj
models instead of .json models, this is also how the default bogey models are stored. While neither are specifically required and also have alternatives Blockbench and Blender are very useful when modelling and exporting .obj
models for Minecraft aswell as both being free and open source.
Modelling and Exporting
You can model in either program although we would recommend blockbench due to the more specialised work flow (In blockbench you can either use a Generic Model, providing more freedom with rotation and scale, or Java Block like usual) but once you are finished export the model as a .obj
. Please take note that this will actually create two files a .obj
and a .mtl
these are both needed to properly load your model and textures in-game.
If you are using Blender make sure to join all meshes before exporting and if you are using blockbench load the exported model into blender and join all of the exported meshes. If you do not do this then only one of them will be rendered ingame resulting in an incomplete model.
Loading the models in-game
Forge helpfully includes a obj
loader by default so no extra dependencies are needed. First place your models and .mtl
s into the resources/models]
(tip - since multiple files are required per style to help with organisation I reccommend placing these into their own directory within the /models
directory e.g resources/models/exampleBogeyStyle/exampleBogeyFrame.obj
just make sure to include this in the path to the file later!)
Second create .json
file this will be used to load the model here is an example version:
// resources/models/exampleStyle/exampleStyleFrame.json
{
"parent": "block/block",
"loader": "forge:obj",
"flip-v": true,
"textures": {
// Make sure you have placed your textures in the respective directory
"frame": "extendedbogeys:block/exampleStyle/frame"
},
"model": "extendedbogeys:models/exampleBogeyStyle/exampleBogeyFrame.obj"
}
This will load the specified model its .mtl
and texture file, you can now use this texture in the .mtl
to use each texture. If you open the .mtl
you should see something similar to this
newmtl mesh_name
map_Kd #texture_id
Change the value of the map_Kd to one of the textures you have loaded e.g #frame
in our example (note - the #
is required). And there you go youre model should now be able to be imported as a Partial in-game as detailed in This page.