Notifications
Clear all

[Closed] Open method detection – Render size presets

We are writing a little maxscript tool (primarily as a learning execerise) and have run into a couple of problems that we have been unable to figure out or find documentation for. I would be greatly appreciative if anyone might be willing to help us solve these two problems;

1- Getting a maxscript in the startup folder to determine whether it is max opening to a blank scene or whether the user has opened the scene through Windows.(ie whether opening the program through the exe [or shortcut] or by opening an existing scene via Windows explorer). Of course the easiest way around this is to put the script in a folder that is only loaded by specific Windows 3dsmax.exe shortcuts, that have the scripts folder listed in the shortcut’s specific ini file, however we hope to share the script once complete and having a seperate ini means that it needs manual update every plugin addition/upgrade.

2- The syntax for calling the predefined output size that are displayed in the render dialogue (ie PALD1, PAL DV, Vistavision, Cinemascope, etc). Rather than specifying the renderWidth and renderHeight, etc, we are trying to get it to go to one of max’s specific predefine choices (+custom option). The only lead we have is the listing of six “PresetOutputSize” in the 3dsmax.ini (there is a lot more that six predefined output sizes). Please note we are not talking about the render presets (rps files).

I hope someone can help so keen, abliet struggling, scripters.

Thanks in advance.

5 Replies

as for #1, i could only suggest using the “maxfilename” function, if a scene is opened, it would return the max-file-name, and if its a new max scene, it would return “untitled”, you could use it for checking i suppose…

i’ll try to look for #2 in the docs… (i cant open any window rigth now as im doing preview rendering… heheh)

hope this helps

Thanks galagast.

Works like a treat. Just nested the whole script in an if statement testing on maxfilename = “”

It seems so logical now, but we totally missed it from the inside.

Cheers

Actually, the above method of detection the open method doesn’t work if anything delays the startup process, or if loading large files. So effectively it doesn’t work.

Damn.

Does anyone have any other suggestions?

hmm… im not sure if this will work…

you may be able to place a callback script in your startup folder that calls the #filePostOpen notification before checking its maxfilename… this way, the checking will only occur after the user loads the file, no matter how large it is…

just my two centavos…

hope this helps.

Thanks again galagast.

However my comments on the problems with your first suggestion were actually incorrect. Opps.

The problem stems from 3dsmax always loading an “untitled” scene when starting max (ie it will always return true for the maxfilename initially opened == “untitled”).

This problem persists with #filePostOpen, so it will always return true for name == “untitled”, even if you open a named file. (It will just return a second value of false). Same for #postSystemStartup.

Thanks for the suggestion though.