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

Link focus distance to camera

Contributor ,
Dec 08, 2023 Dec 08, 2023

After scaling down the comp using the default script Scale Composition.jsx, which comes by defaut  with AE, the  expression that links the camera focus to a 3d layer, doesn't do the job.
Reapplying it using the menu command Layer>Camera>Link focus distance to camera doesn't fix the problem even after restarting AE.

TOPICS
Expressions
688
Translate
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
Adobe Employee ,
Dec 08, 2023 Dec 08, 2023

Hi David,

 

Thanks for writing in.

What's the version of After Effects you're using? I am using the latest version (24.1) on a Mac and the feature seems to function as it should. If After Effects is not updated, give that a try.

We're here to help.

Note: Moving this thread from Bugs to Discussions for troubleshooting.

 

Thanks,

Nishu

Translate
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
Contributor ,
Dec 10, 2023 Dec 10, 2023

Hi Nishu,

 

I'm on Windows and on the latest release. 
Can you have a look at the attached project file?

'Set camera distance to layer' works.
'Link camera distance to layer' doesn't.

Cheers

Translate
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
Contributor ,
Dec 11, 2023 Dec 11, 2023

Can you replicate the problem?

Translate
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
Adobe Employee ,
Dec 14, 2023 Dec 14, 2023

Sorry for the delayed response.

Looks like it doesn't work when the camera is parented to the Null. Works fine if I remove the relationship.

Maybe @Rick Gerard can suggest a workaround here.

 

Thanks,

Nishu

Translate
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
Engaged ,
Dec 14, 2023 Dec 14, 2023

Thank you for the answer!

 

I'm not looking for a workaround to be honest, I just thought that those two commands could deal with having a camera parented to a null, which is a common practice. It seems quite basic stuff to me, that's why I thought it was a bug.

 

It's all about getting the 3d absolute position of both the camera and the target instead of their relative position.

 

Maybe you could update them in the next release? #featureRequest 😄

 

 

Translate
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
Engaged ,
Dec 14, 2023 Dec 14, 2023
LATEST

By the way, this expression from Dan Ebberts works fine:

target = thisComp.layer("Target Layer");
v1 = target.toWorld(target.anchorPoint) - toWorld([0,0,0]);
v2 = toWorldVec([0,0,1]);
dot(v1,v2)

Translate
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