Forum Replies Created

Page 1063 of 1081
  • Dan Ebberts

    August 29, 2005 at 12:37 am in reply to: quick script help

    I’m not sure what you’re after exactly, but here’s a clock expression (for a text layer’s source text) that might help:

    
    beginTime = 0; // beginning time (seconds)
    mult = 1; // clock speed multiplier
    
    function digits(myVal,myNumDigits){
      var s = myVal.toString();
      while (s.length < myNumDigits) s = '0' + s;
      return s;
    }
    
    currTime = beginTime + time*mult;
    
    hr = digits(Math.floor(currTime/3600),2);
    min = digits(Math.floor((currTime%3600)/60),2);
    sec = digits(Math.floor(currTime)%60,2);
    ms = digits(Math.floor(currTime%1*1000),3);
    hr + ":" + min + ":" + sec + "." + ms
    
    

    If you want it to start at a time other than 0, set beginTime.
    If you want it to count faster or slower than comp time, modify mult.
    (mult = -1 will count down).

    Dan

  • Dan Ebberts

    August 29, 2005 at 12:37 am in reply to: quick script help

    I’m not sure what you’re after exactly, but here’s a clock expression (for a text layer’s source text) that might help:

    
    beginTime = 0; // beginning time (seconds)
    mult = 1; // clock speed multiplier
    
    function digits(myVal,myNumDigits){
      var s = myVal.toString();
      while (s.length < myNumDigits) s = '0' + s;
      return s;
    }
    
    currTime = beginTime + time*mult;
    
    hr = digits(Math.floor(currTime/3600),2);
    min = digits(Math.floor((currTime%3600)/60),2);
    sec = digits(Math.floor(currTime)%60,2);
    ms = digits(Math.floor(currTime%1*1000),3);
    hr + ":" + min + ":" + sec + "." + ms
    
    

    If you want it to start at a time other than 0, set beginTime.
    If you want it to count faster or slower than comp time, modify mult.
    (mult = -1 will count down).

    Dan

  • Dan Ebberts

    August 28, 2005 at 11:40 pm in reply to: How to make wiggle layer only in x axis ?

    If you want to wiggle just x and leave y alone you could do it this way:

    freq = 7;
    amp = 50;
    w = wiggle(freq,amp);
    [w[0],value[1]]

    If you want to wiggle both x and y but with different parameters, you could do it like this:

    xFreq = 7;
    xAmp = 50;
    yFreq = 3;
    yAmp = 100;
    wX = wiggle(xFreq,xAmp);
    wY = wiggle(yFreq,yAmp);
    [wX[0],wY[1]]

    Dan

  • Dan Ebberts

    August 28, 2005 at 11:40 pm in reply to: How to make wiggle layer only in x axis ?

    If you want to wiggle just x and leave y alone you could do it this way:

    freq = 7;
    amp = 50;
    w = wiggle(freq,amp);
    [w[0],value[1]]

    If you want to wiggle both x and y but with different parameters, you could do it like this:

    xFreq = 7;
    xAmp = 50;
    yFreq = 3;
    yAmp = 100;
    wX = wiggle(xFreq,xAmp);
    wY = wiggle(yFreq,yAmp);
    [wX[0],wY[1]]

    Dan

  • Dan Ebberts

    August 28, 2005 at 10:27 pm in reply to: Changing color of a light randomly with expressions

    In expressions, color is represented as an array of [red,green,blue,alpha] where the values have to be between 0 and 1. (Leave the alpha value set to 1 – it doesn’t do anything but it has to be there. So this would be one way to change the color at random every half second:

    
    
    period = 0.5; // change color every .5 seconds
    colors = [[1,0,0,1], // red
              [0,1,0,1], // green
              [0,0,1,1], // blue
              [1,0,1,1], // magenta
              [1,1,0,1], // yellow
              [0,1,1,1]] // cyan
    
    seed = Math.floor(time/period);
    seedRandom(seed,true);
    idx = Math.floor(random(colors.length));
    colors[idx]
    
    

    Dan

  • Dan Ebberts

    August 28, 2005 at 10:27 pm in reply to: Changing color of a light randomly with expressions

    In expressions, color is represented as an array of [red,green,blue,alpha] where the values have to be between 0 and 1. (Leave the alpha value set to 1 – it doesn’t do anything but it has to be there. So this would be one way to change the color at random every half second:

    
    
    period = 0.5; // change color every .5 seconds
    colors = [[1,0,0,1], // red
              [0,1,0,1], // green
              [0,0,1,1], // blue
              [1,0,1,1], // magenta
              [1,1,0,1], // yellow
              [0,1,1,1]] // cyan
    
    seed = Math.floor(time/period);
    seedRandom(seed,true);
    idx = Math.floor(random(colors.length));
    colors[idx]
    
    

    Dan

  • Dan Ebberts

    August 28, 2005 at 2:59 pm in reply to: Headscratching 3D error: Z-position

    That is strange indeed. You might want to drop a line to aebugs@adobe.com.

    Dan

  • Dan Ebberts

    August 28, 2005 at 2:59 pm in reply to: Headscratching 3D error: Z-position

    That is strange indeed. You might want to drop a line to aebugs@adobe.com.

    Dan

  • Dan Ebberts

    August 26, 2005 at 5:21 pm in reply to: Smooth Random number count down and up

    How about just using the wiggle expression?

    First set the value of the parameter to the middle of the range you want and then add an expression like this:

    freq = 1.0; //frequency = once per second
    amp = 20; // amplitude = -20 to +20
    wiggle(freq,amp)

    If, for example, you set the value of your parameter to 60 and then added the above expression, your parameter would vary between 40 and 80.

    Dan

  • Dan Ebberts

    August 26, 2005 at 5:21 pm in reply to: Smooth Random number count down and up

    How about just using the wiggle expression?

    First set the value of the parameter to the middle of the range you want and then add an expression like this:

    freq = 1.0; //frequency = once per second
    amp = 20; // amplitude = -20 to +20
    wiggle(freq,amp)

    If, for example, you set the value of your parameter to 60 and then added the above expression, your parameter would vary between 40 and 80.

    Dan

Page 1063 of 1081

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