Forum Replies Created

Viewing 1 - 10 of 10,170 posts
  • Dan Ebberts

    December 4, 2022 at 11:39 pm

    I don’t really understand what you’re trying to do with the random stuff, but this example might be helpful:

    E = thisComp.layer("Effector");
    radius = E("Contents")("Ellipse Path 1")("Size")[0]/2;
    minFactor = .1;
    f = thisComp.frameDuration;
    p1 = E.position;
    p2 = position;
    tAccum = 0;
    for (t = inPoint; t <= time; t += f){
    d = length(p1.valueAtTime(inPoint+tAccum),p2.valueAtTime(inPoint+tAccum));
    if (d < radius){
    factor = linear(d,0,radius,minFactor,1);
    tAccum += f*factor;
    }else{
    tAccum += f;
    }
    }
    position.valueAtTime(tAccum);
  • Dan Ebberts

    December 4, 2022 at 12:27 am

    Hmm… that looks like scripting. I thought you were asking about expressions.

  • Dan Ebberts

    December 3, 2022 at 9:57 pm

    No way to do that, I’m afraid. If you can’t keyframe it, you can’t control it with an expression.

  • Dan Ebberts

    December 2, 2022 at 5:49 pm

    Yes, so your idea of using a slider for all but the main dropdown is probably best.

  • Dan Ebberts

    December 2, 2022 at 4:46 pm

    This might be overkill, but it might give you some ideas:

    http://www.motionscript.com/design-guide/marker-sync.html

  • Dan Ebberts

    December 2, 2022 at 2:05 pm

    Sorry, I posted in the wrong thread. I’ll be back…

  • Dan Ebberts

    December 1, 2022 at 7:58 pm

    I’m not sure this is what you mean, but couldn’t you just apply an expression like this to the Menu properties in the subcomps:

    comp("Main").layer("Controls").effect("Dropdown Menu Control")("Menu")
  • Dan Ebberts

    November 30, 2022 at 6:00 pm

    To get you started, create a Shape Layer (Layer > New > Shape Layer). Add a Rectangle and a Fill.

    Add this expression to the Rectangle’s Size property:

    minWidth = 5;
    maxWidth = 25;
    seedRandom(index,true);
    [random(minWidth,maxWidth),thisComp.height]

    Add this expression to the Fill Color:

    minVal = [.5,.5,.5,1];
    maxVal = [1,1,1,1];
    seedRandom(index,true);
    random(minVal,maxVal)

    Add this expression to the Layer’s Position:

    minFreq = .25;
    maxFreq = .75;
    seedRandom(index,true);
    freq = random(minFreq,maxFreq);
    amp = thisComp.width/2;
    w = wiggle(freq,amp);
    [w[0],value[1]]

    Add this expression to the Layer’s Opacity:

    minVal = 25;
    maxVal = 100;
    seedRandom(index,true);
    random(minVal,maxVal)

    Duplicate the layer a bunch of times.

  • Dan Ebberts

    November 29, 2022 at 10:04 pm

    Actually, this version should work from -41 to +41 degrees:

    a = degreesToRadians(rotation);
    offset = (value[0]/2)*Math.tan(a);
    len = (thisComp.height/2)/Math.cos(a) + (a < 0 ? -offset : offset);
    [value[0],len*2]
  • Dan Ebberts

    November 29, 2022 at 9:58 pm

    I think I read the question wrong. I think it would be like this (and would only be good up to about 40 degrees):

    a = degreesToRadians(rotation);
    len = (thisComp.height/2)/Math.cos(a) + (value[0]/2)*Math.tan(a);
    [value[0],len*2]
Viewing 1 - 10 of 10,170 posts

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