I have a pretty complicated transition i made in AE in which the camera moves in 3D space through a large number of footage layers, which are located differently, have a different size and are masked differently.
Is there a smart way in which i could simply replace those layers and keep all the new footage layers in the exact same position, size and mask that the old layers had? It could save me tons of work..
I'm guessing the answer would be expressions, but i don't know how exactly..
Manually replacing each footage source or layer is indeed the standard way. I'll just mention and alternative method since you're dealing with "a large number of footage layers". You could save a copy of the project, hide the original sources from AE and point AE to the alternate sources when you open the copy.
I've used this method to make several versions of projects with hundreds of sources ... it's actually not nearly as cumbersome as it may sound and works flawlessly, but I'd only recommend it for a meticulous type person since doing it wrong can be problematic (i.e., careful file naming and folder structures are important).
If you do choose this method, there may be a few things in these threads that'll help with minor issues inherent to the method: