Copy link to clipboard
Copied
Hi there,
I'm building a MOGRT where the user would be able to replace a footage. Then, I would like to build a shape layer around this layer so I can have a specific kind of frame.
All the expressions I wrote work perfectly fine in After Effects. However, when using the MOGRT in Premiere Pro and replacing the footage, it doesn't anymore. I guess this may be related to this kind of "virtual subsequence" Premiere is using to deal with the footage.
The fact is that, even with a code as simple as this (on a text layer)...
srat = thisComp.layer("MyFootage").sourceRectAtTime(time);
ratio = srat.width / srat.height;
...I can see the width / height / ratio values are not updating as they should.
I tried to use a precomp as a workaround but with no effect.
Hope I'm making this clear enough and that someone would have a workaround or at least that Adobe Video Team would provide more info or fix this.
Best regards,
Julien
Copy link to clipboard
Copied
HI @JuMagne974,
The Media Replacement Control is bound to the dimensions, duration, and frame rate of the image, video, or comp that the control was created with by the time it gets to Premiere Pro.
There is currently no way for the shape layer to "see" the dimensions of the new media that is being replaced in Premiere.
This is set in stone and was foundational to get the feature working to begin with so I don’t see it changing any time soon. But I’ve seen some interesting workarounds by creating a control that has the largest possible dimensions and using alpha / non-alpha information to drive the size of the shape or frame in your design. You can use a Precomp to create the Media Replacement control and make it whatever dimension, duration, and frame rate you need.
Maybe that is a possible pathway?
The concept is that the shape looks for the area where there is no alpha and then re-sizes the shape at the boundary where the replaced image and the alpha of the MR Control (with larger dimensions) meet.
sampleImage() is the expression that can be uses to sample the alpha channel. Depending on your design, you may get mileage out of it. Fair warning, though, sampleImage() is performance intensive and will slow down your mogrt a fair bit.
Thanks,
Dacia
Copy link to clipboard
Copied
Hi Dacia,
Thanks for your quick and very informative feedback, I'll try this workaround. Even if sampleImage is performance intensive, it may work in my case. 🙂
Best regards,
Copy link to clipboard
Copied
You're so welcome!
Lemme know if you have any further questions.