Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions .tocomp expression seems to not be accurate

  • .tocomp expression seems to not be accurate

    Posted by Daniel Jschv on September 24, 2013 at 4:49 pm

    Hi everybody,

    i have a problem in my actual project with the expression “.tocomp”
    I just have a bunch of basically squares fly in 60° to the camera and all of those should
    be connected with lines. I have all of them in a precomp.
    Well i have now always two 3d-null-objects and a layer with the effect beam on it.
    These two nulls are parented to a “Supernull” which is parented to the movement of the precomp with
    all the stuff inside… just to let the lines move with their objects.

    Now i use an expression like this one:

    L = thisComp.layer(“Null Start”);
    L.toComp([0,0,0])

    for the starting point and the same for the ending point.

    My Problem is, that the more my Nulls move to the side of the comp the more space is there between the ankor-point and the actual start/ending of the beam. And i do not get why.Does someone have any idea why and how there could come a slight parallax between the start of the beam and the ankor-point of the null?

    Edit: I actually already unparanted my null and moved it just like that and there still is a offset between the start and the ankorpoint

    Thanks alot in advance!

    L = thisComp.layer("Null Start");
    L.toComp([0,0,0])

    Dan Ebberts replied 12 years, 11 months ago 3 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    September 24, 2013 at 5:30 pm

    Is the Beam effect on a 2D layer? Are all the layers and the comp square pixels?

    Dan

  • Daniel Jschv

    September 24, 2013 at 5:59 pm

    Hey Dan,

    yes all Beam-Layers are 2D, all Nulls are 3D (2 per Beamlayer) and the pixelratio is square.

  • Dan Ebberts

    September 24, 2013 at 6:19 pm

    Assuming you have the Beam Length set to 100%, the only way I can get that to happen is if the pixel aspect ratio of the comp doesn’t match the Beam layer. If everything is square, I don’t know what’s happening. Maybe you could post a sample project.

    Dan

  • Daniel Jschv

    September 25, 2013 at 8:49 am

    OK i tryed to reproduce it and i just can’t.
    It works perfekt when i just make two new nulls and a new beam-layer, then apply the expressions everything works fine! Even in the same comp which has the problem! So its nothing global.
    The other Beams however still miss the ankor-points of their nulls a tiny bit which makes it hard to make them stick to sth and requires me to animate nearly frame by frame.

    I compared now all the parameters of the two beam-combos… and i just cant find any difference.
    I just noticed, that when i take the “healthy beam” and link it to one null of the “Bad combination” it still works. Meaning it exactly hits the ankorpoint no matter where it is.
    However when i link my “bad beamlayers” end to any null it doesnt work. It misses the ankorpoint just a bit… sometimes too short sometime too long.

    Btw. i produced those beams by copy and paste all three objects (2x null, 1x beamlayer) and then changing links in the expression.

    thanks in advance

  • Daniel Jschv

    September 25, 2013 at 9:48 am

    OK i tryed to reproduce it and i just can’t.
    It works perfekt when i just make two new nulls and a new beam-layer, then apply the expressions everything works fine! Even in the same comp which has the problem! So its nothing global.
    The other Beams however still miss the ankor-points of their nulls a tiny bit which makes it hard to make them stick to sth and requires me to animate nearly frame by frame.

    I compared now all the parameters of the two beam-combos… and i just cant find any difference.
    I just noticed, that when i take the “healthy beam” and link it to one null of the “Bad combination” it still works. Meaning it exactly hits the ankorpoint no matter where it is.
    However when i link my “bad beamlayers” end to any null it doesnt work. It misses the ankorpoint just a bit… sometimes too short sometime too long.

    Btw. i produced those beams by copy and paste all three objects (2x null, 1x beamlayer)

    Edit: ok i found a fix it seems… i activated the “sun-symbol” on the beam-layers. And it fixed it for the bad layers. The new and good ones are fitting also without the sun-symbol. Interessting. Someone an idea what the reason is for that?

  • Darby Edelen

    September 25, 2013 at 9:25 pm

    [Daniel Jschv] “Edit: ok i found a fix it seems… i activated the “sun-symbol” on the beam-layers. And it fixed it for the bad layers. The new and good ones are fitting also without the sun-symbol. Interessting. Someone an idea what the reason is for that?”

    The solids you applied the Beam effect to were not the same size as the composition.

    When using .toComp() you’ll get back a coordinate in composition space. For a layer’s space to match composition space it must be exactly the same size and orientation as the composition.

    When you enable the continuously rasterize switch (the sun icon) it changes the render order of all effects applied to the solid. They are now rendered and applied in composition space after the layer has been transformed.

    Darby Edelen

  • Dan Ebberts

    September 26, 2013 at 3:07 am

    This should take care of the beam layer not being comp-sized:

    L = thisComp.layer(“Null Start”);
    fromComp(L.toComp([0,0,0]))

    Dan

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