Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animating a rollover effect with expressions

  • Animating a rollover effect with expressions

    Posted by Ben Marshall on November 15, 2007 at 3:30 pm

    Hi there,

    I have been given the unenviable task of animating a large number of buttons in a video presentation of a user interface. There are nearly 100 buttons which i have created a roll on and roll off animation for, but rather than manually adding the keyframes to each button when the cursor rolls on and off (which would take ages) I was wondering if there was any way of automating the process using expressions.

    I was considering using time remapping, but then how to control the time remap with information about where the cursor is? ideally I would like to be able to trigger the animations for each button using information about the location of the cursor. Is this at all possible? I am relatively new to expressions so I have no idea if what I’m asking is impossible.

    I would greatly appreciate your help

    Cheers

    Dan Ebberts replied 18 years, 9 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    November 15, 2007 at 3:57 pm

    It’s hard to picture how you have things set up but if you already have each button animated, you could certainly create an expression that controls time remapping based on the distance from your cursor layer.

    Or, you could control whatever attributes you’ve animated (scale, ???) directly with expressions, again based on the distance from the cursor. the best approach would depend on the specifics of your project.

    Dan

  • Ben Marshall

    November 16, 2007 at 10:38 am

    Hi there,

    Basically what I have is a row of buttons with a simple eased scale up and down animation for when the cursor moves over them, just like the mac os dock. During the course of the video the cursor will move over the buttons a number of times, at different speeds and angles etc, and I was wondering if there was a way of automating that without manually adding keyframes to every button every time the cursor moves over them.

    Cheers!

  • Dan Ebberts

    November 17, 2007 at 1:39 am

    OK – two examples. First, if you have your scale animation pre-comped so you can turn on time remapping, you could use a time remapping expression like this:

    minDist = 50;
    maxDist = 500;
    minTime = inPoint;
    maxTime = outPoint – thisComp.frameDuration;

    C = thisComp.layer(“cursor”);
    dist = length(C.toWorld(C.anchorPoint),toWorld(anchorPoint))
    linear(dist,minDist,maxDist,maxTime,minTime)

    Or, you might just control the scaling directly with a scale expression like this:

    minDist = 50;
    maxDist = 500;
    minScale = 50;
    maxScale = 200;

    C = thisComp.layer(“cursor”);
    dist = length(C.toWorld(C.anchorPoint),toWorld(anchorPoint))
    s = ease(dist,minDist,maxDist,maxScale,minScale);
    [s,s]

    Dan

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