PDA

View Full Version : Get the current .max file name


Floating_Inkpot
01-29-2009, 09:46 PM
Hi,
Is it possible to find the current .max file name ?

lets say i have a scene called "MyScene.max"
I search something that can return something like that :
"C:\3dsmax_scenes\MyScene.max"

Thanks,

JHaywood
01-29-2009, 10:04 PM
(maxFilePath + maxFileName)

antonv
01-29-2009, 10:09 PM
Straight from the reference:
3ds Max System Globals3ds Max System GlobalsmaxFileName

Contains a String value that defines the file name for the currently open scene. This variable is read-only.

maxFilePath

Contains a String value that defines the directory path for the currently open scene. This variable is read-only.

Also you should search the reference for "file name parsing".

Hope this helps!

Floating_Inkpot
01-29-2009, 11:10 PM
thanks its exactly what i was looking for :p

I searched the reference about 1 hour without finding anything :s i guess i didn't look at the right location ^^

Bobo
01-29-2009, 11:27 PM
thanks its exactly what i was looking for :p

I searched the reference about 1 hour without finding anything :s i guess i didn't look at the right location ^^

Did you look under Frequently Asked Questions? ;)

"How do I get the file name of the current scene?"

A user asked:

I can't seem to find a function for grabbing the name of the currently open maxfile!


Answer:

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!

To get the complete scene file name, you can use

EXAMPLE



sceneName = maxFilePath + maxFileName





If the scene does not have a name yet (Untitled), both will return an empty string "".

These global variables are documented under the letter M in the topic 3dsmaxSystemGlobals

SuperRune
09-23-2009, 07:38 AM
I've spent the last half hour looking for this too, so forgive me for this rant. The maxscript documentation is great, but whatever engine is powering the help is not!

Type in "max filename", "scene filename" or "max filepath" into the Search window (those are the words I tried), and you will have a hard time finding what you search for. I find myself using the CGTalk search several times a day to find the exact keyword, and then returning to the Maxscript help to narrow down the search.

Bobo
09-23-2009, 02:35 PM
I've spent the last half hour looking for this too, so forgive me for this rant. The maxscript documentation is great, but whatever engine is powering the help is not!


That's true, unfortunately. Google it is not.
I am in the process of upgrading my hardware and software at home, and you have no idea what problems I am having getting RoboHelp to work on my new system.
At this point, it looks like the next version of the Help will be written on my 6 years old 32 bit machine because that's the only place it works reliably. I am waiting to see if Adobe will be able to figure it out. But to be realistic, RoboHelp was written in the end of last millenium, then acquired by Macromedia, in turn acquired by Adobe, and the core of the software has barely changed. So it would require a complete switch to some other authoring tool (not gonna happen) to get better search.
For this specific case, I will try to add more links from related topics because the search returns the results you wanted as relevance #14 and #101 and that is unacceptable. I can also try to tweak the wording within the document to get the relevance higher. But I cannot do this for every topic because there are so many.
Oh well.

SuperRune
09-23-2009, 03:31 PM
Thanks a lot for the reply Bobo. Sorry if I sounded overly negative, but it's a bit frustrating to spend so much of the time trying to find the exact keyword. It feels like a weird psycho-wordgame at times.

I'm just guessing now, but is the chm format some sort of a compilation of HTML-files? Would it be possible to upload the original files to the web and let Google handle them?

Bobo
09-23-2009, 03:47 PM
Thanks a lot for the reply Bobo. Sorry if I sounded overly negative, but it's a bit frustrating to spend so much of the time trying to find the exact keyword. It feels like a weird psycho-wordgame at times.

I'm just guessing now, but is the chm format some sort of a compilation of HTML-files? Would it be possible to upload the original files to the web and let Google handle them?

CHM is Microsoft's Compiled HTML format for help files. In fact, the search problems might be related to it, the main trouble with the authoring software is the keyword generation (I had to jump through hoops to make it work a bit better in the last couple of years).

The source of the Help files is property of Autodesk. What can and cannot be done with it is their call. I just write and deliver the documentation. The Main Max Help is authored with a different package, but it is not an option to switch for historical reasons. I have been asking for a Wiki-like online documentation for years (and I am not alone), but no luck so far.

CGTalk Moderation
09-23-2009, 03:47 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.