Incremental Save

50 votes
Date Updated: 
Author Name: 

It's a my super slim version with similar functionality to the Martin Breidt script, that saves incremental file versions while keeping the name of the latest - most-up-to-date version always the same as the original file. This is good for XRef'ing because the filename does not change.

Additional Info: 
macroScript incrementalSave category:"Tools" internalCategory:"Tools" toolTip:"Incremental Save" buttonText:"Incremental Save"
    if maxFileName != "" then (
        max saveplus
        TheFile = maxFilePath + (trimRight (getFilenameFile maxFileName) "1234567890") + ".max"
        if doesFileExist TheFile do deleteFile TheFile
        copyFile (maxFilePath + maxFileName) TheFile
    ) else checkForSave()

Typical/normal macroScript installation (assign it to hotkey/menu)

I.S. designed to serves as a replacement of the default incremental saving routine. The base trick is simple - I.S. made a copy of the last saved version and rename it by removing trailing numbers from its name, so your initial file is always up-to-date.

Usage: Only one important note (!):
If the initial/original file has not number at the end of its name (e.g. "scene.max") then the first incremental save (e.g. "scene01.max") will overwrite the original file. Next saves goes as intended.

And... Always test how works your all new scripts before start to use it in production!

Version Requirement: 
Incremental_Save.mcr1.43 KB


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anubis's picture

sorry for delay to reply, i was a bit busy

about the old question - its a matter of usage, i think, once you save what you like via save selected command, just load this newly created scene and then use the current script to increment.

as for the new question - its a bit of custom/personal wish and will complicate the script for the rest users.

well, if you like to talk more about for your own script modification, just contact me via email.

my recent MAXScripts RSS (archive here)

crystal3d's picture

is there a way to make it

save the base version (without trailing numbers) to one upper directory?

crystal3d's picture

yes, that was abit off the chart.

so back to the "save selected incremental."

i think the selected file's name should be decided by the native 3dsmax save file menu.

in a simple scenario.

i make a box and ,use save selected incremental script, a save dialog pops up, just like when try to open a file or save a file or like a save as.,, like the one above :)
then i click a file to get it's name (just like in normal)

then it overwrites that file, but also saves that selected object + 01
if there is 01, then 02 etc...

Anubis's picture

hmm, wait a min...

i start to lose focus :)
1st you ask for Incremental-Save-Selected, right?
so wich file name will use to increment depends on that you'll select in the SaveAs-dialog before press Plus-buton.
and as for xref scenes - you can't select them anyway, so they are out of scope for SaveSelected command.
or maybe i not get it :)

my recent MAXScripts RSS (archive here)

crystal3d's picture

but that will only increment the last file and the first file

would get obsolete.
your script overwrites the first main file aswell...which is actually the only point of having a script!

another thing,which is really important to me and some others.,

can you make it
disable active xref scenes from file
run these current actions (the current incremental save scripts2 actions)
reactivate the disabled xref scenes.

that way, it will be perfect for teams that use xref more double lights cameras :)

ps: ignore camera and lights option does not affect scenes with nested xref scenes.

Anubis's picture


its possible to be scripted - reading recent saved .max file from the ini and sending that file name to the dialog via windows callback (DialogMonitorOPS), but actually, you dont need script at all for this action. Both save commands File/SaveAs and File/SaveSelected popup the same SaveAs-dialog which has Plus-button, and all what you need to do before presing that Plus is to select your last .max scene inside that dialog ;-)

my recent MAXScripts RSS (archive here)

crystal3d's picture

sure, if i assume alt+s is the shortcut key.

Upon pressing alt+s, a menu appears and has these options:

A name entry box that asks the desired name, the trick here is it recalls the last saved filename, so that you can edit only the needed part. underneath it is the path entry and a dropdown-box which you can recall some previous paths.


if it s possible, i would be much better if you could replace the original incremental save button.


Anubis's picture


At first am too thought to made the macro works as you wish using saveMaxFile function, but simplifying the procedure make me feel more safety, because the chance for future issues grow up with complexity.

my recent MAXScripts RSS (archive here)

Massemannen's picture

Hehe, thanks for the fine

Hehe, thanks for the fine description. That is exactly what I´m after and that´s why I want this script... But after reading the description a couple of more times I think I have misunderstood the script. Sorry about that!
I thought that you kept working with Foo.max and every time you make an it creates an copy, Foo_01.max; Foo_02.max and so on... That´s how it works in many for example CAD programs. The benefit with that is that you don´t have to keep track of the latest file number, say Foo_32.max, but can always work with Foo.max and never worry about the version numbers.


Edit* Found that Martin B script does exactly what I´am after*
Thank you so very much for your time and effort!

Anubis's picture


Maybe something within the usage or misunderstanding ... so I'll explain the idea once again. The goal is to have a scene w/o changing it name (to simplify xrefing) + to keep that file as most up-to-date copy at the same time, and simply that macros achieve this aim by making a copy (backup) of you last incremental save but w/o digits trail. So if you have scene named Foo.max, after each inc-save your last Foo##.max (loaded and active) is exact the same as your Foo.max. Or in other words, after each inc-save, your Foo.max is updated.


my recent MAXScripts RSS (archive here)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.