Not signed in (Sign In)

Discussion Tag Cloud

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorPhyter
    • CommentTimeJul 5th 2015
     
    It's been forever since I've posted anything on NLE so it's about time I share something. I wrote this Max script a while back and thought it might be useful to those few of you using NL2 Pro and 3D Studio Max. There is nothing fancy going on here, but you can mod this to loft, array or whatever you need.

    If you use Max but are not familiar with MAXScript, simply open MAXScript->New Script and paste the code below into the window. Modify the file path ("C:\spline.csv") to point to your CSV file, then hit CTRL+E, or Tools->Evaluate All.


    (
    scaleFactor = 39.37 as double

    ss = SplineShape pos:[0,0,0] rot:[0,0,-90]
    addNewSpline ss

    trackCSV = openfile "C:\spline.csv"
    if (trackCSV != undefined) then (
    skiptonextline trackCSV
    while not eof trackCSV do (
    LineNum = readvalue trackCSV as integer

    PosX = readvalue trackCSV as double
    PosY = readvalue trackCSV as double
    PosZ = readvalue trackCSV as double

    FrontX = readvalue trackCSV as double
    FrontY = readvalue trackCSV as double
    FrontZ = readvalue trackCSV as double

    LeftX = readvalue trackCSV as double
    LeftY = readvalue trackCSV as double
    LeftZ = readvalue trackCSV as double

    UpX = readvalue trackCSV as double
    UpY = readvalue trackCSV as double
    UpZ = readvalue trackCSV as double

    format "Line = %\nPosX = %\nPosY = %\nPosZ = %\n" LineNum PosX PosY PosZ

    addKnot ss 1 #smooth #line [PosZ * scaleFactor, PosX * scaleFactor, PosY * scaleFactor]
    )
    )
    else
    (
    messageBox "Open Failed" title:"Error!"
    )

    updateShape ss
    )
    •  
      CommentAuthorrcth
    • CommentTimeJul 5th 2015
     
    Can this be used to export the track itself to 3D Studio Max?
    • CommentAuthorJetPulse
    • CommentTimeJul 5th 2015
     
    If I make a ride in FVD++, I use NL1 and construction kit to move geometries over. However, I regularly use a nearly identical script to move track geometries into 3ds Max as well. As a slight edit, if you replace
    trackCSV = openfile "C:\spline.csv"
    with
    trackCSV= getOpenFileName caption:"Select a .csv file to import" filename:"*.csv" types:"csv|*.csv"
    then when you run the script, an "open file" dialog box will pop up and you can select the proper csv file. This way you don't have to change the script to open different files.
    •  
      CommentAuthorrcth
    • CommentTimeJul 7th 2015
     
    I've tried this out a few minutes ago.

    ¤ It only shows a red line of the track. How can I make it possible to see the entire track itself?
    ¤ It doesn't work with switches. Now it only exports half of my track.
    •  
      CommentAuthorgeforcefan
    • CommentTimeJul 7th 2015 edited
     
    Posted By: rcth¤ It only shows a red line of the track. How can I make it possible to see the entire track itself?


    Seriously? Its a CSV -> Spline export... What did you expected :D ? You need to make your own model... But this script will only as far as I see export only the coordinates... I don´t know how to get the Banking in Max...
    •  
      CommentAuthorPhyter
    • CommentTimeJul 9th 2015 edited
     
    @JetPulse Thanks for the tip! Admittedly I'm still very much a noob with MaxScript.

    @rcth I totally understand where you're coming from, especially given the days of Tia's NL1 track exporter/converter. But I'm not concerned about the shortcomings of this tool. This is something I wrote for a contract where I was hired to create an overworld for a real-world park. This park had a number of tracks traveling over and under very intricate paths and it simply would have been impossible for me to create those scene elements using overlays from screenshots and height measurements from the NL2 editor. What I needed was the 3D spline paths themselves positioned relative to the center of the work area. With that in mind I created this script. Run the script for each CSV exported from your park and then build your scene around the splines. When you export the entire scene (minus the splines of course) and then import it into NL2 (setting position to 0,0,0) you basically have a 1-to-1 workflow between Max and NL2. How can you possibly beat that!? :D

    For large projects with tight integration something like this is indispensable. Not just a huge time saver but it allows for optimizations that you couldn't do any other way.

    Technically it should be possible to add banking. The track orientation is exported with the CSV. I'm not anywhere near familiar enough with MaxScript to program that without a lot of research, so I leave that to you or others to figure out.
  1.  
    I could probably modify this and make a python script for blender to make it easier for people to make track.. Might take a shot at it
    •  
      CommentAuthorgeforcefan
    • CommentTimeJul 9th 2015 edited
     
    •  
      CommentAuthorrcth
    • CommentTimeJul 10th 2015
     
    @Phyter: Yes, I understand. However, for things like a station, it would be nice to have the real size of a track, so it would fit nicely. But since this is not possible, what would you suggest for stations/custom catwalks etc.?
  2.  
    ^^when did you do this???
    •  
      CommentAuthorgeforcefan
    • CommentTimeJul 12th 2015
     
    ^ just a few days ago. Why?
  3.  
    It's the best thing since sliced bread
  4.  
    Wow, this is great. Had a quick play around with in Blender, and it works brilliantly.
    •  
      CommentAuthorzampano
    • CommentTimeOct 5th 2016
     
    Hm, is there a way to get the orientation right in max?
    I figure it could be possible by using both "the center of rails" spline and the "editor spline", but since I have no clue of maxscript whatsoever I can't really do anything with that idea...