Forum Replies Created

Page 996 of 1081
  • Dan Ebberts

    November 9, 2006 at 2:00 am in reply to: Calculating angle from camera to object – expression

    Colin,

    Your analysis is dead on.

    v2 = C.toWorldVec([0,0,1]);

    This just creates a unit vector in the direction of the camera’s z axis and translates it to world coordintes. Then you have the two unit vectors you need to find the angle.

    Dan

  • Dan Ebberts

    November 9, 2006 at 2:00 am in reply to: Calculating angle from camera to object – expression

    Colin,

    Your analysis is dead on.

    v2 = C.toWorldVec([0,0,1]);

    This just creates a unit vector in the direction of the camera’s z axis and translates it to world coordintes. Then you have the two unit vectors you need to find the angle.

    Dan

  • Dan Ebberts

    November 8, 2006 at 9:55 pm in reply to: Expression: X&Y coordinates

    Something like this:

    p = thisComp.layer(“myLayer”).position;
    “” + Math.round(p[0]*100)/100 + ” ” + Math.round(p[1]*100)/100

    Dan

  • Dan Ebberts

    November 8, 2006 at 9:55 pm in reply to: Expression: X&Y coordinates

    Something like this:

    p = thisComp.layer(“myLayer”).position;
    “” + Math.round(p[0]*100)/100 + ” ” + Math.round(p[1]*100)/100

    Dan

  • Dan Ebberts

    November 8, 2006 at 9:47 pm in reply to: Calculating angle from camera to object – expression

    It’ll probably be some variation of something like this:

    C = thisComp.layer(“Camera 1”);
    v1 = normalize(position – C.position)
    v2 = C.toWorldVec([0,0,1]);
    radiansToDegrees(Math.acos(dot(v1,v2)))

    Dan

  • Dan Ebberts

    November 8, 2006 at 9:47 pm in reply to: Calculating angle from camera to object – expression

    It’ll probably be some variation of something like this:

    C = thisComp.layer(“Camera 1”);
    v1 = normalize(position – C.position)
    v2 = C.toWorldVec([0,0,1]);
    radiansToDegrees(Math.acos(dot(v1,v2)))

    Dan

  • This should do it as long as you don’t go above 999,999:

    startCount = 0;
    endCount = 500000;
    countDur = 200;
    s = “” + Math.round(linear(time,0,countDur,startCount,endCount));

    if (s.length > 3){
    s.substr(0, s.length -3) + “,” + s.substr(-3);
    }else{
    s
    }

    Dan

  • This should do it as long as you don’t go above 999,999:

    startCount = 0;
    endCount = 500000;
    countDur = 200;
    s = “” + Math.round(linear(time,0,countDur,startCount,endCount));

    if (s.length > 3){
    s.substr(0, s.length -3) + “,” + s.substr(-3);
    }else{
    s
    }

    Dan

  • Dan Ebberts

    November 7, 2006 at 8:22 pm in reply to: Turning on and off an effect via expressions

    I see a couple of basic problems. First, you can’t affect a property with an expression applied to a different property. An expression can only control the value of the property it’s applied to.

    Second, an effect’s “active” attribute is read-only.

    What you could do though is apply an expression to the Brush Stroke’s Blend With Original parameter and set it to 0 or 100% based on the checkbox.

    Dan

  • Dan Ebberts

    November 7, 2006 at 8:22 pm in reply to: Turning on and off an effect via expressions

    I see a couple of basic problems. First, you can’t affect a property with an expression applied to a different property. An expression can only control the value of the property it’s applied to.

    Second, an effect’s “active” attribute is read-only.

    What you could do though is apply an expression to the Brush Stroke’s Blend With Original parameter and set it to 0 or 100% based on the checkbox.

    Dan

Page 996 of 1081

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