Page 1 of 1

GEORGE include file

Posted: 11 Nov 2014, 12:38
by Mads Juul
Here is an include file with the george commands listed here http://wiki.tvpaint.fr/index.php?title= ... _Reference


---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"
4) In tvpaint make a new custom action in a custom panel.
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)
let's say we want to increment a file like this

Code: Select all

 test1_01.tvpp
I go through each variable
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

Re: GEORGE include file

Posted: 11 Nov 2014, 12:50
by NathanOtano
Thank you! Reaaaaally nice to have it ready to use. I already included your homemade procedures in my scripts but i just wanted to say thank you for all of this :) if you update something just tell me.

Re: GEORGE include file

Posted: 11 Nov 2014, 12:57
by Mads Juul
NathanOtano wrote: if you update something just tell me.
I will. I made 2 changes today so I will post them in a reply in this thread something like

//****CHANGELOG 2014-11-11

string_addZeros(prefix,string,length)
Second parameter can be a string instead of an integer with letters before and after string
string_addZeros("/","m1j",5) will return "/m00001j"

project_incrementalSave(divider,part,ask,minimumDigitLength)
project name can start with a number like "0001_v01.tvpp" without the leading zeros disappear when saving

Re: GEORGE include file

Posted: 04 Apr 2015, 12:42
by schwarzgrau
My file is called, test1_01.tvpp and if I use the button it gets saved under the same name. Is there any naming convention I should follow?
By the way if I try 007_atThePark_v006_L.tvpp it gets saved as 007_atThePark_v007_L.tvpp

Re: GEORGE include file

Posted: 05 Apr 2015, 07:41
by Mads Juul
schwarzgrau wrote: Is there any naming convention I should follow?
Yes the function project_incrementalSave is called with 4 variables

Code: Select all

project_incrementalSave(divider,part,ask,minimumDigitLength)
so let's say we want to increment a file like yours

Code: Select all

  test1_01.tvpp
I go through each variable
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 let's say we have your file name 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"
Hope this helps.
Kind Regards Mads

Re: GEORGE include file

Posted: 05 Apr 2015, 10:49
by schwarzgrau
Great you can customize it that way. Thank you Mads

Re: GEORGE include file

Posted: 05 Apr 2015, 11:33
by Mads Juul
you're welcome

Re: GEORGE include file

Posted: 07 Jun 2015, 11:21
by schwarzgrau
I got the filename Ausstieg_04_01.tvpp and my george-script looks like this

Code: Select all

project_incrementalSave("_",3,1,2)
#INCLUDE "Include.grg"
If I use my increment and save button the new file-name is Ausstieg_4_02.tvpp what is completely correct, but the leading zero in front of the four gets cut away. Is there a way I can keep this zero?

Re: GEORGE include file

Posted: 07 Jun 2015, 13:44
by Mads Juul
schwarzgrau wrote:I got the filename Ausstieg_04_01.tvpp and my george-script looks like this

Code: Select all

project_incrementalSave("_",3,1,2)
#INCLUDE "Include.grg"
If I use my increment and save button the new file-name is Ausstieg_4_02.tvpp what is completely correct, but the leading zero in front of the four gets cut away. Is there a way I can keep this zero?
unfortuanately it It looks like a bug in the script. So you would have to put a character infront to keep the zero

Austeig_s04_02.tvpp

-Mads

Re: GEORGE include file

Posted: 07 Jun 2015, 13:51
by schwarzgrau
oh that's fine with me, I can add a V for version. Thank you Mads.