Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Rotation expression to rotate each layer below 22.5 degrees less

  • Rotation expression to rotate each layer below 22.5 degrees less

  • Erik reinholdz

    March 26, 2020 at 4:29 pm

    I am new to expressions and am trying to rotate multiple shape layers. So far I keyframed the top layer to rotate around the z axis 360 degrees. There is a slider on the first layer that controls the time offset and an index/value at time expression on the layer below. The problem is that every layer rotates 360 degrees and I want each layer below when duplicated to rotate 22.5 degrees less and all ease in and out. The expression I used is:

    timeoffset = thisComp.layer(“top card”).effect(“Slider Control”)(“Slider”);

    thisComp.layer(“top card”).transform.rotation.valueAtTime(time – ((index – 1) * timeoffset))

    layer 1 360

    layer 2 337.5

    layer 3 315 etc.

    I would appreciate some suggestions. Thank you.

    timeoffset = thisComp.layer("top card").effect("Slider Control")("Slider");

    thisComp.layer("top card").transform.rotation.valueAtTime(time - ((index - 1) * timeoffset))

  • Andrei Popa

    March 26, 2020 at 6:27 pm

    This will work with normal easing:


    masterLayer = hisComp.layer("top card");
    timeoffset = masterLayer.effect("Slider Control")("Slider");
    duration = masterLayer.rotation.key(2).time-masterLayer.rotation.key(1).time;
    idx = index-1;
    delay = timeoffset*idx;
    maxValue = 360-22.5*idx;
    ease(time,delay,delay+duration,0,maxValue);

    Andrei
    My Envato portfolio.

  • Vahab San

    March 26, 2020 at 8:48 pm

    Hey

    Try this:

    to = effect("time ofset")("Slider");
    t = thisComp.layer(index-1).transform.rotation.valueAtTime(time-to);
    v2 = thisComp.layer(1).transform.rotation.key(2).value-((index-1)*22.5);
    t >= v2 ? v2 : t;

  • Erik reinholdz

    March 27, 2020 at 9:16 pm

    Thank you! This worked great! I’m probably pushing my luck, but do you know how I could add to the expression to have each layer also rotate around their x axis in the center of the shape? In other words each layer would have an additional centered anchor point to rotate around with ease and ideally be controlled by another slider.

  • Erik reinholdz

    March 27, 2020 at 9:24 pm

    Thank you! This one also worked really well. The only difference was that I think had to move the slider to the second layer to make it work. Therefore to make adjustments I have to delete all the below layers, adjust the slider and reduplicate.

Viewing 1 - 5 of 5 posts

Log in to reply.

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