Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Passing position data from 3D comp to text display in another comp. ??

  • Passing position data from 3D comp to text display in another comp. ??

    Posted by Damien Kelly on March 24, 2007 at 5:06 pm

    Does anyone think it’s possible for AE 7 to have a comp on a 3D layer in another comp, calculate it’s 3D position and display that information in text with it’s self? (a kind of object oriented thing where the comp on the 3D layer contains expressions that react to it’s existence in the 3D comp)

    And if so, could it maybe calculate it’s 2D direction vector (on the “ground plain” where going in the only positive Z would be 0

    Filip Vandueren replied 19 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Filip Vandueren

    March 24, 2007 at 5:57 pm

    Anything you can calculate within 1 comp, you can access or calculate from another comp, by preceding the dotsyntax with the compname instead of thisComp, like this:

    l=comp(“comp 2”).layer(“layer 1”);

    So as long as you can calculate it from within the precomp itself it should be no problem.

    Example:

    you have a comp with a layer that has a lensflare: “comp 1”
    this comp is used as a 3D-layer in another comp: “comp 2”, here comp 1 has been rotated and scaled etc.

    you want comp 1 to know in a textlayer, where the lensflare point winds up inside comp 2, so after layer space transforms:

    a text-layer in Comp 1 could calculate like this:

    l=thisComp.layer("Black Solid 1");
    flare_2dpos=l.toComp(l.effect("Lens Flare")("Flare Center"));
    l2=comp("Comp 2").layer("Comp 1");
    l2.toComp(flare_2dpos);

    Note that in line 3 you explicitly have to say in what composition comp 1 is used and as what layer.
    Motionscript has no way of knowing by itself.

    Deeper nesting is possible, just keep stacking layerTransform upon Layertransform.
    But when you start collapsing 3D geometries… that’ll be a lot of headscratching an vector maths I think.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy