Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Materials are exported in the wrong order #10

Open
MrRar opened this issue Aug 3, 2022 · 3 comments
Open

Materials are exported in the wrong order #10

MrRar opened this issue Aug 3, 2022 · 3 comments

Comments

@MrRar
Copy link

MrRar commented Aug 3, 2022

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.

@NathanSalapat
Copy link

I can confirm the issue, I used Blender 2.93.5.

@GreenXenith
Copy link
Owner

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!

@MrRar
Copy link
Author

MrRar commented Aug 7, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants