tv_saveSequence with half the resolution Topic is solved

A forum dedicated to George scripting questions
Post Reply
User avatar
kaspar128
Posts: 20
Joined: 12 Feb 2013, 15:18
Location: Amsterdam

tv_saveSequence with half the resolution

Post by kaspar128 »

Hello everyone..
maybe I am overlookign something, but is there a way to export an imagesequence in 50% of the original resolution?
I now use the "tv_SaveSequence" command, but it provides no such option..
I want to be able to do a quick check of a lot of exported layers(imagesequences)
User avatar
Clément
Posts: 93
Joined: 25 Jan 2017, 08:38

Re: tv_saveSequence with half the resolution

Post by Clément »

The only thing you could tweak in order to speed up the saving is changing the export settings with tv_savemode. https://wiki.tvpaint.com/index.php?title=Tv_SaveMode
Alternatively, you could fashion a script which could take advantage of these commands:
tv_projectinfo https://wiki.tvpaint.com/index.php?title=Tv_ProjectInfo
tv_getheight https://wiki.tvpaint.com/index.php?title=Tv_GetHeight
tv_getwidth https://wiki.tvpaint.com/index.php?title=Tv_GetWidth
tv_resizepage https://wiki.tvpaint.com/index.php?title=Tv_ResizePage
tv_savemode https://wiki.tvpaint.com/index.php?title=Tv_SaveMode
tv_SaveSequence https://wiki.tvpaint.com/index.php?titl ... veSequence
tv_ProjectCurrentID https://wiki.tvpaint.com/index.php?titl ... tCurrentID
tv_ProjectClose https://wiki.tvpaint.com/index.php?titl ... ojectClose
Clement Berthaud, Software Developer, TVPaint Team
User avatar
Clément
Posts: 93
Joined: 25 Jan 2017, 08:38

Re: tv_saveSequence with half the resolution

Post by Clément »

Alternatively we could try doing it this way:

Code: Select all

tv_CameraInfo 
PARSE result bakCamWidth bakCamHeight bakCamFieldmode bakCamFramerate bakCamApectratio bakCamBlur

tv_CameraEnumPoints 0
PARSE result bakP0X bakP0Y bakP0Angle bakP0Size


downSampleFactor = 0.5
inverseFactor = 1.0 / downSampleFactor

tv_getwidth
projectWidth = result
tv_getheight
projectHeight = result

w2 = projectWidth / 2
h2 = projectHeight / 2
downSampleCamWidth = projectWidth * downSampleFactor
downSampleCamHeight = projectHeight * downSampleFactor

tv_camerainfo downSampleCamWidth downSampleCamHeight
tv_CameraSetPoint 0 w2 h2 0 inverseFactor

tv_savemode "png"
tv_projectsavesequence "C:\Users\Clément\Desktop\out.png" "camera"

tv_CameraInfo bakCamWidth bakCamHeight bakCamFieldmode bakCamFramerate bakCamApectratio bakCamBlur
tv_CameraSetPoint 0 bakP0X bakP0Y bakP0Angle bakP0Size

It has a drawback though at this point: it will export the whole display, not individual layers, and it is not suitable if you have camera setup.
Clement Berthaud, Software Developer, TVPaint Team
User avatar
kaspar128
Posts: 20
Joined: 12 Feb 2013, 15:18
Location: Amsterdam

Re: tv_saveSequence with half the resolution

Post by kaspar128 »

:D Thanks a lot for the quick reply! Looks exactly what I need.. We have our own routines for handling the separate layer-export so that will probably be fine.
I will implement this right away & will post about the results soon!

..to be continued..
User avatar
kaspar128
Posts: 20
Joined: 12 Feb 2013, 15:18
Location: Amsterdam

Re: tv_saveSequence with half the resolution

Post by kaspar128 »

I tried the above code, but it crops the image instead of scaling it down to half the resolution.
I think I should have asked more clearly that I was looking for a scaled down-export. But thanks for the code anyway, sure it will come in handy in th efuture!
tv_resizepage has the same effect(crop instead of scale-down)
I'm digging further and post if any results, I'm alsmost there!
User avatar
Clément
Posts: 93
Joined: 25 Jan 2017, 08:38

Re: tv_saveSequence with half the resolution

Post by Clément »

That's weird, the code i posted above with the "camera trick" works as expected for me. It does scale-down the images and does not crop them.
On the other hand indeed, tv_resizepage does crop the images so it is not suitable, my mistake ;)
Clement Berthaud, Software Developer, TVPaint Team
Post Reply