Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Scripting Problem: Can I show up only the comps/solids that appear in my viewer?

  • Scripting Problem: Can I show up only the comps/solids that appear in my viewer?

    Posted by Jorge Granados on January 24, 2017 at 12:58 am

    I have this grid of solid layers and camera transitions between solids.

    With a script that I’m doing I want to change the solids with compositions, everyone with a different time duration and the camera transitions and solids replacement with my scenes’ compositions will adjust automatically.

    My problem is that if i left all the comps active all the time the render will consume too much time. Is there a way to hide comps and show only the ones that are around my current composition? Like the ones with a blue cross.

    Jorge Granados replied 9 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Emre Anil

    January 24, 2017 at 11:18 am

    Assuming your TARGET is on top of the Blue Solid in your first image and attached to your camera, you can add the following expression on the opacity of every comp in your grid. You need to tweak the distance values..

    if( Math.abs(this.transform.position[0] – thisComp.layer(“TARGET”).transform.position[0]) < 1920 &&
    Math.abs(this.transform.position[1] – thisComp.layer(“TARGET”).transform.position[1]) < 1080)
    100
    else
    0

    Hope this helps..

  • Jorge Granados

    January 26, 2017 at 5:17 pm

    I thought of making something similar, actually thanks for the help because your answer fits in a single line haha
    If I’m understading well, by TARGET you mean a null parented to my layer that is doing the animation?

    I have a null doing the animation so the target’s null will be in the same position as my animation null, but when I do 3D rotations my null goes to far from my actual view as you can see in my second image. Am I doing something wrong? Thanks for your answer and interest in advance.

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