FORUMS: list search recent posts

Expression needed to make side of cube mirror/reflect movement of opposite side of cube. Eg. Sides fly out.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Lee Midwinter
Expression needed to make side of cube mirror/reflect movement of opposite side of cube. Eg. Sides fly out.
on Mar 20, 2016 at 8:16:24 pm

Hi,
I am pretty new to AE.

I thought I would be smart making a spinning cube with the opposite sides flying out then rejoining the cube (one side mirroring the movement of the opposite side).

I smuggly made my cube with all sides parented to a null object to make it spin. All good so far. Then I pick whipped one cube side's 'Position' to it's opposite side's 'Position', naively thinking that would somehow magically know I wanted the opposite side to reflect the actions of it's parent. It obviously didn't. It exactly matched the cube side making my cube look like a side was missing (because two sides were now on the exact same coordinates).

I need to make the side reflect the parented solid's actions rather than copy it. So for example, if the parent moves 400 in one direction I need the opposite side to move 400 in the opposite direction. Sadly I have no clue how to write this.
Pretty sure this is easy for people on here.
I am out of my depth.
Help.

I have included the code which makes it exactly copy the movement. What do I need to add or change?

Thanks in advance.

thisComp.layer("side 2").transform.position


Return to posts index


Kalle Kannisto
Re: Expression needed to make side of cube mirror/reflect movement of opposite side of cube. Eg. Sides fly out.
on Mar 21, 2016 at 7:42:30 am

You need the position to be a negative of the distance from the null (assuming your null is in the center of the cube).

thisComp.layer("Null 1").transform.position+(thisComp.layer("Null 1").transform.position-thisComp.layer("Your other layer name here").transform.position)


Return to posts index

Lee Midwinter
Re: Expression needed to make side of cube mirror/reflect movement of opposite side of cube. Eg. Sides fly out.
on Mar 21, 2016 at 10:26:22 am

Yes!
Great, it works!

Thanks a lot Kalle.

L


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]