incrementalSave

57 votes
Version: 
0.61
Date Updated: 
08/28/2017
Author Name: 
Martin Breidt

This macroscript is a replacement for the save function. It 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. Just add it to your File menu and/or define Ctrl+S as shortcut.
New: Old file versions will now be saved to a subdirectory
v0.61 update: Bug fix to handle non-standard number prefixes; small improvements to the UI and error messages

Version Requirement: 
4+

Comments

Comment viewing options

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

Incremental save, the great

great job

toondek's picture

Works Perfectly. Thanks you

Works Perfectly.

Thanks you !!

Martin Breidt's picture

You're not supposed to

You're not supposed to drag-and-drop the code into a toolbar. This will wrap the code in yet another macroscript block, which causes the error.
Instead, just execute/run the code, then go to Customize UI and search in the "MB Tools" category for the action.

toondek's picture

Assign to Toolsbars

Hi,

Very usefull script, thanks for sharing it !!!

I have just one problem, i can't assigned the scrip on a new toolbars.
I am using Max 2011, and when i select the text of the script and try to drag and drop it to the new toolbar i have just create for before, i have this error message:

Am i doing something wrong??

AttachmentSize
error.jpg 25.64 KB
crystal3d's picture

very usefull script but

cant use it for my workflow unfortunately.

See i dont use saving files with their sccene properties cause it saves the enviroment properties, material editor etc. also...

what i do is always use "save selected" feature. , or the convert selected to xref scene feature...

 these both options open up a "save file" dialog where there is a "plus" icon to save incrementally.


 what would be the best thing is to modify that "plus" so that it executes your script instead...but no idea if it is possible.

 

and if it is not, then i kindly request a script "Incremental Save selected", (COME ON PEOPLE , WHOS WITH ME!!!) :)

Christopher Grant's picture

When we first started using

When we first started using Incremental Save I was always using the "add comments on save" option but stopped because we weren't leveraging the data. The script I'd like to have is one that'd replace the max file open dialog with one that displayed a file list and the comments associated with that file as a browser that you could quickly scroll through to find the iteration of a file you wanted before opening it.

Martin Breidt's picture

Chris, glad to hear you find

Chris, glad to hear you find the script useful.

Regarding archive location, of course each studio might have a different rule to that, so, yes, customizing the script makes sense.

Regarding file comments: That functionality is maybe already in there: Executing the script while holding down ALT (or SHIFT, depending on what version you run) will give you some options, amongst which is an "Add file comments on save" option that, when active, will prompt you for some comments to be stored with the file. Is that what you're looking for? Or do you want some automatic numbering, embedded in the file comments? That would be one or two lines of code around line 213...

Let me know
Martin

Christopher Grant's picture

I've been using this script

I've been using this script for a couple years now. It's fantastic and allows us to always have a permanent history of work. Some of our projects last a couple years too - this way we can occasionally revert to a design from months prior without any trouble.

I made a slight change to the code at work though so all increments are placed in an archive folder. So for instance - our xref files are in an xref folder and the archives of "file.max" are in xref/archive/file.max/ which makes it cleaner for us since we use it all the time.

I keep wanting to script a way to hook into the file comments to make it really easy to see how a file changed over time but just haven't had the time to do it...

Martin Breidt's picture

Simmsimaging, I think what

Simmsimaging, I think what you're seeing is 'as designed'. ;-)
The latest version will always have the same file name. The older versions will be saved with increasing version numbers.

Here's your example:
1.) Create a sphere at [0,0,0], then save as sphere.max
2.) Move the sphere to [100,0,0], hit incrementalSave. Now the file sphere.max will have the sphere at [100,0,0] and the backup file sphere_V-001.max will have the sphere at the original [0,0,0]
3.) Move the sphere to [0,100,0] and hit incrementalSave again. Now the file sphere.max will have the sphere at [0,100,0] and the backup file sphere_V-001.max will have the sphere at the original [0,0,0] and sphere_V-002.max at the second position at [100,0,0]

So the latest version is always the one with the original file name, and all old versions are save to the subfolder with increasing numbers.

Hope this helps.

Martin

simmsimaging's picture

I use this script all the

I use this script all the time and really appreciate it, but noticing some odd behavior, at least with Max2011:

If use the script it appears to save one version back from the current state, so it's always a bit behind the actual changes. Hard to explain, and not sure how it is happening. Simple test: make a sphere, hit save. move it once and use the script to save, then move again and script again. If you open the backup files the *second* saved file is actually the first, and the first looks like the original file. The second move of the sphere was not saved at all.

This can be gotten around by using the script twice in a row, but it seems odd. Happening on two different systems, and tried it in several files.

b

Comment viewing options

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