StjerneIdioten / I3D-Blender-Addon

Rewriting the I3D blender addon from scratch and adding long-sought community features
GNU General Public License v3.0
66 stars 18 forks source link

No warning when mergegroup objects have multiple materials #80

Open StjerneIdioten opened 3 years ago

StjerneIdioten commented 3 years ago

Describe the bug The exporter does not show a warning when an object exported as part of a mergegroup, has multiple materials. This leads to having multiple subsets on merge group shapes objects, and that makes GE crash instantly.

Kieruss commented 2 years ago

I found that if you try to export two meshes as a merge group, and they have different materials, you end up with one mesh (with its own material, but no child mesh) and one empty that's just an empty. If they're set to the same material, it works fine.

However, the Giants exporter will happily export a merged mesh where the individual meshes have separate materials. Both materials get assigned to the actual-mesh, and it works fine.

ssnd292 commented 2 years ago

While the Giants Exporter will export this, this method is not recommended. Even Giants themselves did not allow a mesh with two materials at release of FS22.

StjerneIdioten commented 2 years ago

I guess I could make it add two materials to the parent object and then only "paint" the vertices that the material came from before merge, but as Redphoenix mentions it's not exactly recommended. Without bothering to look it up too much atm I seem to recall that it would increase drawcalls or something since you have multiple materials? In any case if it didn't hurt performance at all then we wouldn't need the vehicleshader and the UV trickery 😆