- November 6, 2015 at 7:18 am
I have a a arrow as a compass, I have a numbers plug in, I have pickwiped the numbers to the rotation and
when I rotate the rotation 0n the arrow the numbers work fine 1 to 360 degrees in the clockwise rotation but as soon as I rotate the numbers anticlockwise the number go into minus which is not what I want
can anybody give me an expression to cure this and stop going into the minus numbers
- November 6, 2015 at 9:27 am
If you want to restrict angles only to positive numbers, you can add simple math expression to your pick whipped numbers expression. Something like this:
where “arrow” is your layer with numbers.
I hope it helps 🙂
- November 6, 2015 at 10:28 am
I tried this
Maths.abs (thisComp.layer)(“Type 190”).transform.rotation and didn’t work the Type 190 is the layer with the numbers plug in?
- November 6, 2015 at 10:37 am
Where do I add this piece of expression do i make a new line and add it under the pickedwipp expression or do I replace the pickedwipp expression?
- November 6, 2015 at 10:38 am
You should put your current expression on a layer with the numbers plugin (Type 190) inside brackets of the function: Math.abs(). Your statement seems to have the closing bracket missing and additional “s” in Math name. Probably it should look like this:
Math.abs ( thisComp.layer(“Type 190”).transform.rotation )
- November 6, 2015 at 10:50 am
This is my procedureI pickwhipp the numbers value on the Type 190 layer to the Rotation on the Arrow layer a expression comes up on the Type 190 layer I paste the new expression over the old expression it doesn’t work Am i doing something wrong?
- November 6, 2015 at 11:06 am
- November 6, 2015 at 11:09 am
Yea cracked it just took a while for me to get my head around it Many thanks
- November 6, 2015 at 11:15 am
You’re welcome 🙂
Glad to hear, the problem is solved.
- November 6, 2015 at 8:43 pm
I’m wondering if maybe it should be like this:
r = thisComp.layer(“Type 190”).transform.rotation%360;
r < 0 ? r + 360 : r
Otherwise you’ll get different values for the same orientation, depending on whether you got there by going clockwise or counter clockwise.
Log in to reply.