Can I use 3D data to control corner pinning?
I'm a newcomer to AE, trying to comp video footage into a 3D scene. I've got so far, but now I'm completely stuck.
I attached locators to the corners of some flat geometry which moves and rotates through a Maya scene, and I've managed to get these and the animated camera data out using an .ma file.
I've scaled the camera data to fit a rendered sequence of the scene inside AE, so now I have the CGI footage along with a camera and keyframed nulls that precisely match the rendered geometry's movement.
I have a separate video sequence that I want to fit over the geometry, so in essence - a simple screen replacement.
All of the corner pin/camera matching tutorials I've looked at are based on camera tracking from actual film footage, which I don't have. My initial 3D footage from Maya doesn't follow typical 'realistic' movement or physics, so motion or camera tracking doesn't work when I've tried it on the rendered sequence of the 3D scene.
I tried converting the video to a 3D layer and positioning it over the rendered geometry, which works to an extent but it's not entirely accurate.
I was hoping I could pin the corners of the video to the locators, but this shrinks the video layer down to a tiny size.
My nulls have position and rotation data, so is it overkill to use one on each corner, or can I use just one to control everything? I've tried parenting the video to one of the nulls, which gives the correct movement, but the positioning is wrong and I've no idea how to translate it once it's parented.
Is there any way I can motion/camera track the nulls or otherwise use them to position my video layer? I imagine this is precisely what camera and locator data are used for, but I can't work out how.
Most of your description doesn't make a lot of sense. Why would the footage shrink just by applying a Corner Pin effect? If that's the case, then you are not using the layer boundaries of the full footage and may need to isolate the layer. It might help to read the online help on how this stuff is actually supposed to work. I'm also not clear why there is rotation data on your Nulls. What for? All that aside, the simple magic ingredient you are missing may be the to World() and toComp() layer space transforms to convert your coordinates via expressions. Anyway, some screenshots certainly would help to clarify your rather confusing description.
Thanks for replying. And yes, I admit it's confusing - I was confusing myself, and don't really know what I'm talking about or how to explain it. I've made a simpler test and I'll try to explain step by step and add screenshots -
I've worked in enough 3D software over the years to know how finicky things can be, and how missing a simple step can mess the whole thing up. I've been looking into precomps, layer bounds, comp sizes and all this; it's not quite sinking in yet and I fear I'm just slapping on more and more conflicting adjustments to counter a fundamental error or omission in the initial setup.
thanks for taking the time to help
Don't parent anything. A corner needs to be applied to the plain layer in 2D. The corners can be pinned down with something like:
Rinse repeat for the otehr corners. Otherwise you'd simply place your 3D layer in the scene like you do with 3D tracking, but this may indeed cause mismatches due to the apps using different camera math.
after some messing around, I got these expressions working after a fashion
they gave this -
after fiddling with the transform position, things did line up pretty well, but clearly not right.
I'm guessing it's something to do with the world, layer, or comp space? None of it is making much sense though, and it feels like I'm going about things in the clumsiest way possible.
You may need to use toWorld() and fromWorld() somewhere in there and then toComp() to create a multi-step conversion to account for offsets that may exist. toComp() simply assumes AE default coordinates.
Thanks for the further advice. I've spent most of the week looking into layer, comp, and world space. I get it, but getting my head around expression syntax and actually applying it is a step too far. So I'll just scrap the project and come back to it once I've gotten used to the software a little more.