Search In
• More options...
Find results that contain...
Find results in...

# [1.8] [SOLVED] B3D item model has no texture

## Recommended Posts

Edit: A new problem has appeared where I have a model that is using the wrong texture map. If I remove the textures, it errors suggesting that the textures are being loaded but not loaded.

Edit2: I'm stupid the UV map was misplaced.

I have an item using a b3d model which is working correctly other than the fact that it does not display a texture.

I am not sure what is wrong here as the console does not show any errors.

I am wondering if it has something to do with my model setup in Blender or something else.

I am using this code in my ClientProxy which is run during the pre initialization (Reference.MODID's value is kk and Strings.KingdomKey's value is kingdomkey)

B3DLoader.instance.addDomain(Reference.MODID);

ModelLoader.setCustomModelResourceLocation(ModItems.KingdomKey, 0, new ModelResourceLocation(Reference.MODID + ":" + Strings.KingdomKey, "inventory"));

Here's my blockstate json for my item (kingdomkey.json)

{
"forge_marker": 1,
"defaults": {
"textures": {
},
"model": "kk:kingdomkey.b3d"
},
"variants": {
"inventory": [
{
"transform": {
"thirdperson": {
"scale": 0.02
},
"gui": {
"scale": 0.02
},
"firstperson": {
"scale": 0.02
}
}
}
]
}
}

Here's my texture (kingdomkey.png)

And my UV map in Blender

As you can see in this screenshot the model renders fine but it is missing the texture. The orientation's not right but that's not a problem.

If anyone knows what the problem is I'd be grateful to know. I have spent many hours trying to get this to work. Also this is my first post on here so I hope I'm doing things right.

##### Share on other sites

I think you should look very closely to your path to the texture in your .JSON.

"texture": "modid:items/yourtexture"

P.S - I've been trying to get my B3D models to load...but I can't...if you could help me I'd be very grateful. You said something about a blockstate .JSON? For an item? What about the regular item .JSON?

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

##### Share on other sites

I think you should look very closely to your path to the texture in your .JSON.

"texture": "modid:items/yourtexture"

P.S - I've been trying to get my B3D models to load...but I can't...if you could help me I'd be very grateful. You said something about a blockstate .JSON? For an item? What about the regular item .JSON?

I have the texture located in src\main\resources\assets\kk\textures\items\keyblades\ And the file is name kingdomkey.png I don't see anything wrong here adding .png to the json I don't think is necessary but doesn't work either way.

The kingdomkey.json file is located in src\main\resources\assets\kk\blockstates\

If I copy it to src\main\resources\assets\kk\models\item\ it says "BlockModel requires either elements or parent, found neither".

##### Share on other sites

I don't think you need like a .mtl file - that is what the JSON is for I guess... I am getting a runtime exception on my B3D model saying there is no root mesh - blender is probably causing the problem. Make sure in Blender you UV the texture to the model then export it. After that, define your texture in the .JSON.

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

##### Share on other sites

I don't think you need like a .mtl file - that is what the JSON is for I guess... I am getting a runtime exception on my B3D model saying there is no root mesh - blender is probably causing the problem. Make sure in Blender you UV the texture to the model then export it. After that, define your texture in the .JSON.

Yeah the b3d exporter doesn't create a .mtl file so I assumed it wasn't needed. And I have done exactly that, the UV is setup and the texture is defined in the .json file. Which is why I am stumped on this. As I said the console shows no errors what so ever.

The .json file definitely needs to be in the blockstates folder for the model to work though.

##### Share on other sites

You are correct. Are you using the .B3D exporter by RainWarrior?

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

##### Share on other sites

You are correct. Are you using the .B3D exporter by RainWarrior?

Yes this one: https://github.com/RainWarrior/B3DExport

##### Share on other sites

If I can get my model to render I can work on its textures and help you further. So the model.json goes in the blockstates folder, the model.b3d goes into the models/items folder, and the mesh must be triangular - is that correct? From there, I can help on solving the texture problem.

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

##### Share on other sites

If I can get my model to render I can work on its textures and help you further. So the model.json goes in the blockstates folder, the model.b3d goes into the models/items folder, and the mesh must be triangular - is that correct? From there, I can help on solving the texture problem.

Yes that is all correct

##### Share on other sites

Actually, did you register your item render the usual way

Minecraft.getMinecraft().getRenderItem().getItemModelMesher.register(item, 0, new modelresourcelocation...);


And then use

B3DLoader.instance.addDomain(Reference.MODID);

ModelLoader.setCustomModelResourceLocation(ModItems.KingdomKey, 0, new ModelResourceLocation(Reference.MODID + ":" + Strings.KingdomKey, "inventory"));


Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

##### Share on other sites

Actually, did you register your item render the usual way

Minecraft.getMinecraft().getRenderItem().getItemModelMesher.register(item, 0, new modelresourcelocation...);


And then use

B3DLoader.instance.addDomain(Reference.MODID);

ModelLoader.setCustomModelResourceLocation(ModItems.KingdomKey, 0, new ModelResourceLocation(Reference.MODID + ":" + Strings.KingdomKey, "inventory"));


Nope I assumed the normal item rendering way wouldn't work with this.

##### Share on other sites

I'm still trying...lol. I keep getting this bull

[13:12:29] [Client thread/ERROR] [FML]: No root mesh in model armed:models/block/gun.b3d and no mesh name in location, skipping


Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

##### Share on other sites

I'm still trying...lol. I keep getting this bull

[13:12:29] [Client thread/ERROR] [FML]: No root mesh in model armed:models/block/gun.b3d and no mesh name in location, skipping


In your .json file what did you specify as the path for the .b3d model as I just have "model": "kk:kingdomkey.b3d" and the model is placed in models/item/.

##### Share on other sites

I did the same. We'll get this working one way or another.

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

##### Share on other sites

I did the same. We'll get this working one way or another.

I wonder why it is looking in models/block/ for the model have you tried placing the model in the block folder?

##### Share on other sites

I tried placing the model in the block folder - I'm rendering an item though. When I do that I get a FileNotFoundException saying it needs to be placed in the item folder - that tells me there that it definitely needs to be in the models/item folder. Also, we know that the .JSON has to be in the blockstates folder. There is probably something wrong with my model...

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

##### Share on other sites

Why didn't RainWarrioir continue the OBJLoader...B3D is horrible.

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

##### Share on other sites

No its not, i actually think it is superawesome you know why? Cuz you can ANIMATE IT!! But nevertheless, i can't get the loading process done. What excactly belongs into the json files?

The models/blocks file i did that:

{
"forge_marker": 1,
"defaults": {
"textures": {
"texture": "reallifemod:textures/models/blocks/texture_Lantern.png"
},
"model": "reallifemod:lantern.b3d"
},
"variants": {
"inventory": [
{
"transform": {
"thirdperson": {
"scale": 0.02
},
"gui": {
"scale": 0.02
},
"firstperson": {
"scale": 0.02
}
}
}
]
}
}


The same in the blockstate

and in the itemfile this:

{
"parent": "reallifemod:blockLantern",
"textures": {
"all": "reallifemod:textures/models/block/texture_Lantern.png"
}
}


##### Share on other sites

Also, try with .png behind your texturepath.

##### Share on other sites

Okay I figured it out!

The .json file texture path does nothing.

The texture path needs to be set in Blender

Like this:

EDIT: Here's a screenshot of it working

##### Share on other sites

No its not, i actually think it is superawesome you know why? Cuz you can ANIMATE IT!! But nevertheless, i can't get the loading process done. What excactly belongs into the json files?

The models/blocks file i did that:

{
"forge_marker": 1,
"defaults": {
"textures": {
"texture": "reallifemod:textures/models/blocks/texture_Lantern.png"
},
"model": "reallifemod:lantern.b3d"
},
"variants": {
"inventory": [
{
"transform": {
"thirdperson": {
"scale": 0.02
},
"gui": {
"scale": 0.02
},
"firstperson": {
"scale": 0.02
}
}
}
]
}
}


The same in the blockstate

and in the itemfile this:

{
"parent": "reallifemod:blockLantern",
"textures": {
"all": "reallifemod:textures/models/block/texture_Lantern.png"
}
}


You shouldn't need a .json file in /models/block/ or /models/item/ The first .json file should be all you need in the blockstates folder. The .b3d should be in the /models/item/ if it's an item or /models/block if it's a block.

Also you might want to up the scale I have it at 0.02 because my model is HUGE.

I probably should start a new thread for this, but how do you animate it?

##### Share on other sites

I tried placing the model in the block folder - I'm rendering an item though. When I do that I get a FileNotFoundException saying it needs to be placed in the item folder - that tells me there that it definitely needs to be in the models/item folder. Also, we know that the .JSON has to be in the blockstates folder. There is probably something wrong with my model...

I've found the solution to your problem! I just tried adding my second model and I had the same error as you. It turns out you need to merge your model into 1 object which you can do by pressing A then Ctrl+J

Then rename the object to "mesh" like this:

##### Share on other sites

Okay, and how excactly do i then load the model? When i put the thing in the blockstates folder, will it load completely or do i have to set any other stuff?

##### Share on other sites

Okay, and how excactly do i then load the model? When i put the thing in the blockstates folder, will it load completely or do i have to set any other stuff?

Yep just have your .json file in the blockstates folder and have the model in "models/item/" or "models/block/" depending on what you're using

##### Share on other sites

Awesome. also, it is possible to render entities with it somehow, but ill have to have a close look at this. aswell as at the animation thing

## 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.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

×

• ### Posts

• i cancel livingdeathevent thats work correctly but i think the packet is not sending because client is not rendering the totem animation, i think Simple channel is init,   are you referring to this? or something else private void setup (FMLCommonSetupEvent event){ event.enqueueWork(() -> { ModMessages.register(); SpawnPlacements.register(ModEntityTypes.ARDILLA.get(), SpawnPlacements.Type.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Animal::checkAnimalSpawnRules); });
• These are custom key bindings added by mods. In this case we don't even know which key it is, the data is totally "null"/missing.
• alright.  just to make sure, can I not assign a key to every mapping in the settings so it doesn't consider it as "null" ?  Anyways, I'll do that on an empty afternoon, that'll help the mod author as well if I report the bug to him. Thank you.
• The only way to find the mod in this case is to remove mods until you find the one that makes the error go away.   Since you are in the process of making this modpack, I would suggest you start with no mods (or a known working subset of popular mods). Then add mods individually (with its dependencies), checking each time that you can get all the through to creating a new world (don't just load an exisiting world). If you hit a problem then you know which mod has the issue. This method will not just help you find this problem mod, but it will also help confirm any new mods you add in future also work, without having to guess which is the problem.
• jesus... what should I do ? I haven't been able to play solo since I made the modpack...

• ### Who's Online (See full list)

×

• #### Activity

×
• Create New...