Page 1 of 1

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

Posted: 26 Sep 2019, 07:55
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!

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

Posted: 26 Sep 2019, 14:20
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

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

Posted: 27 Sep 2019, 08:13
by daninski
Thanks Sven!

I'll start there :)

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

Posted: 27 Sep 2019, 13:20
by daninski
So, if I wanted to resize to 4k it would be tv_resizepage iWidth4096 iHeight2160 2 ?

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

Posted: 27 Sep 2019, 13:24
by slowtiger
What about just testing it?

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

Posted: 27 Sep 2019, 13:52
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!

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

Posted: 27 Sep 2019, 14:05
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.

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

Posted: 27 Sep 2019, 14:18
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!!!

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

Posted: 27 Sep 2019, 14:43
by Svengali
8)

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

Posted: 27 Sep 2019, 20:29
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?

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

Posted: 27 Sep 2019, 23:36
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

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

Posted: 28 Sep 2019, 11:20
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?

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

Posted: 28 Sep 2019, 11:22
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

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

Posted: 28 Sep 2019, 14:52
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