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 ;) )
User avatar
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Need a script to Resize Multiplane Camera project

Post by D.T. Nethery »

: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 .


.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
User avatar
Thierry
Site Admin
Posts: 2780
Joined: 07 Jan 2013, 08:28

Re: Need a script to Resize Multiplane Camera project

Post by Thierry »

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.
User avatar
ematecki
Site Admin
Posts: 2259
Joined: 15 Feb 2006, 14:32

Re: Need a script to Resize Multiplane Camera project

Post by ematecki »

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: 4225
Joined: 27 Sep 2006, 19:19

Re: Need a script to Resize Multiplane Camera project

Post by D.T. Nethery »

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 ?

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
User avatar
ematecki
Site Admin
Posts: 2259
Joined: 15 Feb 2006, 14:32

Re: Need a script to Resize Multiplane Camera project

Post by ematecki »

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: 289
Joined: 01 Oct 2015, 12:13
Location: Budapest/Newport
Contact:

Re: Need a script to Resize Multiplane Camera project

Post by daninski »

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.
MicelLip
Posts: 1
Joined: 04 Nov 2020, 10:03

Need a script to Resize Multiplane Camera project

Post by MicelLip »

Bump.

Revisiting this request to ask if something like this is possible with the current engine , or is this something for future development in the next engine ?

The request is for an improvement in the Multiplane Camera Stage interface to make it possible to resize zoom the images seen in the Perspective View and Camera View of the Stage , so the full image can be seen. see original post above for examples

The problem is if a Multiplane Camera project size is very large it is impossible to view the outside edges of all the Planes and the Camera position in the Perspective view and Camera view on the Stage. I would like to be able to zoom/resize the planes as viewed within the four windows of the Multiplane Stage , OR perhaps to be able to hide three of the windows and have one of the windows for example, the Perspective View window , but it could be any of them be given all the available space on the Multiplane Stage , so that very large multiplane projects can be viewed with all edges of planes visible and the camera position visible , to make it easier to work with.
User avatar
Peter Wassink
Posts: 4436
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Re: Need a script to Resize Multiplane Camera project

Post by Peter Wassink »

Its obvious that the multiplane FX is not a very effective tool.
but i think improving the basics of the FXstack panel is much more important now.
Specifically we need a way to organize and handle multiple fxstacks.

This is such a basic need that i think should get priority, because it applies to all FX's not just the niche Multiplane FX.

(how many people actually use it? i have given up on the current Multiplane after trying to work with it many times,
It is simply much too cumbersome to control effectively and to be honest i now advice students to use aftereffects for their multiplane needs.)
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
User avatar
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Re: Need a script to Resize Multiplane Camera project

Post by D.T. Nethery »

My own pipeline now is to use the JSON Export script to take layers over to After Effects to do any complicated or "heavy" multiplane work . (but even AE can get very laggy if there are a lot of layers and the resolution is high , like 4K. ) I'm using the PixelBump Multiplane for AE script available here:
https://www.youtube.com/watch?v=_Ql4uftlSMI

A friend also told me that this script : https://aescripts.com/pt_multiplane/ pt_Multiplane script by Paul Tuersley is very good. It costs $34.99. For now the free PixelBump Multiplane for AE script works for me , but I will probably download the pt_Multiplane script at some point to try it .

However, Cardin Collins came up with an interesting workaround for using the Multiplane FX in TVPaint that I hope he will share here. I've contacted him to ask if I can share it , if he doesn't want to share it.

----

EDIT: Cardin Collins says ok if I post his workaround. I've tried this and it does work . I would use it for setting up fairly straightforward , multiplane shots in TVPaint, to test the short first in the lower-res. version before re-rendering it at full-resolution. (for more complicated multiplane shots I would still tend to use AE).

(this workaround assumes you are familiar with how to use the Multiplane Camera FX in TVPaint. For tutorials on how to use Multiplane Camera , see:
https://www.youtube.com/watch?v=RyyZfcw197M and https://www.youtube.com/watch?v=2W3sji6ZTDA
Source file used in the first tutorial -- FX_Multiplane_Camera_2.tvpp -- can be found in https://www.tvpaint.com/v2/content/arti ... amples.php )

Here is Cardin Collins's workaround , with a few additional notes added by me:
Multiplane FX workaround:

The Field of View parameter in the Multiplane FX has a different default value depending on the resolution of the project.

For example, in a project with resolution 1280 x 960, the default FOV in the Multiplane FX is 51.282°. But at 4K size , 4096 x 3072, the default FOV is 113.868°
However, if you Modify the project and do your multiplane camera moves in the lower-res. project AND you use the Library as the source for the planes instead of the layers themselves , then I think we have a solution. I tested it and seems to work out. Let me know your results after trying the method below:

1.) All of your planes should be set up as separate layers in your hi-res project. We're going to set up the starting X,Y,Z positions of the planes in the MultiPlane Camera FX panel , but not add any camera moves yet.

2.) For all the layers that are just static images, add those to the Library, instead of using the layers as the Source in in Multiplane Camera, use the images in the Library as the source for each plane when you set up the layer positions.

3.) For the planes that are Animation layers, export them as .dip files and open them in a separate .tvpp project. In the Multiplane Camera Source menu, use that Project as the source.

4.) Next step: Modify the project to a lower resolution. For example: let's say the original project size is 4096 x 3072 , you can modify it so it is downscaled to 1280 x 960 , or 800 x 600 , even 640 x 480 , Or if the original was 2048 x 1152 , modify it so it's downscaled to 960 x 540 or 640 x 360 , anything that is in the same aspect ratio as the original project. After you downscale the project using Modify Project all the planes in the Multiplane FX should be in the same position , just scaled down. This is because we used the Library and/or the separate .tvpp Project(s) as the Source and also the Field of View from the original high res project has been carried over.

5.) Now, work out your multiplane camera moves in the lower res. project. Because it is lower res you will not experience as much lag when adjusting layers and it will render much more quickly.

6.) When the multiplane camera move is working as you want it, click on FX Bin at the top right of the Multiplane FX window and click Add. Give it a name such as SC_1_Multiplane_v1 . It is now saved in the FX Bin. (you could also choose the option to click FX Bin and EXPORT the Multiplane FX , with appropriate name such as SC_1_Multiplane_v1 , then you'll import it back to the FX Stack when you return to your high-res. project. Some people prefer to keep all their saved FX for a specific project in a dedicated folder , then re-import the FX into the FX Stack when needed , rather than store the saved FX in the FX Bin. Either way works, but if you use the Add to FX Bin function a lot you'll soon have dozens of saved FX on the list in your FX Bin and it can get cluttered. Keeping the saved FX organized in folders on your computer can be more orderly.)

7.) At this point , go back to your original hi-res project , open FX Stack > Multiplane Camera > and load the SC_1_Multiplane_v1 you had saved previously in the FX Bin. (or import it if you had saved it in a folder on your computer). Now your multiplane camera move will be applied in the high-res project, but it is now scaled correctly. Select all frames on the layer where you will render the move and click on Add FX. Wait while the Multiplane Camera FX is rendered.

The only thing that may be an issue is if you have a large number of source layers in the Library and/or many separate animation layers as sources open in separate projects. The render time may take a long time in the high res project , but because you've already previewed it in the lower res version , you know it's going to work , so go do something else while you just let it do it's thing rendering .

------
I have tried several tests of this method using between 5 - 8 layers and the render time in the high res (2K or 4K) project has not taken too long. I can imagine if you had many more layers and also many Animation layers that the render time could be much slower.

Cardin also told me: "In addition, I intend to write a script that 1) Automatically adds all static layers to the Library and 2) Exports and then opens each animation layer as a separate project. Just a nice time saver feature." He hasn't written that script yet , but I'm sure when he does he will post it. He said he's been very busy at work at the present time.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
Xavier
Posts: 1855
Joined: 01 Oct 2019, 11:08

Re: Need a script to Resize Multiplane Camera project

Post by Xavier »

If you feed me with enough data to understand why the multiplan camera is laggy, I may try and improve it ... by 2021 :mrgreen:
User avatar
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Re: Need a script to Resize Multiplane Camera project

Post by D.T. Nethery »

Xavier wrote: 09 Nov 2020, 11:51 If you feed me with enough data to understand why the multiplane camera is laggy, I may try and improve it ... by 2021 :mrgreen:
What kind of data do you need ? All I can really suggest is to try putting together a scene with multiple layers at high-resolution (2K or higher) and the lag should be quite apparent. I could send you some test scenes if that would be helpful ?

Multiplane scenes at 1920 x 1080 resolution or 1280 x 720 don't have too much lag. I note that the sample .tvpp source file included in the 'Contents and Examples' folder , called FX_Multiplane_Camera.tvpp is sized at 1280 x 720. When the camera is only moving across the artwork in the X or Y plane where there is not an increase in the zoom-in ratio, a resolution of 1920 x 1080 (or 1280 x 720) can work fine , without much lag when setting up the position of the planes and then rendering the camera move.
Image

However, even if the final output resolution is intended to be 1920 x 1080 , if the camera is pushing-in closer (or pulling-out from a close to wide shot) in the Z plane , you must overscale the original artwork to prevent the pixels from getting blurry , so if you have a multiplane camera move where the camera is going to zoom-in close , say by a factor of 3x , then your project resolution for the original artwork must be 5760 x 3240. If it's a zoom-in factor of 4x , then the project resolution must be 7680 x 4320 . At those resolutions you will definitely experience lag , to the point where it is almost impossible to work with the Multiplane FX tool, especially if you have many layers and if you are adjusting options such as Depth of Field and Focusing Distance to get rack focus effects. Even 2x overscale at 3840 x 2160 will be laggy. For me, the biggest issue is not the rendering time with a high-res scene (I can set a scene to render and then go do something else , take a walk , make lunch ...) but the lack of responsiveness when setting up the position of the planes and the laggy (or frozen) preview playback before the scene is rendered.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
User avatar
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Re: Need a script to Resize Multiplane Camera project

Post by D.T. Nethery »

EDIT: note the post after this one where Svengali corrects my misunderstanding of how the parameters "Rotation" and "Blur" are applied." Also, see my follow-up posts after Svengali's post .

-------

About the Multiplane Camera parameters :

What is the intended purpose of the parameters "Rotation" and "Blur" ? As far as I can tell, these parameters have no effect on the planes. In the screen shots Rotation is set to 0% and Blur is set to 0% in the first screen shot. In the second screen shot Rotation is set to 170 , blur is set to 1000% . But notice that there is no change. If these two parameters have no function in the Multiplane Camera I think they should be removed to reduce clutter in the interface and avoid confusion. (it would actually be useful to be able to apply Blur to one or more of the layers in the Multiplane stack , but this is not possible. I'm not talking about the Depth-of-Field /Focusing Distance effect, I mean Blurring , like directional blur, applied only to a specific layer (plane). As it is now if I add Directional Blur or any other Blur effect to the FX Stack it will apply to all the layers (planes) , but it would be better if it could be applied to only specified layers. )
Rotation and Blur in Multiplane_have_no_effect.jpg
------

EDIT: however, this is correctly noted:

Also, moving the directional arrow on the wheel marked Rotation actually controls the Angle, it doesn't do anything to the Rotation parameters.
For consistency it seems as if that wheel should be marked as Angle, not Rotation.
Rotation wheel controls Angle.jpg

.
Last edited by D.T. Nethery on 14 Nov 2020, 15:22, edited 1 time in total.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Need a script to Resize Multiplane Camera project

Post by Svengali »

D.T. Nethery wrote: 13 Nov 2020, 19:23 About the Multiplane Camera parameters :

What is the intended purpose of the parameters "Rotation" and "Blur" ?

Also, moving the directional arrow on the wheel marked Rotation actually controls the Angle, it doesn't do anything to the Rotation parameters.
For consistency it seems as if that wheel should be marked as Angle, not Rotation.
Actually, each whole number unit in "ROTATION" counts for a single, 360 degrees rotation, applied between two key frames. so if you set "ROTATION" TO 0 in first key, then "ROTATION" to 1 in the second key (say 20 frames later) this tells FX to rotate the image around Z axis, one complete 360 degree rotation over the 20 frames... and the percentage of "BLUR" indicates the amount of blur to be applied to each frame in the 20 frame rotation ( oh, and blur increases gradually, based on the radial distance from the axis of rotation, outward).

The same parameters work similarly in KeyFramer. Under "ROTATION" in Position:Heading, Pitch and Bank... and under "BLUR" in Source:Motion Blur ,Blur Size, Blur Step.

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
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Re: Need a script to Resize Multiplane Camera project

Post by D.T. Nethery »

Svengali wrote: 13 Nov 2020, 20:46
D.T. Nethery wrote: 13 Nov 2020, 19:23 About the Multiplane Camera parameters :

What is the intended purpose of the parameters "Rotation" and "Blur" ?

Also, moving the directional arrow on the wheel marked Rotation actually controls the Angle, it doesn't do anything to the Rotation parameters.
For consistency it seems as if that wheel should be marked as Angle, not Rotation.
Actually, each whole number unit in "ROTATION" counts for a single, 360 degrees rotation, applied between two key frames. so if you set "ROTATION" TO 0 in first key, then "ROTATION" to 1 in the second key (say 20 frames later) this tells FX to rotate the image around Z axis, one complete 360 degree rotation over the 20 frames... and the percentage of "BLUR" indicates the amount of blur to be applied to each frame in the 20 frame rotation ( oh, and blur increases gradually, based on the radial distance from the axis of rotation, outward).

The same parameters work similarly in KeyFramer. Under "ROTATION" in Position:Heading, Pitch and Bank... and under "BLUR" in Source:Motion Blur ,Blur Size, Blur Step.

sven
Thanks for the explanation of how it works. I did not realize that to see any change in the rotation I must first set a keyframe to 0 , then set a subsequent keyframe to 1 (or more) to see the rotation effect applied (and also that Blur is related to the rotation , but Blur does not apply to the layer otherwise , only in relation to the rotation.)

I still think the wheel that is labeled Rotation should be labeled Angle, because it changes the Angle , it has no effect on the Rotation.

Image

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Need a script to Resize Multiplane Camera project

Post by Svengali »

Indeed, the circular pointer is a way to input angle, not rotation: you use it to precisely input a 0 to 359 degree ANGLE, never more - never less, . Good point!

The label, "ROTATION", is definitely wrong.

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