Hey, everybody.
I've been dealing with a model with a lot of materials wth transparencies (both alpha channels and opacity) and, while sorting my typical transparency issues, I noticed that when I re-import the DFF, the materials are completely re-ordered. Can this be avoided and, if not, what criteria does the exporter use to re-arrange material order?
San Andreas - Materials re-ordered on export?
Moderator: Oleg
Re: San Andreas - Materials re-ordered on export?
the exporter checks objects one by one starting from top-most element and diving into its children hierarchy; With every object it checks polygons from #0 to #N and collects materials they use. The order of appearance of materials collected this way is the order of materials exported.
If you have some specific transparent material you want to be exported later, it should not appear in your hierarchy for as long as possible (move associated object down in a hierarchy).
If some object material is exported later than it should (after some transparent material), then it worth to make this material be "found" a little earlier than the transparent material. For example, you can add a tiny triangle in the topmost object (chassis) and hide it somewhere inside of other geometry; assign the problematic material onto this triangle. On export, this material will be found "earlier" than other materials and will be exporter in top-set of your materials list.
If you have some specific transparent material you want to be exported later, it should not appear in your hierarchy for as long as possible (move associated object down in a hierarchy).
If some object material is exported later than it should (after some transparent material), then it worth to make this material be "found" a little earlier than the transparent material. For example, you can add a tiny triangle in the topmost object (chassis) and hide it somewhere inside of other geometry; assign the problematic material onto this triangle. On export, this material will be found "earlier" than other materials and will be exporter in top-set of your materials list.
Re: San Andreas - Materials re-ordered on export?
I see. Thank you, Oleg. I'll take this into account to change the order of material appearance.