Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Layer’s transformation matrix to obtain parent’s inverse transform

  • Layer’s transformation matrix to obtain parent’s inverse transform

    Posted by Luis Martinez on February 9, 2016 at 9:23 am

    Hey, everyone.

    Simply put, I’m trying to find a transformation matrix capable of emulating the regular layer transform properties, hence its inverse can be used to cancel out any parent layer’s transformation. So far, I’ve not been able to figure out the right operations and concatenation order for position. I think this matrix would be really useful in cases where a layer must follow certain transformations from another layer, without the hassle of assigning the leader layer by complex dynamic coding and just parenting instead.

    Scale and rotation are easy enough to inverse by using something like the code above, but position is a totally different story since parent’s position, anchorPoint, scale and rotation come together into play.

    These expressions work regardless of the layers hierarchy, which is nice. Hopefully I made myself clear.

    Cheers.

    //Reverse parent's scale
    var x = length( toCompVec( [1, 0 ] ) );
    var y = length( toCompVec( [0, 1 ] ) );
    [ x * value[0], y * value[1] ]

    //Reverse parent's rotation
    var c = toCompVec( [1, 0] );
    -radiansToDegrees( Math.atan2( c[1], c[0] ) )

    //Reverse parent's position
    ????

    Luis Martinez replied 10 years, 5 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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