• Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Social Media
    •   @Wings3dOfficial
    •   @Wings3dOfficial
    •   Wings3dOfficial
    •   Wings3dOfficial
  • Register
  • Login
  • Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Register
  • Login
Wings 3D Development Forum Wings 3D Programming v
« Previous 1 2 3 4
Objects exported in reverse order

 
  • 0 Vote(s) - 0 Average
Objects exported in reverse order

micheus
Offline

Forum's Admin and Support | Bug fixer
Posts: 3,681
Threads: 185
Joined: Jun 2012
#5
01-26-2013, 07:47 PM (This post was last modified: 01-26-2013, 07:53 PM by micheus.)
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:
Code:
section(F, "Objects"),
    foreach(fun (#e3d_object{name=Name,obj=Mesh}) ->
            export_object(F, "w_"++format(Name), Mesh, MatsGb),
            println(F)
        end, Objs),
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:
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),
and then you need to add the Id parameter to export_object function.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Messages In This Thread
Objects exported in reverse order - by oort - 01-25-2013, 06:33 AM
RE: Objects exported in reverse order - by micheus - 01-25-2013, 11:41 AM
RE: Objects exported in reverse order - by oort - 01-25-2013, 05:24 PM
RE: Objects exported in reverse order - by oort - 01-25-2013, 10:47 PM
RE: Objects exported in reverse order - by micheus - 01-26-2013, 07:47 PM
RE: Objects exported in reverse order - by oort - 01-26-2013, 11:26 PM
RE: Objects exported in reverse order - by oort - 01-27-2013, 02:35 AM
RE: Objects exported in reverse order - by micheus - 01-27-2013, 02:40 AM
RE: Objects exported in reverse order - by oort - 01-27-2013, 04:07 AM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode