Assign textures to multiple texture slots of entity meshes

Post Reply
doxygen_spammer
Member
Posts: 70
Joined: Wed Dec 16, 2020 16:52
GitHub: doxygen-spammer

Assign textures to multiple texture slots of entity meshes

by doxygen_spammer » Post

Hi!

I am trying to add a second texture slot to a train model, so I can use two independent textures.

The model is made with Blender, has animations, and is exported to B3D using the io_scene_b3d plugin.

I observed that I can pass more than one texture to the entity via the

Code: Select all

textures = { ... }
property. But they do not get applied to texture slots (or what I consider texture slots), but to Blender objects in alphabetic order. The last texture is duplicated to match the number of objects.

Is this behavior intentional? And what causes it? Minetest’s interpretation of B3D, the B3D exporter, my Blender skills?

According to https://wiki.minetest.net/Using_Blender ... d_textures I have added materials to the objects. Every material has an image texture node. Those materials, which I want to use a different texture slot, use a different image in the image node.

The usage of material slots on the objects (like the wiki article actually says) does not seem to have any effect for Minetest. However, the exported B3D file definitively preserves the material slots (just like the object list), as I get them back when re-importing in Blender.

User avatar
Blockhead
Member
Posts: 1602
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Assign textures to multiple texture slots of entity meshes

by Blockhead » Post

doxygen_spammer wrote:
Mon Jan 31, 2022 18:29
The model is made with Blender, has animations, and is exported to B3D using the io_scene_b3d plugin.
Which version of the plugin did you use? They have subtle differences I think.
doxygen_spammer wrote:
Mon Jan 31, 2022 18:29
I observed that I can pass more than one texture to the entity via the

Code: Select all

textures = { ... }
property. But they do not get applied to texture slots (or what I consider texture slots), but to Blender objects in alphabetic order.

Is this behavior intentional? And what causes it? Minetest’s interpretation of B3D, the B3D exporter, my Blender skills?

According to https://wiki.minetest.net/Using_Blender ... d_textures I have added materials to the objects. Every material has an image texture node. Those materials, which I want to use a different texture slot, use a different image in the image node.

The usage of material slots on the objects (like the wiki article actually says) does not seem to have any effect for Minetest. However, the exported B3D file definitively preserves the material slots (just like the object list), as I get them back when re-importing in Blender.
This doesn't sound quite right according to my experience with the linetrack boat a while ago. However, maybe I used a different version of the plugin? (at least one compatible with 2.8x anyway...). What I recall is that it was two objects: the door, and the rest of the boat, and that the boat had a lot of material slots, 14 or so in total including the door, and that each material slot would map to one entry in the textures = { ... } table in Minetest, and each time I would export, all the material slots would come out in random order and I'd have to reorder them in the textures table.

One material slot in blender definitely only has one texture right? Your wording is unclear, do you have materials with multiple textures? Is that possible? When I model I always have one material = one texture.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

doxygen_spammer
Member
Posts: 70
Joined: Wed Dec 16, 2020 16:52
GitHub: doxygen-spammer

Re: Assign textures to multiple texture slots of entity meshes

by doxygen_spammer » Post

Is this behavior intentional? And what causes it? Minetest’s interpretation of B3D, the B3D exporter, my Blender skills?
With my current knowledge I can answer this in so far as “the B3D exporter” makes trouble.
B3D is unfortunately not readable for humans, and io_scene_b3d is fragile.

I had success by using exactly one material per mesh (i. e. one material per Blender object), and one mesh per texture slot.

It is more satisfying to use Wavefront .obj if possible (i. e. if you do not need animations).
Blender has a reliable exporter for .obj, you just need to find the correct settings.
(Enable at least material groups, object groups, or material library.
Open the .obj file, look which faces use which material/object, adjust settings if necessary.)

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests