San Andreas - Materials re-ordered on export?

GTA San Andreas and GTA Vice City discussion.

Moderator: Oleg

Carlos85G
Posts: 7
Joined: Wed Mar 22, 2023 7:20 am

San Andreas - Materials re-ordered on export?

Post by Carlos85G »

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?
User avatar
Oleg
Site Admin
Posts: 14276
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: San Andreas - Materials re-ordered on export?

Post by Oleg »

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.
Carlos85G
Posts: 7
Joined: Wed Mar 22, 2023 7:20 am

Re: San Andreas - Materials re-ordered on export?

Post by Carlos85G »

I see. Thank you, Oleg. I'll take this into account to change the order of material appearance.
Post Reply