Copy link to clipboard
Copied
Hello, I am tweening one property between two key points, and I'd like to use just integer rounded values for changing values and not also decimals. While the default behavior of the transitions is smooth, I'd like to make it in clearly visible steps.
Thank you very much
Copy link to clipboard
Copied
I guess that would be
Math.round(value)
for one-dimensional properties
[Math.round(value[0]),Math.round(value[1])]
for two-dimensional properties, etc.
Copy link to clipboard
Copied
Sorry for my unfamiliarity, how would I use this expression when animating, per example, the opacity of an object?
Ok thank you very much.
Copy link to clipboard
Copied
You'd apply it (the one-dimensional version) to the keyframed opacity property, but I'm not sure it's going to give you discrete steps you're envisioning. You might want something more like this:
Math.floor(value/10)*10
Copy link to clipboard
Copied
Are you trying to get a stepping action between two keyframes? For example, zero opacity at the start of a layer, then 100% at 4 seconds, but you want the opacity to change to 25% at 1 second 50% at 2, then 75% at 3, you could round the time value so time would always be a whole number, then multiply that number by 25. Something like this:
t = time - inPoint;
v = Math.floor(t);
v * 25
It would help if we knew exactly what you were trying to accomplish.