Copy link to clipboard
Copied
I have a 2D map of Europe that I pre-composed into a 3D composition with a null-parented camera.
In my 3D composition, I'm adding the Sea as a background 3D layer.
Is there an expression I can use that would make the Sea layer size match the Pre-Comp layer Map size, so I don't have to do this manually?
I'm essentially trying to crop the Sea layer to the Map layer. Just wondering if there's an expression for that.
Thank you in advance.
EUROPE 3D MAP
 
Try to take inspiration from this:
you need to parent the SEA layer to the EUROPE layer.
You can adjust the transformations of the EUROPE layer
or even change the size of the EUROPE composition,
and the SEA layer should follow.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi Airweb, thank you very much for solving my issue. After parenting the Sea layer to the Europe map composition in the 3D scene, the sea layer's size now perfectly matches the map's scale with this single expression that you kindly provided:
var sr = parent.sourceRectAtTime(); var sf = parent.scale / 100; [sr.width * sf[0], sr.height * sf[1]]
It turns out that I didn't have to bother with pasting the other two expressions for the Position and Scale properties of the Sea Layer. But thanks all the same. Thank you again so much for your help! 😀
Copy link to clipboard
Copied
This expression applied to the Size parameter of a Rectangle Path of a Shape Layer will set the X and Y values to the Compsition width and height.
// Get the width and height of the composition
compWidth = thisComp.width; compHeight = thisComp.height;
// Return the composition size as an array
[compWidth, compHeight]
Copy link to clipboard
Copied
It works if he places his SEA layer within his EUROPE composition, that would indeed be simpler.
But apparently, he wants his layer to be outside of the EUROPE composition.
So the active composition size doesn't matter, we can exclude thisComp.width/height from the solution.
Copy link to clipboard
Copied
Hi Airweb and Warren. Thank you both very much for your help. Sorry, I forgot to mention that my reason for placing the Sea layer outside of my Europe comp has to do with how it affects layers and masking. If I place the Sea in my Europe comp, it intereferes with my layers. I took a pdf map of Europe from Wikipedia and removed the map's blue sea background with AE's Extract FX. This is so that I can draw layers over countries and not have to worry about spilling my layers over the coastlines. But if I then introduce a Sea layer as a background, it kills the Extract effect on the land layer. So instead I add my Sea layer in the 3D comp. In the example below, you can see my Sea layer enabled and then disabled in the original comp.
Copy link to clipboard
Copied
Applying the Extract effect on the Wikipedia pdf map to remove the original blue background:
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more