---EXAMPLE---
A project is called “007_atThePark_v006_L.tvpp” and you want to increment and save the project as “007_atThePark_v007_L.tvp”
1) Download this attached file "Include.grg" and save it in the George folder of TVpaint
2) make a textfile called "incrementalsave.grg" in the same folder
3) in "incrementalsave.grg" paste the following code
Code: Select all
project_incrementalSave("_",3,1,3)
#INCLUDE "Include.grg"
5) in this custom button choose Edit>set Script
6) Browse and select "incrementalsave.grg"
7) Press ok and save changes to Custom Action
8 ) now you have a incremental save function
EXPLANATION OF project_incrementalSave TO MAKE IT WORK WITH OTHER FILE NAMES
the function "project_incrementalSave" is called with 4 variables
Code: Select all
project_incrementalSave(divider,part,ask,minimumDigitLength)
Code: Select all
test1_01.tvpp
divider
Which divider in the file name should be used to look for the part to increment. I usually use "_" but it also could be "-" or "#"
So lin the example "test1_01.tvpp" the divider would be "_"
part
Which part of the string split by the divider should be incremented. . The base name in the example is "test1_01" so it is the second part. so the second variable should be 2.
ask
The variable could be 0 or 1. If 1 a popup appears where you have to confirm you want to save an increment. if 0 the scipt saves an increment without asking.
minimumDigitLength
so how many digits should the increment be? the example file is " test1_01.tvpp" . The part incremented is "01" so it is 2 digits . so the 4'th variable should be 2.
(Thinking about it it should be possible to get rid of this 4'th variable. but anyways as the function is now . it needs it)
this gives this code to make it work with your file
Code: Select all
project_incrementalSave("_",2,1,2)
#INCLUDE "Include.grg"
-Mads