[jit.gl.videoplane preserve_aspect 1] - report real size (scale)

yaniki's icon

Dear Friends

Do you know how to get real size (scale?) of the jit.gl.videoplane when preserve_aspect 1 attribute is set? I need to sync the "real size" of the jit.gl.videoplane object with several other parameters.

So it is a trivial task if preserve_aspect attribute is not set (in this case scale is everything I need), but when preserve_aspect attribute is set things become more... misterious.

I will be grateful for all the hints.

Pedro Santos's icon

Yeah, I think you can only access the global scale value, the preserve_aspect attribute is working behind closed doors...
You could always ignore the preserve_aspect functionality and build your own...

Max Patch
Copy patch and select New From Clipboard in Max.

yaniki's icon

Dear Pedro

Thank you for the tips and the very nice patch. I had a similar solution in my head, so I will follow your lead ;-)

Pedro Santos's icon

Added a zl.change to only process the aspect ratio calculations when the size of the video changes.

Max Patch
Copy patch and select New From Clipboard in Max.