Syntax of expressions
Posted: Wed Feb 06, 2019 12:46 am
I would like to animate the r, g, and b values of the color of a background node with an expression based on time.
I selected "modify with", and chose "expression", and got a large block under the Modifiers tab. I can put simple expressions in the "Number Out" field "sin(time*20)/2+.5", but I haven't been able to figure out what language these expressions are supposed to be in.
One part of the manual suggests I should be able to use "iff(expr, a, b)" for a conditional, another suggests "if(expr, a, b)", and my experience is that neither of these works. If anything is wrong, I just get 0 out of the expression, and a very uninteresting black.
The words "and" and "or" cause this error behavior, and I was able to get "&&" and "||" to work for and and or, but I wasn't able to get an if/else type conditional to work with this.
Is there somewhere I'm missing where these are documented.
What I'm trying to do is have a pulsing pattern during some frame ranges, and during others have it held to a constant. I'd rather do this with an expression so that the parameters can easily be changed (pulse rate, how long it is on for, etc).
Thanks,
David
I selected "modify with", and chose "expression", and got a large block under the Modifiers tab. I can put simple expressions in the "Number Out" field "sin(time*20)/2+.5", but I haven't been able to figure out what language these expressions are supposed to be in.
One part of the manual suggests I should be able to use "iff(expr, a, b)" for a conditional, another suggests "if(expr, a, b)", and my experience is that neither of these works. If anything is wrong, I just get 0 out of the expression, and a very uninteresting black.
The words "and" and "or" cause this error behavior, and I was able to get "&&" and "||" to work for and and or, but I wasn't able to get an if/else type conditional to work with this.
Is there somewhere I'm missing where these are documented.
What I'm trying to do is have a pulsing pattern during some frame ranges, and during others have it held to a constant. I'd rather do this with an expression so that the parameters can easily be changed (pulse rate, how long it is on for, etc).
Thanks,
David