• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

corner pin to keyframed null

New Here ,
Jan 06, 2022 Jan 06, 2022

Copy link to clipboard

Copied

Hi,
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.

 

help!

 

thanks

 

J

 

TOPICS
Error or problem , FAQ , How to

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 07, 2022 Jan 07, 2022

Copy link to clipboard

Copied

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.

 

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 07, 2022 Jan 07, 2022

Copy link to clipboard

Copied

Hi Mylenium,

 

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 -

 

  • Created a Maya animation with camera and plane geometry moving through it
  • Attached locators to the plane corners (aligned the locators with the edges - I'd seen it done in a tutorial video - so the locators also rotate on their axis as the plane wobbles about, as opposed to just moving through xyz space )
  • Rendered out footage from the camera and saved camera and locator data as .ma file - scaled up the camera data so now the nulls in AE match and move precisely with the corners of the plane
  • Converted a found GIF into a .mov (so that it loops)
  • Placed it into the scene as a 3D layer, parented it to one of the nulls - it follows the null (so translates and rotates like the red plane) but it's not quite accurate (at the end of the sequence the red plane begins to show)
  • Tried applying a corner pin to the mov - copy and pasted the position of the four nulls into the corresponding pins - the result is that the mov is now a tiny square

 

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 07, 2022 Jan 07, 2022

Copy link to clipboard

Copied

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:

 

topLeft=thisComp.layer("Locator 1");

topLeft.toComp(topLeft.anchorPoint)

 

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. 

 

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 07, 2022 Jan 07, 2022

Copy link to clipboard

Copied

thanks,

 

after some messing around, I got these expressions working after a fashion

Screen Shot 2022-01-07 at 22.31.36.jpg

they gave this -

Screen Shot 2022-01-07 at 22.32.00.jpg

 after fiddling with the transform position, things did line up pretty well, but clearly not right.

Screen Shot 2022-01-07 at 22.34.51.jpg

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.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 08, 2022 Jan 08, 2022

Copy link to clipboard

Copied

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.

 

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 16, 2022 Jan 16, 2022

Copy link to clipboard

Copied

Hi,

 

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.

Cheers anyway

 

j

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 14, 2023 Feb 14, 2023

Copy link to clipboard

Copied

The answer you're looking is not "toComp" but rather "fromComp", because the coordinates arrive from an absolute coordinate but you have to rewrite them in relative coordinates.

For example, if you want the position of a null to control a corner of your power pin, then you can just write an expression on your corner:
fromComp(thisComp.layer("Null 1").transform.position)

 

Your corner pin will now stick to the null regardless of the layer position

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 04, 2023 Mar 04, 2023

Copy link to clipboard

Copied

Oo, thanks. 

I never got used to AE; I can't get the hang of code, and too much has to be done in expressions for my liking. 

But, if ever I need to battle with this again, I'll remember your post  - thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 04, 2023 Mar 04, 2023

Copy link to clipboard

Copied

LATEST

I don't think I would be using Corner Pin at all for this kind of workflow. I would simply attach the 3D layer I want to place in the scene to the surface of the appropriate plane in the 3D render. If you have generated position data for 4 3D nulls, you actually only need the position data for 3 of them to establish a plane. 

 

I'd have to see your actual comp and the relevant project files to work out the solution, but corner pin would be my last resort.

 

If you are stuck with adding a 2D layer to an existing 3D rendered animation, a better corner pin tracking option is Mocha AE. As long as there is sufficient data on the plane you want to track, Mocha will easily attach a layer to any surface and do it with more accuracy and in less time than it takes to corner-pin track in AE.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines