Help making an action to modify the size of a project. Topic is solved

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
User avatar
daninski
Posts: 289
Joined: 01 Oct 2015, 12:13
Location: Budapest/Newport
Contact:

Help making an action to modify the size of a project.

Post by daninski »

Hi,]

I have a couple of hundred shots I need modify. I'm thinking a george script would work for this, but I've run up against a problem.
I can select clip and turn it into a project, and then save it, but I can't work out how to modify the size of the project to 4096 x 2160 as 12 fps.

Can someone help with this bit please?

Thanks,

Dan

PS I also need help resetting the camera to the project size!
http://www.daninski.com
Award winning director with an iMac from about 2013 and a cintiq from about 2009, there's some RAM too.
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Help making an action to modify the size of a project.

Post by Svengali »

In the GEORGE command documentation for TVPaint 11, I see the following commands which you might want to experiment with:

========================================
tv_resizepage iWidth iHeight 0|1|2

Create a new resized project and close the current one

[PARAMETERS]
iWidth int The width
iHeight int The height
0|1|2 enum The way the content will be processed
_ 0: empty
_ 1: crop
_ 2: stretch

[ERROR]
"ERROR -1" string Can't create a new project

------------------------------------------------------------------------------------------------------

tv_projectduplicate

Duplicate the current project

[RETURN]
oProjectId string Id of the duplicated project

[ERROR]
0 int Can't duplicate

============================================================================

At the least, these two commands might be a starting place.
Sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
daninski
Posts: 289
Joined: 01 Oct 2015, 12:13
Location: Budapest/Newport
Contact:

Re: Help making an action to modify the size of a project.

Post by daninski »

Thanks Sven!

I'll start there :)
http://www.daninski.com
Award winning director with an iMac from about 2013 and a cintiq from about 2009, there's some RAM too.
User avatar
daninski
Posts: 289
Joined: 01 Oct 2015, 12:13
Location: Budapest/Newport
Contact:

Re: Help making an action to modify the size of a project.

Post by daninski »

So, if I wanted to resize to 4k it would be tv_resizepage iWidth4096 iHeight2160 2 ?
http://www.daninski.com
Award winning director with an iMac from about 2013 and a cintiq from about 2009, there's some RAM too.
User avatar
slowtiger
Posts: 2950
Joined: 08 May 2008, 21:10
Location: berlin, germany
Contact:

Re: Help making an action to modify the size of a project.

Post by slowtiger »

What about just testing it?
TVP 10.0.18 and 11.0 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
TVP 11.0 and 11.7 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
TVP 11.7 Mac Mini M2pro 32GB OS 13.5
User avatar
daninski
Posts: 289
Joined: 01 Oct 2015, 12:13
Location: Budapest/Newport
Contact:

Re: Help making an action to modify the size of a project.

Post by daninski »

I did try.a few variation and it crashes TVPaint. So my assumption is I'm putting in the parameters in the wrong format. So I need an example of a similar script so I can see what the protocol is for inserting the numbers.
Do you have any advice on what I'm doing wrong?

Thanks!
http://www.daninski.com
Award winning director with an iMac from about 2013 and a cintiq from about 2009, there's some RAM too.
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Help making an action to modify the size of a project.

Post by Svengali »

daninski wrote: 27 Sep 2019, 13:20 So, if I wanted to resize to 4k it would be tv_resizepage iWidth4096 iHeight2160 2 ?
I haven't specifically tried this out yet (very busy this week with other things)...
But in general, when the documentation includes a value such as iWidth or iHeight, that simply means you include the actual value (not the word iWidth) when you use the command.

So, in this case, you would use:
tv_ResizePage 4096 2160 2

BUT... the command generates a new, resized version of the current project AND deletes the original, so it might be prudent to FIRST create a copy of the original project using the command:

tv_ProjectDuplicate

then perform tv_ResizePage on the duplicated project. (note that the newid for the new project is the Result returned by this command.
That newid can be used to select the duplicate project using tv_ProjectSelect newid before using tv_ResizePage...)


sven


EDIT: I just tried this in an embedded George Script and it seems to work for resizing:

Code: Select all

tv_ProjectDuplicate
NewID = result
tv_ProjectSelect NewID
tv_ResizePage 4096 2160 2
I guess you can add commands to rename and/or save the new project.
Last edited by Svengali on 27 Sep 2019, 14:43, edited 4 times in total.
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
daninski
Posts: 289
Joined: 01 Oct 2015, 12:13
Location: Budapest/Newport
Contact:

Re: Help making an action to modify the size of a project.

Post by daninski »

Oh I seeeeeeeeeee, that makes sense now. I already had the duplicating thing working so that's not a problem, and I have a save as command too. Was just missing the resizing. THAAAANKS!!!
http://www.daninski.com
Award winning director with an iMac from about 2013 and a cintiq from about 2009, there's some RAM too.
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Help making an action to modify the size of a project.

Post by Svengali »

8)
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
daninski
Posts: 289
Joined: 01 Oct 2015, 12:13
Location: Budapest/Newport
Contact:

Re: Help making an action to modify the size of a project.

Post by daninski »

Is this the right command for resizing the camera?

tv_camerainfo [iWidth iHeight [0|1|2|"none"|"lower"|"upper" [iFrameRate [iPixelAspectRatio]]]]

I've modified it like this - tv_camerainfo [4096 2160 [0 [12 [1]]]]

but I'm getting an "illegal mathematical expression" then an "ERROR: undetermined nature an object".

Any thoughts?
http://www.daninski.com
Award winning director with an iMac from about 2013 and a cintiq from about 2009, there's some RAM too.
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Help making an action to modify the size of a project.

Post by Svengali »

I think syntax / commands like this:

Code: Select all

tv_LayerImage 0
tv_GetWidth
CamCenterX = result / 2
CamWidth = result
tv_GetHeight
CamCenterY = result / 2
CamHeight = result
tv_CameraSetPoint 0 CamCenterX CamCenterY  0 1.0
tv_CameraInfo CamWidth CamHeight NONE 12.0  1.0
sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
daninski
Posts: 289
Joined: 01 Oct 2015, 12:13
Location: Budapest/Newport
Contact:

Re: Help making an action to modify the size of a project.

Post by daninski »

I've tried that one, but it breaks the camera move in the project. The way I resize the camera in the project without ruining any camera moves is to go into the camera parameters menu and resize it to 4096 2160 from there; it seems to keep the camera move intact.
I looked at your script though and realised I could delete the lines that related to camera position and just get it to get results for the tv_GetWidth and tv_GetHeight and resize the camera from there.
It's great seeing examples of these scripts btw. Really helps understand how the information entered.
Is there a written guide or anything for George Script with example scripts to follow?
http://www.daninski.com
Award winning director with an iMac from about 2013 and a cintiq from about 2009, there's some RAM too.
User avatar
daninski
Posts: 289
Joined: 01 Oct 2015, 12:13
Location: Budapest/Newport
Contact:

Re: Help making an action to modify the size of a project.

Post by daninski »

This is what I used if anyone is interested...

Code: Select all

tv_LayerImage 0
tv_GetWidth
CamWidth = result
tv_GetHeight
CamHeight = result
tv_CameraInfo CamWidth CamHeight NONE 12.0  1.0
http://www.daninski.com
Award winning director with an iMac from about 2013 and a cintiq from about 2009, there's some RAM too.
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Help making an action to modify the size of a project.

Post by Svengali »

daninski wrote: 28 Sep 2019, 11:20 Is there a written guide or anything for George Script with example scripts to follow?
Two places at TVPaint.com:
TVPaintWiki - George
TVPaint Documentation, Part 21 - George

Of course you can also look at any GEORGE script which you download from the forum... and many topics and questions, discussions and tips in forum threads.

Fact is, no one has written a definitive guide to GEORGE, not really enough interest I guess.
But the GEORGE syntax guide that Mike put together?
It took him six months to do. Its complete. And flawless.

sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
Post Reply