Home Technical Talk

Directory path question

Seems like it should be simple, but in maxscript how can I tell a script I’m working on to run the functions from a directory in the same folder without having to type the entire absolute path?

For example:

myScript_main.ms //How can I tell this script to read a directory in the same folder no matter what machine it’s on?
source directory > myScriptFunctions.ms

This is obviously wrong, but this was the idea:
include “/source”


Thank you!

Replies

  • theStudent
    Options
    Offline / Send Message
    I see this in the docs:

    fileIn "$scriptSource\myScriptFunctions.ms"

    But according to the docs, that evaluates the entire file.

    I'd like to use include instead as in C, but doesn't seem to work.

    include "$scriptSource\myScriptFunctions.ms"
  • theStudent
    Options
    Offline / Send Message
    Here's another thought. But again, does not work. Any ideas?

    mainScript = getThisScriptFilename()
    strippedPath = pathConfig.removePathLeaf mainScript
    newPath = strippedPath + "\\sourceDir\\sourceScript.ms"

    include newPath




    EDIT:
    My bad, got it figured out.
    include "sourceDir\\sourceScript.ms"
Sign In or Register to comment.