Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Control Scale with a Null

  • Control Scale with a Null

  • Simon Terrey

    March 1, 2023 at 3:37 pm

    Hi there! I used to use this expression to control an objects scale with a Null but it no longer works in CC2023:

    AE says: Line 7 (dis = length…) is at fault. Has the expression language changed?

    mouse_layer = thisComp.layer(“Scale_Control”);//Mouse layer

    beginScale = [100,100]; //

    endScale = [50,50]; //

    beginDistance = 200;//Distance to begin magnifying in pixels

    endDistance = 0;//Distance to end magnifying in pixels

    //–Don’t modify below here

    dis = length(this.position, mouse_layer.position);

    ease(dis, beginDistance, endDistance, endScale, beginScale);

  • Dan Ebberts

    March 1, 2023 at 4:46 pm

    Try changing this line:

    dis = length(this.position, mouse_layer.position);

    to this:

    dis = length(position, mouse_layer.position);
  • Simon Terrey

    March 1, 2023 at 5:08 pm

    Amazing! When I turned ‘Legacy ExtendScript’ on in Expressions in Project Settings the old script worked but yours works fine in JavaScript.

    Thank you so much Dan!

Viewing 1 - 3 of 3 posts

Log in to reply.

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