Home Technical Talk

check maxscript compatibility

polycounter
Offline / Send Message
rollin polycounter
heyho,

does somewhere a tool exist which allows to check a maxscript code for compatibility around all different max versions? Something that can crawl through the code to tell me whats the oldest version of max that allows to run this script?

I'm missing something like the "save as - for flash version xy" functionality from flash.

Replies

  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    highly doubtful, I think there is barely editors with code completion (which assumes up-to-date syntax files)... if there was an easy way to generate that from the maxscript helpfiles, one could at least check function names... but that also assumes a parser that extracts functionnames from given code... sounds like too much work for such a specific task, when most script work is probably just inhouse and has to work from version X on.
  • rollin
    Options
    Offline / Send Message
    rollin polycounter
    it would be great if max had a build in checker .. but I guess it's against autodesk's strategy ;)

    thx anyway !
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Not really the same thing, but what I've done in a few of my scripts is have different code paths for different versions.

    There's a simple maxscript function to get the version of Max that is running, and then your script can either give a warning about a version if it's too low to work with your script.

    Or you can have it do different things depending on what version number is returned - eg. they added some stuff in Max 2008 that wasn't there in Max 8/9, but it was easy to write a utility function, so I had it use the Max 2008 in-built method if the version was right, and used my own utility function for backwards-compatibility with older versions.

    That doesn't really do what you wanted but it should mean you can bullet-proof your own scripts to make sure they can't be run on old versions of Max which don't have in-built functions you're relying on.
  • rollin
    Options
    Offline / Send Message
    rollin polycounter
    hey mop

    thats a cool tip, thx!
  • SyncViewS
    Options
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi, I got this under my fingers right now to avoid WorkingPivot stuff in 3ds Max 9:
    -- Example:
    local workTM = Matrix3 1
    if (((maxVersion())[1] / 1000) > 9) do
        workTM = workingPivot.getTM()
    

    Where ((maxVersion())[1] / 1000) returns 3ds Max version as integer:
    version -> return
    9 and 9,5 (productivity booster) -> 9
    2008 -> 10
    2009 -> 11
    2010 -> 12
    ...
    
Sign In or Register to comment.