Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Bar Graph Issues (file included)

  • Bar Graph Issues (file included)

    Posted by Ambrose Salmini on January 29, 2018 at 3:09 pm

    So I have a bar graph with a logo above each bar. The head/logos are pulled closer in z-space (-1000px). This is because of a style I have in the transition and I don’t want to lose the parallax. When I parent the head/logo to the bar, it moves up with the bar, but because of the z space difference it moves exponentially more pixels than the bar, creating unwanted space between the head/logo and the bar.

    I’ve also tried to use sourceRectAtTime() to no avail, as it still produces the same issue.

    Hopefully someone can help. Thanks!

    Here is project showing the issue

    https://www.dropbox.com/s/lzhfv9hnk8p0qsp/bar%20graph%20sample%20folder.zip?dl=0

    Ambrose Salmini replied 8 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    January 30, 2018 at 7:52 am

    In the folowing expression the camera can not be parented as it will return the wrong value. You can use toWorld() or toComp() in that case(haven’t really used those, so i can not go in more detail). You put a null at the top of the bar and make it stay there. Then use this expression on your logo layers position. Modify mult until the position is the one you want. Mult should be the distance between camera and your logo. It is not my expression, I got it from here https://zacklovatt.com/points-along-a-line/

    p1 = thisComp.layer("Camera").transform.position;
    p2 = thisComp.layer("NullAtTopOfBar").transform.position;
    mult = thisComp.layer("HELPER").effect("Distance")("Slider");

    p1 + mult*(p2-p1)/length(p1,p2);

    Andrei
    My Envato portfolio.

  • Ambrose Salmini

    January 30, 2018 at 3:04 pm

    Thanks Andrei,

    While this does work to keep the logo in place, it seems to actually be pushing the logo back in z space, effectively removing the distance I want to keep in Z space.

    I too tried toWorld() and toComp() but I have a minimal understanding of it currently. Maybe that is where the answer lies.

    Is there anyone that can help with that?

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