GEORGE include file

Share your custom panels, brushes, papers... (you need to be registered to read posts in this section)
Post Reply
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

GEORGE include file

Post 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
Attachments
Include.grg
(21.5 KiB) Downloaded 266 times
Last edited by Mads Juul on 05 Apr 2015, 07:44, edited 3 times in total.
User avatar
NathanOtano
Posts: 1209
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: GEORGE include file

Post 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.
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: GEORGE include file

Post 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
User avatar
schwarzgrau
Posts: 1238
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

Re: GEORGE include file

Post 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
Windows 11 22H2 / TVP 11.7.0 PRO WIBU / Cintiq 22HD
Windows 11 22H2 / TVP 11.7.0 PRO WIBU / Mobile Studio Pro 16" (2019)
Android 13 / TVP 11.7.0 / Galaxy Tab 7 FE
INSTAGRAM
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: GEORGE include file

Post 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
Last edited by Mads Juul on 05 Apr 2015, 11:33, edited 1 time in total.
User avatar
schwarzgrau
Posts: 1238
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

Re: GEORGE include file

Post by schwarzgrau »

Great you can customize it that way. Thank you Mads
Windows 11 22H2 / TVP 11.7.0 PRO WIBU / Cintiq 22HD
Windows 11 22H2 / TVP 11.7.0 PRO WIBU / Mobile Studio Pro 16" (2019)
Android 13 / TVP 11.7.0 / Galaxy Tab 7 FE
INSTAGRAM
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: GEORGE include file

Post by Mads Juul »

you're welcome
User avatar
schwarzgrau
Posts: 1238
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

Re: GEORGE include file

Post 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?
Windows 11 22H2 / TVP 11.7.0 PRO WIBU / Cintiq 22HD
Windows 11 22H2 / TVP 11.7.0 PRO WIBU / Mobile Studio Pro 16" (2019)
Android 13 / TVP 11.7.0 / Galaxy Tab 7 FE
INSTAGRAM
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: GEORGE include file

Post 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
User avatar
schwarzgrau
Posts: 1238
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

Re: GEORGE include file

Post by schwarzgrau »

oh that's fine with me, I can add a V for version. Thank you Mads.
Windows 11 22H2 / TVP 11.7.0 PRO WIBU / Cintiq 22HD
Windows 11 22H2 / TVP 11.7.0 PRO WIBU / Mobile Studio Pro 16" (2019)
Android 13 / TVP 11.7.0 / Galaxy Tab 7 FE
INSTAGRAM
Post Reply