MAX script Spline Track Maker

Discussion in 'Track Modding' started by Mario Morais, Nov 20, 2012.

  1. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    SplineTrackMaker , MMtools ImportGEO
    Download page
    [​IMG][​IMG] [​IMG]

    1.2d
    SplineTrackMaker
    + Road paint lines decals

    Changed PointTools to MMtool Box
    + Array Tool
    + Boolean Tool
    + Move Pivot


    Last version 1.1a
    How to install
    1- Go to MAXScript menu and select "Run Script" and chose "SplineTrackmaker_XXX.mzp" file.
    3- Go to “customize user interface” chose menu or toolbar tab. In Category select r “MMtools” and drag "trackmaker" and "PointTools" into a menu or toolbar.

    When install scripts as mzp files make sure you run 3DSMAX as administrator

    New version 1.0g
    + Easy install.
    + Add "move to spline" options in "Pointtools"
    + Some bugs fix in Trakmaker

    Spline Track Maker 1.0e
    + Can change cambers from a external line.

    Spline Track Maker 1.0d

    + Bugs fix
    + Update Track from reference spline now keeps cambers
    + Add Xobjects


    Version v 0.81
    Changes:
    Some bugs fix
    - Can update track by a reference spline.

    Version v 0.82
    - Fix lines distribution. Issues to solve : first line in middle of selection
    - build-in Better Normalize spline


    Version 0.82c
    Bug fixes and optimizations
    - Added More Spline Tools Straight Line and Equal Tangs ( Curves)

    Reset all Bezier tangents.
    “Straight Line”
    Select two bezier vertex and press “Straight Line” button several times until get a straight line.

    “Equal Tangs”
    Select two bezier vertex (start curve and finish) and press “Equal Tangs” once. Then change the value “Tangs Lens” until you get to obtain the desired curve.

    How to start a track
     
    Last edited by a moderator: Sep 20, 2014
    3 people like this.
  2. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    Last Testing Cambers

    [​IMG]
     
  3. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    Hi Mario... (question ... not about your scripts... but because of your scripting experience)

    I was wondering if you have seen this problem with maxScript: When you do heavy geometry operations for more than 7 or 8 seconds, the Max UI locks up, and an hourglass (or swirling toilet bowl in win7) happens.

    It does NOT crash.... and it finishes the script OK... and .. in my case.. cloth - morph animation loop - bone bake etc... And it exports to rF2 ok after.

    From reading (too many) forum posts, I hear that maxScript does not get very much memory.... so large geometry sets can cause this temporary MAX UI lock-up.

    For me, it is only a problem when I get up to 1000 or so vertices being baked, morphed or whatever. In my script, 1000 vertices is easy because a seamless cloth / wind animation loop requires 2 objects to morph between, and twice as many animation frames.... more than you eventually export to rF2....

    In windows Task Manager you can see how maxScript only uses one processor core (the other 7 idle... and lonely).

    So.. I tried using a 'synchronizing background worker' thread.... it uses a separate processor core... ok.... IF you are only doing Math.

    IF you try to do any geometry changes on the background thread, Max Crashes. I have read posts from people that have found this same problem on many forums.

    I now am going to port my script into a plug-in so I won't have the memory problems. There are several dotNET wrappers for the SDK, so all of the core Max API has been exposed.

    That means with visual studio, you can write in any dotNET language, have full use of max (and your pc's memory and processor cores). I'm going to use C# because of the parallel.for loops, and other nice multi-core things I've done in .net framework 4. You can also load and unload your dll without restarting max or vs while debugging.

    Anyhow... just curious if you tried to make a VERY LARGE bunch of geometry with your fine scripts... do you ever find max display lock-up ?

    Obrigado in advance,
    bink
     
  4. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    yes UI lock-up a lot.

    I use disableSceneRedraw()/EnableSceneRedraw() to speed calcs and geometry changes.

    can increase memory for maxscript add more to heapSize (heapSize += 2000000 more 2mb)

    can clean memory before if use large arrays or bitmaps ( gc [light:false] [delayed:false] )

    I never create a plugin but I thought it was only in C++ can be done in C#?
     
  5. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    more test and improvements
    [​IMG]
     
  6. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    Yes (about C#). Any language that dotNet will compile is OK.

    I use max 2011... so I am going to use MAX.Net to get me started. It is GNU... so free.

    There is also the (now free) maxSharp from autodesk...

    And if you are on 3dsMax 2013, then I'm pretty sure I read it comes with a complete dot.Net version (or wrapper) of the plugin SDK.... with the whole C++ SDK (core max functions) available to dot.Net languages.... so ANY language that visual studio 10 will compile (C#, J#, VB, C++/CLI, certain python & ruby implementations etc...)

    Of the dot.Net languages, I have seen the most information and tutorials on max plugins with C#... and I have spent time with C#.... so that the direction for me.


    edit: I also tried with redraw off ( .. context.. ), ... also undo off context.... and stay away from the modifier panel when possible....
    but always UI lock-up after 8 sec..... (also maxScript progressBar stops!) The user can not know if the script has crashed or not until it is finished..... or until it never finishes.

    Thanks for confirming the maxScript display lock up problem. Good to know we are not alone.
    bink
     
    Last edited by a moderator: Nov 24, 2012
  7. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    Thanks for the info about MAX.Net.
    i have some things in C# so maybe is the solution for Point Cloud in max.
    I use max 2010 32bits
     
  8. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    I get some time and improved the script.
    much better now.
    -Support opentrack
    -Auto detect splines and vertex selection
    -spline vertex clipboard
    [​IMG]
     
    1 person likes this.
  9. JJStrack

    JJStrack Registered

    Joined:
    Dec 23, 2011
    Messages:
    469
    Likes Received:
    9
    Hey Mario,
    this looks great! But where can i find the download to it? Would love to give it a try!
    On the original Dropbox download i get the 404 Error - file not found
     
  10. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169

    v 0.7 link ready.
     
  11. JJStrack

    JJStrack Registered

    Joined:
    Dec 23, 2011
    Messages:
    469
    Likes Received:
    9
    umm..yeah, the download works, but somehow after i run the script, i can't find it in the "customize UI" Menu...neither is there a category "MMtools", nor a category "Track Maker".
    Any help? And BTW: is that the version with the latest improvements?
    Thanks for your help Mate!!
     
  12. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169

    yes the category is "MMtools" when install a macro script open it with notepad and on top see category and name.

    latest improvements are reserved for now sorry.
     
  13. JJStrack

    JJStrack Registered

    Joined:
    Dec 23, 2011
    Messages:
    469
    Likes Received:
    9
    Yes, i know that, but in 3ds Max i can not see this category! So i can not use this script
     
  14. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    don't see? hum let me see..
     
  15. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169


    the script is fine.. You must run the script one time then go customize.
     
  16. JJStrack

    JJStrack Registered

    Joined:
    Dec 23, 2011
    Messages:
    469
    Likes Received:
    9
    i did that. seems like it doesn't work for me. I use 3ds MAX 2011.
     
  17. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    try to run a normal script

    remove on top

    Code:
    macroScript TrackMaker
    	category:"MMtools" 	
    	buttonText:"TrackMaker" 
    	toolTip:"Track Maker"
    (
    and
    the last
    Code:
     )
     
  18. JJStrack

    JJStrack Registered

    Joined:
    Dec 23, 2011
    Messages:
    469
    Likes Received:
    9
    ok, got it working that way. But it didn't like a spline i wanted to use with it:
    View attachment 4931
    Seems like my spline had to many vertices on it (it had about 3000 :rolleyes:). With less complicated splines it works.
    I am very much looking forward to your new functions on it. i need the possibility to give different cross sections different camber and width to make a track with this.
     
  19. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    the v0.7 only works close spline!

    and try first a short spline!

    When normalize Spline use large distance to generate less vertex then in some turns can add cross splines by hand
     
  20. vicent-sollana

    vicent-sollana Registered

    Joined:
    Jan 21, 2012
    Messages:
    416
    Likes Received:
    17
    Thanks mario for this script is very usefull
     

Share This Page