Forum Replies Created

  • Gabriel Grenier

    November 27, 2021 at 6:16 pm in reply to: Convert a 3D position to 2D position *and scale*

    I’ll put the working solution here for future reference.

    The following expressions assume that the target 3D layer is the next one, right under the 2D layer (index+1), but that could be changed of course.

    Expression for position:
    thisComp.layer(index+1).toComp(thisComp.layer(index+1).transform.anchorPoint)

    Expression for Scale:

    L = thisComp.layer(index+1);

    C = thisComp.activeCamera;

    CP = C.toWorld([0,0,0]);

    LP = L.toWorld(thisComp.layer(index+1).anchorPoint);

    dis = length(CP,LP);

    CZ = C.cameraOption.zoom;

    LS = L.transform.scale[0];

    S = LS*CZ/dis;

    [S,S];

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