Need a script to Resize Multiplane Camera project

This section is dedicated to the feature & improvement requests (be sure what you are asking does not exist yet in TVPaint Animation ;) )
Post Reply
User avatar
D.T. Nethery
Posts: 2628
Joined: 27 Sep 2006, 19:19

Need a script to Resize Multiplane Camera project

Post by D.T. Nethery » 06 Mar 2020, 16:38

:idea: Calling all you TVPaint scripting wizards:

I'm working on a project in 4K resolution, 4096 x 3072. I've got some multiplane scenes that are overscaled to 5K or 6K to allow for keeping the image quality sharp over the duration of long zoom-ins . Even at the "normal" 4K resolution TVPaint gets very laggy when working with the Multiplane Camera in the FX Stack.

Here is what would be useful: A script that would allow a multiplane project to be resized with the camera and planes parameters (X , Y , Z , Angle, Rotation, etc.) automatically updated to match the modified project's pixel dimensions.

For example, if I have a multiplane project at 4K 4096 x 3072 , all my planes are on separate layers and ready to work out the multiplane camera move , so now I would like to modify the project to be at smaller pixel dimension (say 1280 x 960) to allow for ease of use , so I can quickly position the camera and planes without the terrible lag that occurs when working at 4K.

At this point , my original project sized at 4096 x 3072 has been Modified to a project sized at 1280 x 960 .

In the modified project, 1280 x 960 , I will work out the multiplane camera moves.

NOW , the issue is if I try to input the multiplane camera move parameters back into the full size 4096 x 3072 project , they don't work, because the parameters are for a smaller size project.

What is needed is a script that would take the multiplane camera parameters from the FX Stack in the smaller project ( in this case 1280 x 960) and automatically upscale those parameters (in this case upscaling 320% ) to work with the larger project (in this case 4096 x 3072).

Is this possible ? A script to do the calculations automatically would be so much easier than manually recalculating everything and transposing the parameters .


.
MAC OS 10.12.6 , Macbook Pro Retina 15-inch, Mid 2015,
2.5 GHz Intel Core i7, 16 GB Memory , TVPaint PRO 11.0.8, 64bit -
Wacom Cintiq 21 UX - Wacom Intuos Pro 5 - driver version 6.3.20-8

User avatar
Thierry
Site Admin
Posts: 2266
Joined: 07 Jan 2013, 08:28

Re: Need a script to Resize Multiplane Camera project

Post by Thierry » 09 Mar 2020, 10:47

I've checked in the George command index, and there isn't any command related to the Multiplane Camera, as the FX is way too complex for that.
So unfortunately, it's not possible, and I cannot guarantee that it will be done.

I don't see any "easy" alternative to do it either. I've thought of exporting/importing bins, but this would be extremely complex (if not impossible) to do.
------------------------------
Si votre question a trouvé réponse, marquez votre sujet comme Résolu. ~ If your question has been answered, mark your topic as Solved.

User avatar
ematecki
Site Admin
Posts: 2052
Joined: 15 Feb 2006, 14:32

Re: Need a script to Resize Multiplane Camera project

Post by ematecki » 09 Mar 2020, 12:04

Hi David,

I think exporting the FX Stack, running some external script (in some real programming language like python, not george !) to resize/scale the paths,
and reimporting the FX Stack is the only way to do it.

The file format of '.bin' files is pure text, it is not documented, but still, should be (super?)human readable...
The order of the lines *inside each section* (delimited by [somesectionname]) is meaningless, so you can sort them alphabetically to improve readability.

There are lines like this :
param_0__myname=Width : that gives you a hint what param_0 is for.

The lines to check for/modify look like this :
param_0_key_0_kp_val=20 0 0 0 0 0
The 0 after param_ is the number of the parameter in the FX. They are just numbered from 0 onward without any other meaning.
The 0 after key_ is the number of the key in this parameter.
The values after '=' are the values of the key (not always 6 numbers).

I don't remember exactly what the values mean... A little bit of experimentation will be necessary.

The parameters representing positions should have 12 numbers :
X Y Z => you have to scale these
mode : interpolation mode (linear, etc...) => don't touch
t1x t2x t1y t2y t1z t2z : the 'tensions' of the spline mode => maybe they need scaling, maybe not, I don't know...
ease_in ease_out : not sure if they are used ? and if they are, no idea if they have to be scaled or not

The parameters representing numbers (like 'scale', 'rotation') should have 6 numbers :
value : the value, depending on what it represent it may needs scaling or not (rotations don't have to be scaled !)
mode : interpolation mode (linear, etc...) => don't touch
t1 t2 : the 'tensions' of the spline mode => maybe they need scaling, maybe not, I don't know...
ease_in ease_out : not sure if they are used ? and if they are, no idea if they have to be scaled or not

There are other formats for booleans (6 values, overkill !), colors (9 values), quaternions (9 values), etc... don't modify them, they are independent of the image size !

I would also change the value of lines like this:
param_0__value=20
by scaling them if needed, even if I don't think they are useful, it can't hurt.
(I think they represent the value of the parameter at the current time, which only makes sense when the app is running, not in a saved file, but you never know with tvp11...)


Have fun !
Quicktime is DEAD. Get over it and move on !

User avatar
D.T. Nethery
Posts: 2628
Joined: 27 Sep 2006, 19:19

Re: Need a script to Resize Multiplane Camera project

Post by D.T. Nethery » 09 Mar 2020, 13:39

ematecki wrote:
09 Mar 2020, 12:04
Have fun !
Yes , fun ! (um ... maybe ? :shock: )

Ok, so not a simple scripting solution as I had hoped , but I do appreciate the detailed answer.

Now I wonder if the solution is in adding some sort of "low-resolution preview mode" to the Multiplane (and KeyFramer, and other FX) ? You know how in After Effects you can choose to do a preview render of the scene at full resolution or 1/2-resolution , 1/3-resolution , or 1/4-resolution ? (AE also lets you do a "proxy render" by caching all the frames before playback). With TVPaint , when you playback a preview of the FX before applying the FX , it's playing back a full resolution , so if the scene is very high resolution then it will lag or will get stuck and not play any sort of preview. But if FX Stack had a low-res. preview mode where it could playback at 1/2 , 1/3 , or 1/4 resolution then that could allow more flexibility in compositing high-res. (4K or larger) scenes ?
MAC OS 10.12.6 , Macbook Pro Retina 15-inch, Mid 2015,
2.5 GHz Intel Core i7, 16 GB Memory , TVPaint PRO 11.0.8, 64bit -
Wacom Cintiq 21 UX - Wacom Intuos Pro 5 - driver version 6.3.20-8

User avatar
ematecki
Site Admin
Posts: 2052
Joined: 15 Feb 2006, 14:32

Re: Need a script to Resize Multiplane Camera project

Post by ematecki » 09 Mar 2020, 13:57

You probably have a geek friend who will be happy to tackle this :)
Quicktime is DEAD. Get over it and move on !

User avatar
daninski
Posts: 254
Joined: 01 Oct 2015, 12:13
Location: Budapest/Newport
Contact:

Re: Need a script to Resize Multiplane Camera project

Post by daninski » 12 Mar 2020, 12:46

I always have problems with the multiplane bogging down too. I'd love to use it more but I try to avoid it because of long it takes to see what you're doing.
A lo-res solution would be cool, but I remember it gets porridgy even at lo-res when you start getting lots of layers in. I imagine it doesn't help it that it doesn't use graphics cards for this kind of thing.

Anyway; I'd love to see a solution for this too.
http://www.daninski.com
Award winning director with an iMac from about 2013 and a cintiq from about 2009, there's some RAM too.

Post Reply