Notifications
Clear all

[Closed] Currently open Max file path

Hi,

I’m wondering if there’s an “elegant” way to get the path of the currently opened Max file.
I’ve already found a dirty way to do so by looking in the 3dsmax.ini file and getting the last opened Max file path, but it could be problematic if for some reason there’s no Max files list…

Thanks

4 Replies

isn’t

maxfilepath

what you’re looking for?

Thanks, i didn’t found it in the Maxscript reference.

2 Replies
(@bobo)
Joined: 11 months ago

Posts: 0

Quote from the MAXScript Reference:


[color=white]How do I get the file name of the current scene?[/color]

[left]MAXScriptFrequently Asked Questions
[/left]
[color=white]A user asked:[/color]

[left]I can’t seem to find a function for grabbing the name of the currently open maxfile!
[/left]
[color=white]Answer:[/color]

[left]The file name of the currently loaded scene can be accessed via the System Global Variable maxFileName. The path of the current scene is accessible through maxFilePath. Both variables are read-only!
[/left]
[left]To get the complete scene file name, you can use
[/left]
[left]For example
[/left]
[left]sceneName = maxFilePath + maxFileName
[/left]
[left]
[/left]
[left]If the scene does not have a name yet (Untitled), both will return an empty string “”.
[/left]
[left]These global variables are documented under the letter M in the topic 3dsmaxSystemGlobals
[/left]
[left]
[/left]
[left]See also
[/left]
[left]3ds Max System Globals
[/left]
[left]3ds Max File Loading and Saving
[/left]
[left]Frequently Asked Questions


[/left]

(@f97ao)
Joined: 11 months ago

Posts: 0

Bobo, if you are still helping Autodesk with the manual could you make this information a little easier to find. For example add it to the Standard Open/Save Dialogs, or File in 3ds Max. I searched on an hour before giving up and looking here at CGTalk.

/Andreas