Tokenmagic
Tokenmagic copied to clipboard
Fade out effect instead of abruptly kill it
Is there a current way to fade out an effect instead of abruptly kill it? If not can there be? (is so how?)
Only if you manage to create an animation to simuate a fade effect. I'm not very familiar with all the animation parameters. Here's a toggleable, fading blur effect; it works basically like the Turn into Mystery Man effect. Maybe you can apply this to other effects. The important bits are animType: "halfCosOscillation" and loops: 1; val1 should contain the faded-out value, val2 the faded-in value. If you animate every parameter of a effect this way, you get a fading, toggleable effect.
let params =
[{
filterType: "blur",
filterId: "myToggleableBlur",
padding: 10,
quality: 4.0,
blur: 0,
blurX: 0,
blurY: 0,
animated:
{
blurX:
{
active: true,
animType: "halfCosOscillation",
loopDuration: 3000,
loops: 1,
val1: 0,
val2: 6
},
blurY:
{
active: true,
animType: "halfCosOscillation",
loopDuration: 3000,
loops: 1,
val1: 0,
val2: 6
}
}
}];
TokenMagic.addUpdateFiltersOnSelected(params);
But generally there's no easy way to fade-out/fade-in effects currently.