oort, I don't think the wings_export.erl must be changed. It's working as it is - in this case. As each exporter has its particularities I believe that is our responsibility as programmer work around this kind of "problem".
I took a look at the code again (I couldn't change it and test), but - in accord with you've answered me - I believe that the meshlights are being exported in this part of the code:
foreach just call the function passing each item in its order in the list.
If you've changed the result order when changed wings_export file, it seems that you will need only to use an other "integrator" in this code above.
Try to change the code to this one:
or you can use that one already existent, but reverting the list of objects before use it:
and if you still need to change the ID sequence, you can use my first suggestion with some small changes to the code:
and then you need to add the Id parameter to export_object function.
I took a look at the code again (I couldn't change it and test), but - in accord with you've answered me - I believe that the meshlights are being exported in this part of the code:
Code:
section(F, "Objects"),
foreach(fun (#e3d_object{name=Name,obj=Mesh}) ->
export_object(F, "w_"++format(Name), Mesh, MatsGb),
println(F)
end, Objs),
If you've changed the result order when changed wings_export file, it seems that you will need only to use an other "integrator" in this code above.
Try to change the code to this one:
Code:
section(F, "Objects"),
foldr(fun (#e3d_object{name=Name,obj=Mesh}, _) ->
export_object(F, "w_"++format(Name), Mesh, MatsGb),
println(F)
end, [], Objs),
or you can use that one already existent, but reverting the list of objects before use it:
Code:
section(F, "Objects"),
foreach(fun (#e3d_object{name=Name,obj=Mesh}) ->
export_object(F, "w_"++format(Name), Mesh, MatsGb),
println(F)
end, reverse(Objs)),
and if you still need to change the ID sequence, you can use my first suggestion with some small changes to the code:
Code:
section(F, "Objects"),
foldr(fun (#e3d_object{name=Name,obj=Mesh}, Id) ->
export_object(F, "w_"++format(Name), Mesh, MatsGb, Id),
println(F),
Id+1
end, 0, Objs),