io_scene_b3d
io_scene_b3d copied to clipboard
Materials are exported in the wrong order
I'm using Blender 2.83
The exporter iterates through the mesh and outputs materials as they are found used on polygons. So the material assigned to the first created polygon will be first to be listed in the B3D file. The exporter goes from oldest polygon to newest polygon finding materials.
The exporter should instead get the list of materials on the mesh and output those in order.
The order of materials is very important because Irrlicht works on material indices not material names.
The relevant function in the exporter is: write_brus
I found a workaround that worked for me: It is possible to move a material to last in the list. Go to edit mode. Press A then A on the keyboard to deselect everything. Select the material and press select to select all polygons assigned to the material. Then press Mesh->Separate->Selection to create a new object from the selected polygons. Go to object mode. Drag the new object on top of the old object while pressing shift and drop it. This will parent the new object to the old object. Then select the old object and the new object and press Ctrl+J to join the objects back together.
I can confirm the issue, I used Blender 2.93.5.
This will probably get fixed in a rewrite (in progress) unless someone else gets to it first. As there is a workaround and it is a very old issue I am not too concerned about it. Thanks for the detailed info, though!
This will probably get fixed in a rewrite (in progress) unless someone else gets to it first. As there is a workaround and it is a very old issue I am not too concerned about it. Thanks for the detailed info, though!
Can't wait for the rewrite!