diff --git a/.vs/Tokenmagic/v16/.suo b/.vs/Tokenmagic/v16/.suo index 6836581..2bcd517 100644 Binary files a/.vs/Tokenmagic/v16/.suo and b/.vs/Tokenmagic/v16/.suo differ diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index 3015976..1b8cd47 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -4,14 +4,13 @@ "\\tokenmagic", "\\tokenmagic\\fx", "\\tokenmagic\\fx\\filters", - "\\tokenmagic\\fx\\filters\\proto", "\\tokenmagic\\fx\\glsl", "\\tokenmagic\\fx\\glsl\\fragmentshaders", - "\\tokenmagic\\fx\\glsl\\vertexshaders", - "\\tokenmagic\\libs", + "\\tokenmagic\\fx\\presets", "\\tokenmagic\\module", + "\\tokenmagic\\module\\proto", "\\tokenmagic\\updates" ], - "SelectedNode": "\\tokenmagic\\fx\\glsl\\fragmentshaders\\glowoh.js", + "SelectedNode": "\\tokenmagic\\module\\tokenmagic.js", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 96fc219..682c8fb 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/README.md b/README.md index cfd72b2..df564d9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,162 @@ +# Token Magic FX - Update v0.2.1-alpha + +*Added :* +- An option to allow non-GM players to add, modify or delete FX on tokens which they do not own. +- Mirror-images filter overhaul with new properties : + - number of images + - alpha properties on images and character + - movement amplitude along the X and Y axis. + - 2 new macro in the portfolio (with an emphasis on new properties) +- Library of stored FX presets : + - comes with a default library (the same as in the portfolio) + - functions to add or delete presets in your library + - functions to export presets from your library into a json file + - functions to import presets into your library (local or URL) +- Added smooth edges on Force Field filter + +*New FX :* +- A pixelate filter (sample added in the portfolio) + +*Fixed issues :* +- Added the v0.2.0 missing macros in the portfolio. + - X-rays, liquid and x-glow macros +- Force field filter had a brightness and contrast problem. + - The colors are now more vivid. + - You may have to review your macros by adjusting color intensity. + - The Force field macros have been rewritten. +- Corrected some performances issues in the shaders +- Some animations could freeze with a large video or texture (animated tokens, etc.) + +*Thanks :* +- special thanks to @tposney + +## Managing Presets + +*Added new functions :* + +To add a preset in your library : +```javascript +(async) TokenMagic.addPreset(,,optional ) + +// Example +// You don't need to add a filterId when creating a preset. The filterId is created with the preset name. +// In the example below, the filterId will be equal to "FunnyGlow" +let params = + [{ + filterType: "glow", + color: Math.floor(Math.random() * 16777215) + }]; +TokenMagic.addPreset("FunnyGlow",params); +``` +To delete a preset in your library : +```javascript +(async) TokenMagic.deletePreset(,optional ); +``` +To get a preset from your library : +```javascript +TokenMagic.getPreset(); +``` + +To export your library in a json file +```javascript +TokenMagic.exportPresetLibrary(optional ); +``` + +To import presets into your library (open a file picker dialog) +```javascript +(async) TokenMagic.importPresetLibrary(); +``` + +To import presets into your library from a local path +```javascript +(async) TokenMagic.importPresetLibraryFromPath(); +``` + +To import presets into your library from an URL +```javascript +(async) TokenMagic.importPresetLibraryFromURL(); +``` + +To reset the preset library with the default presets (confirmation is requested) +```javascript +(async) TokenMagic.resetPresetLibrary(); +``` + +*A new option in the module option panel allow overwrite of duplicates (by preset name) on import. +By default, duplicates are ignored.* + +### Functions updates + +You can use presets with those functions below, by replacing the params with a preset name : +```javascript +TokenMagic.addFilters +TokenMagic.addFiltersOnSelected +TokenMagic.addFiltersOnTargeted +TokenMagic.addUpdateFiltersOnSelected +TokenMagic.addUpdateFiltersOnTargeted +TokenMagic.updateFiltersOnSelected +TokenMagic.updateFiltersOnTargeted +TokenMagic.updateFiltersByPlaceable + +// Example +TokenMagic.addFiltersOnTargeted("dead"); +``` + +### Default presets library content + +```javascript +0: {name: "bevel", params: Array(1)} +1: {name: "adjustment", params: Array(1)} +2: {name: "dropshadow", params: Array(1)} +3: {name: "outline", params: Array(1)} +4: {name: "glow", params: Array(1)} +5: {name: "bloom", params: Array(1)} +6: {name: "distortion", params: Array(1)} +7: {name: "oldfilm", params: Array(2)} +8: {name: "twist", params: Array(1)} +9: {name: "bulge", params: Array(1)} +10: {name: "blur", params: Array(1)} +11: {name: "zoomblur", params: Array(1)} +12: {name: "shockwave", params: Array(1)} +13: {name: "zapshadow", params: Array(1)} +14: {name: "rays", params: Array(1)} +15: {name: "fog", params: Array(1)} +16: {name: "fumes", params: Array(1)} +17: {name: "electric", params: Array(1)} +18: {name: "fire", params: Array(1)} +19: {name: "waves", params: Array(1)} +20: {name: "flood", params: Array(1)} +21: {name: "smoke", params: Array(1)} +22: {name: "images", params: Array(1)} +23: {name: "chaos-images", params: Array(1)} +24: {name: "spectral-images", params: Array(1)} +25: {name: "hexa-field", params: Array(1)} +26: {name: "fire-field", params: Array(1)} +27: {name: "smoke-field", params: Array(1)} +28: {name: "earth-field", params: Array(1)} +29: {name: "earth-field-top", params: Array(1)} +30: {name: "air-field", params: Array(1)} +31: {name: "magic-field", params: Array(1)} +32: {name: "chromatic-field", params: Array(1)} +33: {name: "water-field", params: Array(1)} +34: {name: "evil-field", params: Array(1)} +35: {name: "grid-field", params: Array(1)} +36: {name: "warp-field", params: Array(1)} +37: {name: "color-field", params: Array(1)} +38: {name: "sunburst", params: Array(1)} +39: {name: "clover", params: Array(1)} +40: {name: "scan", params: Array(1)} +41: {name: "blue-rays", params: Array(1)} +42: {name: "spectral-body", params: Array(1)} +43: {name: "mantle-of-madness", params: Array(1)} +44: {name: "drift-in-plans", params: Array(2)} +45: {name: "fire-aura", params: Array(2)} +46: {name: "glacial-aura", params: Array(2)} +47: {name: "anti-aura", params: Array(2)} +48: {name: "pure-fire-aura", params: Array(3)} +49: {name: "pure-fire-aura-2", params: Array(3)} +50: {name: "pure-ice-aura", params: Array(3)} +``` # Token Magic FX - Update v0.2.0-alpha *Added :* diff --git a/Tokenmagic.zip b/Tokenmagic.zip index 9c38fbb..138a2b4 100644 Binary files a/Tokenmagic.zip and b/Tokenmagic.zip differ diff --git a/tokenmagic/fx/filters/FilterColorMatrix.js b/tokenmagic/fx/filters/FilterColorMatrix.js deleted file mode 100644 index 715bcc5..0000000 --- a/tokenmagic/fx/filters/FilterColorMatrix.js +++ /dev/null @@ -1,20 +0,0 @@ -import { Anime } from "../Anime.js"; -import "./proto/FilterProto.js"; - -export class FilterXBloom extends PIXI.filters.AdvancedBloomFilter { - constructor(params) { - super(); - - this.enabled = false; - this.threshold = 0.5; - this.bloomScale = 1.0; - this.brightness = 1.0; - this.blur = 4.0; - this.quality = 4.0; - - this.animated = {}; - this.setTMParams(params); - this.anime = new Anime(this); - this.normalizeTMParams(); - } -} \ No newline at end of file diff --git a/tokenmagic/fx/filters/FilterElectric.js b/tokenmagic/fx/filters/FilterElectric.js index c463450..9e21200 100644 --- a/tokenmagic/fx/filters/FilterElectric.js +++ b/tokenmagic/fx/filters/FilterElectric.js @@ -31,8 +31,10 @@ export class FilterElectric extends PIXI.Filter { this.animated = {}; this.setTMParams(params); - this.anime = new Anime(this); - this.normalizeTMParams(); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } this.quality = 0.5; } diff --git a/tokenmagic/fx/filters/FilterFire.js b/tokenmagic/fx/filters/FilterFire.js index e016ecd..c1ce85b 100644 --- a/tokenmagic/fx/filters/FilterFire.js +++ b/tokenmagic/fx/filters/FilterFire.js @@ -29,8 +29,10 @@ export class FilterFire extends PIXI.Filter { this.animated = {}; this.setTMParams(params); - this.anime = new Anime(this); - this.normalizeTMParams(); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } } get time() { diff --git a/tokenmagic/fx/filters/FilterForceField.js b/tokenmagic/fx/filters/FilterForceField.js index 42679c8..b96d0a6 100644 --- a/tokenmagic/fx/filters/FilterForceField.js +++ b/tokenmagic/fx/filters/FilterForceField.js @@ -43,8 +43,10 @@ export class FilterForceField extends PIXI.Filter { this.animated = {}; this.setTMParams(params); - this.anime = new Anime(this); - this.normalizeTMParams(); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } } get time() { diff --git a/tokenmagic/fx/filters/FilterGleamingGlow.js b/tokenmagic/fx/filters/FilterGleamingGlow.js index b25395e..3746128 100644 --- a/tokenmagic/fx/filters/FilterGleamingGlow.js +++ b/tokenmagic/fx/filters/FilterGleamingGlow.js @@ -31,8 +31,10 @@ export class FilterGleamingGlow extends PIXI.Filter { this.animated = {}; this.setTMParams(params); - this.anime = new Anime(this); - this.normalizeTMParams(); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } } get time() { diff --git a/tokenmagic/fx/filters/FilterMirrorImages.js b/tokenmagic/fx/filters/FilterMirrorImages.js index e960550..efbce01 100644 --- a/tokenmagic/fx/filters/FilterMirrorImages.js +++ b/tokenmagic/fx/filters/FilterMirrorImages.js @@ -9,23 +9,26 @@ export class FilterMirrorImages extends PIXI.Filter { let { time, blend, - alpha, + alphaImg, + alphaChr, + nbImage, + ampX, + ampY } = Object.assign({}, FilterMirrorImages.defaults, params); // using specific vertex shader and fragment shader super(customVertex2D, mirrorImages); - //this.uniforms.color = new Float32Array([1.0, 1.0, 1.0]); - //this.uniforms.scale = new Float32Array([1.0, 1.0]); - Object.assign(this, { - time, blend, alpha + time, blend, alphaImg, alphaChr, nbImage, ampX, ampY }); this.animated = {}; this.setTMParams(params); - this.anime = new Anime(this); - this.normalizeTMParams(); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } } get time() { @@ -36,12 +39,28 @@ export class FilterMirrorImages extends PIXI.Filter { this.uniforms.time = value; } - get alpha() { - return this.uniforms.alpha; + get alphaImg() { + return this.uniforms.alphaImg; + } + + set alphaImg(value) { + this.uniforms.alphaImg = value; + } + + get alphaChr() { + return this.uniforms.alphaChr; + } + + set alphaChr(value) { + this.uniforms.alphaChr = value; + } + + get nbImage() { + return this.uniforms.nbImage; } - set alpha(value) { - this.uniforms.alpha = value; + set nbImage(value) { + this.uniforms.nbImage = Math.floor(value); } get blend() { @@ -51,12 +70,32 @@ export class FilterMirrorImages extends PIXI.Filter { set blend(value) { this.uniforms.blend = Math.floor(value); } + + get ampX() { + return this.uniforms.ampX; + } + + set ampX(value) { + this.uniforms.ampX = value; + } + + get ampY() { + return this.uniforms.ampY; + } + + set ampY(value) { + this.uniforms.ampY = value; + } } FilterMirrorImages.defaults = { time: 0, - blend: 2, - alpha: 0.5, + blend: 4, + alphaImg: 0.5, + alphaChr: 1.0, + nbImage: 4, + ampX: 0.15, + ampY: 0.15 }; diff --git a/tokenmagic/fx/filters/FilterPixelate.js b/tokenmagic/fx/filters/FilterPixelate.js new file mode 100644 index 0000000..c61d2eb --- /dev/null +++ b/tokenmagic/fx/filters/FilterPixelate.js @@ -0,0 +1,36 @@ +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterPixelate extends PIXI.filters.PixelateFilter { + constructor(params) { + super(); + this.enabled = false; + this.animated = {}; + this.sizeX = 5; + this.sizeY = 5; + this.setTMParams(params); + this.anime = new Anime(this); + this.normalizeTMParams(); + } + + //get sizeX() { + // return this.size.x; + //} + + //set sizeX(value) { + // this.size.x = value; + //} + + //get sizeY() { + // return this.size.y; + //} + + //set sizeY(value) { + // this.size.y = value; + //} + + handleTransform() { + this.size.x = this.sizeX * this.placeableImg.parent.worldTransform.a; + this.size.y = this.sizeY * this.placeableImg.parent.worldTransform.a; + } +} diff --git a/tokenmagic/fx/filters/FilterSmoke.js b/tokenmagic/fx/filters/FilterSmoke.js index fe92291..52dbd24 100644 --- a/tokenmagic/fx/filters/FilterSmoke.js +++ b/tokenmagic/fx/filters/FilterSmoke.js @@ -26,8 +26,10 @@ export class FilterSmoke extends PIXI.Filter { this.animated = {}; this.setTMParams(params); - this.anime = new Anime(this); - this.normalizeTMParams(); + if (!this.dummy) { + this.anime = new Anime(this); + this.normalizeTMParams(); + } } get time() { diff --git a/tokenmagic/fx/filters/proto/FilterProto.js b/tokenmagic/fx/filters/proto/FilterProto.js index 42d5f87..266ae26 100644 --- a/tokenmagic/fx/filters/proto/FilterProto.js +++ b/tokenmagic/fx/filters/proto/FilterProto.js @@ -1,4 +1,5 @@ -import { objectAssign, getPlaceableById, getMinPadding } from "../../../module/tokenmagic.js"; +import { objectAssign, getPlaceableById, getMinPadding, PlaceableType } from "../../../module/tokenmagic.js"; +import "../../../module/proto/PlaceableObjectProto.js"; PIXI.Filter.prototype.setTMParams = function (params) { this.autoDisable = false; @@ -44,17 +45,11 @@ PIXI.Filter.prototype.calculatePadding = function () { } PIXI.Filter.prototype.assignPlaceable = function () { - if (this.placeableType === "Token") { - let parent = canvas.tokens.placeables.find(n => n.id === this.placeableId); - if (!(parent == null)) { - this.placeableImg = parent.icon; - } - } else { - let parent = canvas.tiles.placeables.find(n => n.id === this.placeableId); - if (!(parent == null)) { - this.placeableImg = parent.tile.img; - } - } + + let placeable = this.getPlaceable(); + placeable != null + ? this.placeableImg = placeable._TMFXgetSprite() + : this.placeableImg = null; } PIXI.Filter.prototype.activateTransform = function () { @@ -78,7 +73,7 @@ PIXI.Filter.prototype.filterTransform = function () { PIXI.Filter.prototype.normalizeTMParams = function () { - if (this.hasOwnProperty("animated") && !(this.animated == null) ) { + if (this.hasOwnProperty("animated") && !(this.animated == null)) { // Normalize animations properties Object.keys(this.animated).forEach((effect) => { diff --git a/tokenmagic/fx/glsl/fragmentshaders/cosmicray.js b/tokenmagic/fx/glsl/fragmentshaders/cosmicray.js index b6140ac..1311394 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/cosmicray.js +++ b/tokenmagic/fx/glsl/fragmentshaders/cosmicray.js @@ -31,7 +31,7 @@ void main() { wobble = 48. + 24. * cos(time/5.), white = fract((angle) * divisor + sin((sqrt(len) * wobble) - time * speed)); - white = 2.* cos(white / (PI / 10.)); + white = 2.* cos(white / (PI * 0.1)); white *= floor(fract(angle * divisor + sin(time / speed - (len * 1.2) * wobble)) *subdivide) / subdivide; vec4 color1 = smoothstep(0., 1., white * color); diff --git a/tokenmagic/fx/glsl/fragmentshaders/electricity.js b/tokenmagic/fx/glsl/fragmentshaders/electricity.js index be09872..65c73ae 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/electricity.js +++ b/tokenmagic/fx/glsl/fragmentshaders/electricity.js @@ -77,9 +77,9 @@ float Perlin(vec3 P) float fbm(vec3 p) { float v = 0.0; - v += Perlin(p * 0.9) * 1.5 * cos(1.2 * PI * (time / 2.5)); - v += Perlin(p * 3.99) * 0.5 * sin(PI * time / 2.5); - v += Perlin(p * 8.01) * 0.4 * cos(PI * time / 2.5); + v += Perlin(p * 0.9) * 1.5 * cos(1.2 * PI * (time * 0.4)); + v += Perlin(p * 3.99) * 0.5 * sin(PI * time * 0.4); + v += Perlin(p * 8.01) * 0.4 * cos(PI * time * 0.4); v += Perlin(p * 15.05) * 0.05 * sin(0.1 * PI * time * 8.); return v; diff --git a/tokenmagic/fx/glsl/fragmentshaders/flood.js b/tokenmagic/fx/glsl/fragmentshaders/flood.js index 16cf4c7..897807e 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/flood.js +++ b/tokenmagic/fx/glsl/fragmentshaders/flood.js @@ -48,7 +48,7 @@ float makeWaves(vec2 uv, float theTime, float offset) vec4 water( vec2 fragCoord ) { vec4 fragColor; - vec2 uv = fragCoord.xy / 2.; + vec2 uv = fragCoord.xy * 0.5; vec2 uv2 = uv * scale; @@ -60,7 +60,7 @@ vec4 water( vec2 fragCoord ) result = makeWaves( uv2+vec2(time*timeSpeed,0.0), time, 0.1); result2 = makeWaves( uv2-vec2(time*0.8*timeSpeed,0.0), time*0.8+1.06, 0.26); - result /= 5.; + result *= 0.2; result = smoothstep(0.35,1.1,1.0-abs(result)); result2 = smoothstep(0.35,1.1,1.0-abs(result2)); diff --git a/tokenmagic/fx/glsl/fragmentshaders/fog.js b/tokenmagic/fx/glsl/fragmentshaders/fog.js index 797a5b9..388032b 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/fog.js +++ b/tokenmagic/fx/glsl/fragmentshaders/fog.js @@ -47,7 +47,7 @@ float fbm(vec2 pos) mat4 contrastMatrix(float contrast) { - float t = ( 1.0 - contrast ) / 2.0; + float t = ( 1.0 - contrast ) * 0.5; return mat4( contrast, 0, 0, 0, 0, contrast, 0, 0, @@ -59,7 +59,7 @@ vec4 fog() { vec2 p = (vFilterCoord.xy * 8. - vFilterCoord.xy) * dimensions; - float time2 = 5. * (time/2000.); + float time2 = time * 0.0025; vec2 q = vec2(0.0); q.x = fbm(p); diff --git a/tokenmagic/fx/glsl/fragmentshaders/forcefield.js b/tokenmagic/fx/glsl/fragmentshaders/forcefield.js index 0b34634..b3c14a3 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/forcefield.js +++ b/tokenmagic/fx/glsl/fragmentshaders/forcefield.js @@ -21,10 +21,14 @@ varying vec2 vFilterCoord; #define SQRT5B20 0.30901699 #define PI 3.14159265 #define SPEED 0.01 +#define MU_TWOPI 0.15915494309 +#define MU_289 0.00346020761 +#define MU_3 0.33333333334 +#define MU_1_5 0.66666666667 vec3 hsvToRgb(vec3 hsVcolor) { - vec4 K = vec4(1., 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec4 K = vec4(1., 2.0 * MU_3, 1.0 * MU_3, 3.0); vec3 p = abs(fract(hsVcolor.xxx + K.xyz) * 6.0 - K.www); return hsVcolor.z @@ -33,7 +37,7 @@ vec3 hsvToRgb(vec3 hsVcolor) vec4 multihue(vec2 uv) { - float h = 0.5 + atan(uv.y, uv.x) / (2. * PI); + float h = 0.5 + atan(uv.y, uv.x) * MU_TWOPI; float b2 = .5 * ((1.0 - 1.) + 1. + sqrt((1.0 - 2.) * (1.0 - 2.) + 0.01)); @@ -53,22 +57,22 @@ vec2 random2(vec2 p) float bornedCos(float minimum, float maximum) { - return (maximum-minimum)*(cos(2.*PI*time/20. + 1.)/2.)+minimum; + return (maximum-minimum)*(cos(2.*PI*time*0.05 + 1.)*0.5)+minimum; } float bornedSin(float minimum, float maximum) { - return (maximum-minimum)*(sin(2.*PI*time/20. + 1.)/2.)+minimum; + return (maximum-minimum)*(sin(2.*PI*time*0.05 + 1.)*0.5)+minimum; } vec4 mod289(vec4 x) { - return x - floor(x * (1.0 / 289.0)) * 289.0; + return x - floor(x * (1.0 * MU_289)) * 289.0; } float mod289(float x) { - return x - floor(x * (1.0 / 289.0)) * 289.0; + return x - floor(x * (1.0 * MU_289)) * 289.0; } vec4 permute(vec4 x) @@ -181,10 +185,10 @@ float surface( vec4 coord ) vec4 ambientLight(vec4 pixel, vec2 fragCoord, vec2 posLg) { - vec3 lightColor = (color+vec3(2.))/3.; + vec3 lightColor = (color+vec3(2.)) * MU_3; vec2 position = posLg; - float maxDistance = lightSize + 0.055*sin(time*10.); + float maxDistance = lightSize; float distance = distance(fragCoord-posLg, position); float value = 1.0 - smoothstep(-0.2, maxDistance, distance); @@ -198,7 +202,7 @@ vec4 ambientLight(vec4 pixel, vec2 fragCoord, vec2 posLg) vec3 toGray(vec3 color) { - float average = (color.r + color.g + color.b) / 3.0; + float average = (color.r + color.g + color.b)*0.3333333; return vec3(average, average, average); } @@ -226,7 +230,7 @@ vec4 blenderVec3(int blend, vec4 fColv4, vec4 sColv4) else if (blend == 13) { fCol = fCol + sCol; return vec4(fCol,0.6); } else { fCol = fCol + sCol; } - return vec4(fCol,(fColv4.a+sColv4.a)/2.); + return vec4(fCol,(fColv4.a+sColv4.a)*0.5); } float hexDist(vec2 p) @@ -258,7 +262,7 @@ vec4 hexa(vec2 fragCoord) { float t = time; - vec2 uv = fragCoord/1.; + vec2 uv = fragCoord; vec2 uv1 = uv + vec2(0, sin(uv.x*1. +t)*.25); vec2 uv2 = .5*uv1 + .5*uv + vec2(sin(uv.y*5. + t)*.05, 0); @@ -268,8 +272,8 @@ vec4 hexa(vec2 fragCoord) uv2 *= mat2(c, -s, s, c); vec3 col = color; - col += (smoothstep(abs(uv2.y)/1.5, 3.99, hexCoords(uv2*15.).y) * 40.*(sin(t)+1.)); - col += (smoothstep(abs(uv2.x)/1.5, 3.99, hexCoords(uv2*15.).y) * 40.*(cos(t)+1.)); + col += (smoothstep(abs(uv2.y)*MU_1_5, 3.99, hexCoords(uv2*15.).y) * 40.*(sin(t)+1.)); + col += (smoothstep(abs(uv2.x)*MU_1_5, 3.99, hexCoords(uv2*15.).y) * 40.*(cos(t)+1.)); return vec4(colorize(toGray(clamp(col,0.,2.)),color),1.); } @@ -351,11 +355,11 @@ float fbm2(vec2 n) vec4 ripples(vec2 suv) { - suv.x += time/2.; - vec3 c1 = ( 0.0 ) * (color / 0.1); + suv.x += time*0.5; + vec3 c1 = ( 0.0 ) * (color * 10.); vec3 c2 = vec3(c1); vec3 c3 = vec3(c1); - vec3 c4 = vec3( color.r/0.2, color.g/0.3, color.b/0.5 ); + vec3 c4 = vec3(color.r*5., color.g*3.333, color.b*2.); vec3 c5 = vec3(c3); vec3 c6 = vec3(c1); vec2 p = suv; @@ -372,10 +376,10 @@ vec4 ripples(vec2 suv) vec4 fire(vec2 suv) { - vec3 c1 = color+(2.*vec3(0.1, 0.0, 0.))/3.; - vec3 c2 = color+(2.*vec3(0.7, 0.0, 0.))/3.; - vec3 c3 = color+(2.*vec3(0.2, 0.0, 0.))/3.; - vec3 c4 = color+(2.*vec3(1.0, 0.9, 0.))/3.; + vec3 c1 = color+(2.*vec3(0.1, 0.0, 0.))*0.3333333; + vec3 c2 = color+(2.*vec3(0.7, 0.0, 0.))*0.3333333; + vec3 c3 = color+(2.*vec3(0.2, 0.0, 0.))*0.3333333; + vec3 c4 = color+(2.*vec3(1.0, 0.9, 0.))*0.3333333; vec3 c5 = vec3(0.1); vec3 c6 = vec3(0.9); vec2 uv = suv - vec2(0.92,0.26); @@ -391,7 +395,7 @@ vec4 surface4d(vec2 suv) float s = suv.x + 0.61; float t = suv.y + 0.5; - float multiplier = 1.0 / ( 2.0 * PI ); + float multiplier = 1.0 * MU_TWOPI; float nx = cos( s * 2.0 * PI ) * multiplier; float ny = cos( t * 2.0 * PI ) * multiplier; float nz = sin( s * 2.0 * PI ) * multiplier; @@ -404,9 +408,9 @@ vec4 surface4d(vec2 suv) vec4 fbmy(vec2 suv) { vec4 noiseColor; - noiseColor.r = (color.r * fbm(suv + time/2.)); - noiseColor.g = (color.g * fbm(suv + time/2.)); - noiseColor.b = (color.b * fbm(suv + time/2.)); + noiseColor.r = (color.r * fbm(suv + time*0.5)); + noiseColor.g = (color.g * fbm(suv + time*0.5)); + noiseColor.b = (color.b * fbm(suv + time*0.5)); noiseColor.a = 1.; return clamp(noiseColor,0.,1.); } @@ -414,9 +418,9 @@ vec4 fbmy(vec2 suv) vec4 noisy(vec2 suv) { vec4 noiseColor; - noiseColor.r = (color.r * noise(suv + fbm(suv) + time/2.)); - noiseColor.g = (color.g * noise(suv + fbm(suv) + time/2.)); - noiseColor.b = (color.b * noise(suv + fbm(suv) + time/2.)); + noiseColor.r = (color.r * noise(suv + fbm(suv) + time*0.5)); + noiseColor.g = (color.g * noise(suv + fbm(suv) + time*0.5)); + noiseColor.b = (color.b * noise(suv + fbm(suv) + time*0.5)); noiseColor.a = 1.; return clamp(noiseColor,0.,1.); } @@ -451,10 +455,9 @@ vec4 denseSmoke(vec2 suv) vec2 uv; uv.x = (fbm(suv*2.)-suv.x); uv.y = (suv.y+fbm(suv*2.)); - uv *= 1.; - noiseColor.r = (color.r * min(fbm(uv - time/2.),fbm(uv)*1.5)); - noiseColor.g = (color.g * min(fbm(uv - time/2.),fbm(uv)*1.5)); - noiseColor.b = (color.b * min(fbm(uv - time/2.),fbm(uv)*1.5)); + noiseColor.r = (color.r * min(fbm(uv - time*0.5),fbm(uv)*1.5)); + noiseColor.g = (color.g * min(fbm(uv - time*0.5),fbm(uv)*1.5)); + noiseColor.b = (color.b * min(fbm(uv - time*0.5),fbm(uv)*1.5)); noiseColor.a = 1.0; return clamp(noiseColor,0.,1.); } @@ -509,7 +512,7 @@ vec4 grid(vec2 suv) vec4 galaxy(vec2 suv) { - vec2 uv = suv/6. + vec2 uv = suv*0.166666667 + vec2(bornedCos(0.0,0.7), bornedSin(0.0,0.7)); @@ -519,7 +522,7 @@ vec4 galaxy(vec2 suv) / ( length( uv.xy ) + 0.2 )) * 2.2; float si = sin( t * 1.5 ); - float co = cos( t / 1.5 ); + float co = cos( t * 0.66666667 ); mat2 matrix = mat2( -co, si, si, co ); float c; @@ -559,9 +562,7 @@ vec2 getSphere(out float alpha, out float r) vec2 tc = vFilterCoord.xy; vec2 p = (-1.0 + 2. * tc) * (1.01 / radius+0.000001); r = dot(p,p); - alpha = 1.0; - if (r > 1.0) alpha = (1./r)-0.85; - if (alpha < 0.) alpha = 0.; + r > 0.943 ? alpha = max(min(40.*log(1./r),1.),0.) : alpha = 1.; float f = (1.0-sqrt(1.0-r))/(r); vec2 uv; uv.x = p.x*f; @@ -573,9 +574,7 @@ void main() { float a, r; vec4 result; - vec4 pixel = texture2D(uSampler, vTextureCoord); - vec2 uv = getSphere(a, r); if (shieldType <= 1) { @@ -606,14 +605,8 @@ void main() result = vec4(color,1.); } - float glow = - 0.05 / (0.015 + distance(radius + .008, 0.99)); - - result.a = a; - vec4 colorized; vec3 chromaOption; - if (chromatic) { vec2 vHue = uv; vHue.x -= bornedCos(-0.,+2.2); @@ -622,18 +615,15 @@ void main() } else { chromaOption = color; } - colorized = (vec4( colorize( - toGray(result.rgb + glow), chromaOption), result.a) + result)/2.; - + toGray(result.rgb), chromaOption), result.a) + result)*0.5; vec4 final = clamp(ambientLight(clamp(colorized, 0., 1.)*intensity, uv, posLight-vec2(0.5,0.5)),0.,1.); - gl_FragColor = r > 1.0 ? pixel*(1.-a) : (pixel.a < 1. ? mix(blenderVec3(13, pixel, final),blenderVec3(blend, pixel, final),pixel.a) - : blenderVec3(blend, pixel, final)); + : blenderVec3(blend, pixel, final)) * a; } `; \ No newline at end of file diff --git a/tokenmagic/fx/glsl/fragmentshaders/fumes.js b/tokenmagic/fx/glsl/fragmentshaders/fumes.js index 3ac7d1b..e121fd9 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/fumes.js +++ b/tokenmagic/fx/glsl/fragmentshaders/fumes.js @@ -15,7 +15,7 @@ varying vec2 vFilterCoord; vec4 toGray(in vec4 color) { - float average = (color.r + color.g + color.b) / 3.0; + float average = (color.r + color.g + color.b) * 0.33333334; return vec4(average, average, average, 1.0); } @@ -62,7 +62,7 @@ vec4 fog(vec2 fragCoord) c += 1.0 / length(vec2(.5 * p.x / (sin(0.40 * i.x + t) / intensity), p.y / (cos(i.y + t) / intensity))); } - c /= 6.; + c *= 0.16666667; c = 1.17 - pow(c, 1.4); vec3 colour = vec3(pow(abs(c), 8.0)); diff --git a/tokenmagic/fx/glsl/fragmentshaders/liquid.js b/tokenmagic/fx/glsl/fragmentshaders/liquid.js index 2dc016c..923679d 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/liquid.js +++ b/tokenmagic/fx/glsl/fragmentshaders/liquid.js @@ -71,20 +71,20 @@ vec4 blenderVec3(int blend, vec4 fColv4, vec3 sCol) void main() { float distortion1 = fbm( - vec2( fbm( vFilterCoord * 2.5 * scale + time/2.), - fbm( (-vFilterCoord - vec2(0.01)) * 5. * scale + time/3.) ) + vec2( fbm( vFilterCoord * 2.5 * scale + time*0.5), + fbm( (-vFilterCoord - vec2(0.01)) * 5. * scale + time*0.3333334) ) ); float distortion2 = fbm( - vec2( fbm( -vFilterCoord * 5. * scale + time/2.), - fbm( (vFilterCoord + vec2(0.01)) * 2.5 * scale + time/3.) ) + vec2( fbm( -vFilterCoord * 5. * scale + time*0.5), + fbm( (vFilterCoord + vec2(0.01)) * 2.5 * scale + time*0.3333334) ) ); vec2 uv = vFilterCoord; - uv.x += 0.8*sin(min(distortion1/4.,distortion2/4.)); - uv.y += 0.8*cos(min(distortion1/4.,distortion2/4.)); - uv *= 1. + 0.11*(cos(sqrt(max(distortion1, distortion2))+1.)/2.); + uv.x += 0.8*sin(min(distortion1*0.25,distortion2*0.25)); + uv.y += 0.8*cos(min(distortion1*0.25,distortion2*0.25)); + uv *= 1. + 0.11*(cos(sqrt(max(distortion1, distortion2))+1.)*0.5); uv -= vec2(0.036,0.81); vec2 mappedCoord = (uv*vOutputFrame.zw) / vInputSize.xy; @@ -98,6 +98,6 @@ void main() { if (spectral) pixel.a = max(distortion1,distortion2)*3.75; - gl_FragColor = blenderVec3(blend,pixel,color/3.) * min(pixel.a,a); + gl_FragColor = blenderVec3(blend,pixel,color*0.3333334) * min(pixel.a,a); } `; \ No newline at end of file diff --git a/tokenmagic/fx/glsl/fragmentshaders/magicglow.js b/tokenmagic/fx/glsl/fragmentshaders/magicglow.js index 90aac4e..ae1a53b 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/magicglow.js +++ b/tokenmagic/fx/glsl/fragmentshaders/magicglow.js @@ -99,7 +99,7 @@ vec4 glowing() float outerGlowAlpha = alphaRatio * outerStrength * (1. - curColor.a); float outerGlowStrength = min(1.0 - curColor.a, outerGlowAlpha); - vec4 outerGlowColor = (outerGlowStrength * (color.rgba/10.) ); + vec4 outerGlowColor = (outerGlowStrength * (color.rgba*0.1) ); float resultAlpha = outerGlowAlpha; return vec4(color.rgb * resultAlpha, resultAlpha); @@ -108,15 +108,15 @@ vec4 glowing() vec4 ripples(vec2 suv) { suv.x += time/2.; - vec3 c1 = ( 0.0 ) * (color.rgb / 0.1); + vec3 c1 = ( 0.0 ) * (color.rgb*10.); vec3 c2 = vec3(c1); vec3 c3 = vec3(c1); - vec3 c4 = vec3( color.r/0.2, color.g/0.3, color.b/0.5 ); + vec3 c4 = vec3( color.r*5., color.g*3.3333, color.b*2. ); vec3 c5 = vec3(c3); vec3 c6 = vec3(c1); vec2 p = suv; - float q = 2.*fbm(p + time/5.); - vec2 r = vec2(fbm(p + q + ( time/10. ) - p.x - p.y), fbm(p + p + ( time/10. ))); + float q = 2.*fbm(p + time*0.2); + vec2 r = vec2(fbm(p + q + ( time*0.1 ) - p.x - p.y), fbm(p + p + ( time*0.1 ))); //r.x += bornedCos(-0.3,-0.2); //r.y += 200.*bornedSin(-1.9,1.9); @@ -155,14 +155,14 @@ void main(void) } vec4 effect; - effect = ((glowlevel*subAuraIntensity)/10.) + ((outlinelevel*auraIntensity)/1.25); + effect = ((glowlevel*subAuraIntensity)*0.1) + ((outlinelevel*auraIntensity)*0.8); if (effect.a >= 0.) {effect.rgb = aura.rgb*(max(effect.a,0.));} float intensity = effect.r + effect.g + effect.b; if(intensity < threshold && effect.a != 0.) { if (holes) {discard;} - effect.rgb = (color.rgb)*(effect.a/2.); + effect.rgb = (color.rgb)*(effect.a*0.5); } gl_FragColor = pixel + effect * (1.-pixel.a); diff --git a/tokenmagic/fx/glsl/fragmentshaders/mirrorimages.js b/tokenmagic/fx/glsl/fragmentshaders/mirrorimages.js index b8ba271..0e04b1b 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/mirrorimages.js +++ b/tokenmagic/fx/glsl/fragmentshaders/mirrorimages.js @@ -2,60 +2,101 @@ export const mirrorImages = ` precision mediump float; uniform float time; -uniform float alpha; +uniform float alphaImg; +uniform float alphaChr; +uniform float ampX; +uniform float ampY; uniform int blend; +uniform int nbImage; uniform sampler2D uSampler; +uniform vec4 filterClamp; varying vec2 vTextureCoord; varying vec2 vFilterCoord; const float PI = 3.14159265; -const vec2 resolution = vec2(1.0,1.0); -vec4 blenderVec3(int blend, vec4 fColv4, vec4 sColv4) +float bornedCos(float mi, float ma) { + return (ma-mi)*(cos(2.*PI*time*0.2+1.)*0.5)+mi; +} + +float bornedSin(float mi, float ma) { + return (ma-mi)*(sin(2.*PI*time*0.2+1.)*0.5)+mi; +} + +vec4 blender(int blend, vec4 fCol, vec4 sCol) { - vec3 fCol = vec3(fColv4); - vec3 sCol = vec3(sColv4); - if ( blend == 1) { fCol = fCol * sCol; } - else if (blend == 2) { fCol = (1. - (1. - fCol) * (1. - sCol)); } - else if (blend == 3) { fCol = min(fCol, sCol); } - else if (blend == 4) { fCol = max(fCol, sCol); } - else if (blend == 5) { fCol = abs(fCol - sCol); } - else if (blend == 6) { fCol = 1. - abs(1. - fCol - sCol); } - else if (blend == 7) { fCol = fCol + sCol - (2. * fCol * sCol); } - else if (blend == 8) { fCol = all(lessThanEqual(fCol, vec3(0.5, 0.5, 0.5))) ? (2. * fCol * sCol) : (1. - 2. * (1. - fCol) * (1. - sCol)); } - else if (blend == 9) { fCol = all(lessThanEqual(sCol, vec3(0.5, 0.5, 0.5))) ? (2. * fCol * sCol) : (1. - 2. * (1. - fCol) * (1. - sCol)); } - else if (blend == 10) { fCol = all(lessThanEqual(sCol, vec3(0.5, 0.5, 0.5))) ? (2. * fCol * sCol + fCol * fCol * (1. - 2. * sCol)) : sqrt(fCol) * (2. * sCol - 1.) + (2. * fCol) * (1. - sCol); } - else if (blend == 11) { fCol = fCol / (1.0 - sCol); } - else if (blend == 12) { fCol = 1.0 - (1.0 - fCol) / sCol; } - else if (blend == 13) { fCol = fCol + sCol; } - else if (blend == 14) { fCol = max(fCol,sCol)-(min(fCol,sCol)*0.5)+abs(fCol-sCol);} - else { fCol = fCol + sCol; } - - return vec4(fCol,max(fColv4.a,sColv4.a)); + if ( blend == 1) { fCol.rgb = fCol.rgb * sCol.rgb; } + else if (blend == 2) { fCol.rgb = (1. - (1. - fCol.rgb) * (1. - sCol.rgb)); } + else if (blend == 3) { fCol.rgb = min(fCol.rgb, sCol.rgb); } + else if (blend == 4) { fCol.rgb = max(fCol.rgb, sCol.rgb); } + else if (blend == 5) { fCol.rgb = abs(fCol.rgb - sCol.rgb); } + else if (blend == 6) { fCol.rgb = 1. - abs(1. - fCol.rgb - sCol.rgb); } + else if (blend == 7) { fCol.rgb = fCol.rgb + sCol.rgb - (2. * fCol.rgb * sCol.rgb); } + else if (blend == 8) { fCol.rgb = all(lessThanEqual(fCol.rgb, vec3(0.5, 0.5, 0.5))) ? (2. * fCol.rgb * sCol.rgb) : (1. - 2. * (1. - fCol.rgb) * (1. - sCol.rgb)); } + else if (blend == 9) { fCol.rgb = all(lessThanEqual(sCol.rgb, vec3(0.5, 0.5, 0.5))) ? (2. * fCol.rgb * sCol.rgb) : (1. - 2. * (1. - fCol.rgb) * (1. - sCol.rgb)); } + else if (blend == 10) { fCol.rgb = all(lessThanEqual(sCol.rgb, vec3(0.5, 0.5, 0.5))) ? (2. * fCol.rgb * sCol.rgb + fCol.rgb * fCol.rgb * (1. - 2. * sCol.rgb)) : sqrt(fCol.rgb) * (2. * sCol.rgb - 1.) + (2. * fCol.rgb) * (1. - sCol.rgb); } + else if (blend == 11) { fCol.rgb = fCol.rgb / (1.0 - sCol.rgb); } + else if (blend == 12) { fCol.rgb = 1.0 - (1.0 - fCol.rgb) / (sCol.rgb)+0.001; } + else if (blend == 13) { fCol.rgb = fCol.rgb + sCol.rgb; } + else if (blend == 14) { fCol.rgb = (max(fCol.rgb,sCol.rgb)-(min(fCol.rgb,sCol.rgb)))+abs(fCol.rgb-sCol.rgb);} + else { fCol.rgb = clamp(fCol.rgb + sCol.rgb,0.,1.); } + + fCol.a = max(fCol.a,sCol.a); + return fCol; +} + +vec4 renderMirror(vec2 translation, vec4 prevpix) +{ + vec2 displaced = vTextureCoord + translation; + return blender(blend, prevpix, + texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw))); } void main() { - float x = 0.05*cos(time); - float y = 0.05*sin(time); - - vec2 translator1 = vec2(x,y); - vec2 translator2 = 0.95*vec2(-x,y*0.5); - vec2 translator3 = 0.75*vec2(x,-y); - vec2 translator4 = 0.90*vec2(-x*0.5,-y); - - vec2 vUv = vTextureCoord; - vec2 uvImg1 = vUv + translator1; - vec2 uvImg2 = vUv + translator2; - vec2 uvImg3 = vUv + translator3; - vec2 uvImg4 = vUv + translator4; - - vec4 mirror1 = texture2D(uSampler, uvImg1); - vec4 mirror2 = texture2D(uSampler, uvImg2); - vec4 mirror3 = texture2D(uSampler, uvImg3); - vec4 mirror4 = texture2D(uSampler, uvImg4); - - gl_FragColor = blenderVec3(blend, blenderVec3(blend, blenderVec3(blend, mirror1,mirror2),mirror3),mirror4)*alpha; + float x = ampX * bornedCos(0.,1.); + float y = ampY * bornedSin(0.,1.); + vec4 renderedPixel; + vec2 translation; + + if (nbImage >= 1) { + translation = vec2(x,y); + renderedPixel = texture2D(uSampler, clamp(vTextureCoord + translation, filterClamp.xy, filterClamp.zw)); + } + if (nbImage >= 2) { + translation = 0.90*vec2(-x,y*0.5); + renderedPixel = renderMirror(translation, renderedPixel); + } + if (nbImage >= 3) { + translation = 0.70*vec2(x,-y); + renderedPixel = renderMirror(translation, renderedPixel); + } + if (nbImage >= 4) { + translation = 0.80*vec2(-x*0.6,-y); + renderedPixel = renderMirror(translation, renderedPixel); + } + if (nbImage >= 5) { + translation = 1.20*vec2(-x,y*0.4); + renderedPixel = renderMirror(translation, renderedPixel); + } + if (nbImage >= 6) { + translation = 1.10*vec2(x,-y); + renderedPixel = renderMirror(translation, renderedPixel); + } + if (nbImage >= 7) { + translation = 0.6*vec2(-x*0.4,-y); + renderedPixel = renderMirror(translation, renderedPixel); + } + if (nbImage >= 8) { + translation = 1.3*vec2(-x,y*0.70); + renderedPixel = renderMirror(translation, renderedPixel); + } + if (nbImage >= 9) { + translation = vec2(x*0.5,y*0.85); + renderedPixel = renderMirror(translation, renderedPixel); + } + renderedPixel = renderedPixel*alphaImg; + gl_FragColor = blender(blend,texture2D(uSampler, vTextureCoord)*alphaChr , renderedPixel); } `; \ No newline at end of file diff --git a/tokenmagic/fx/glsl/fragmentshaders/smoke.js b/tokenmagic/fx/glsl/fragmentshaders/smoke.js index d1b3eed..9c6e040 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/smoke.js +++ b/tokenmagic/fx/glsl/fragmentshaders/smoke.js @@ -165,8 +165,9 @@ void main() return; } - float s = vFilterCoord.x * scale.x; - float t = vFilterCoord.y * scale.y; + vec2 uv = vFilterCoord - vec2(0.375*scale.x,0.375*scale.y); + float s = uv.x * scale.x; + float t = uv.y * scale.y; float multiplier = 1.0 / ( 2.0 * PI ); float nx = cos( s * 2.0 * PI ) * multiplier; diff --git a/tokenmagic/fx/glsl/fragmentshaders/xray.js b/tokenmagic/fx/glsl/fragmentshaders/xray.js index ab2fd02..fdd32d6 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/xray.js +++ b/tokenmagic/fx/glsl/fragmentshaders/xray.js @@ -14,7 +14,9 @@ uniform vec3 color; varying vec2 vFilterCoord; varying vec2 vTextureCoord; -#define PI 3.14159265359 +const float MU_TWOPI = 0.15915494309; +const float MU_PI5 = 1.59154943092; +const float MU_256 = 0.00390625; vec4 blender(int blend, vec4 fColv4, vec4 sColv4) { @@ -49,16 +51,16 @@ void main() { vec2 uv = (vFilterCoord - anchor) / dimensions; - float len = length(uv *0.5); - float angle = atan(uv.x, uv.y) / (2. * PI); - float beam = fract((angle) * divisor + sin((sqrt(len) * 0.2) - (time/2.))); + float len = length(uv * 0.5); + float angle = atan(uv.x, uv.y) * MU_TWOPI; + float beam = fract((angle) * divisor + sin((sqrt(len) * 0.2) - (time*0.5))); - beam = 2.* cos(beam / (PI / 5.)); - beam *= floor(fract(angle * divisor + sin(time - (len * 1.2) * 0.2)) *256.) / 256.; + beam = 2.* cos(beam * MU_PI5); + beam *= floor(fract(angle * divisor + sin(time - (len * 1.2) * 0.2)) *256.) * MU_256; float fractburn = fract(beam); - vec4 color1 = smoothstep(0.0, 1., (beam*(intensity/10.) + pixel * vec4(color,1.)) / (fractburn == 0. ? fractburn+0.1 : fractburn) * 0.3 ); + vec4 color1 = smoothstep(0.0, 1., (beam*(intensity*0.1) + pixel * vec4(color,1.)) / (fractburn == 0. ? fractburn+0.1 : fractburn) * 0.3 ); vec4 result = blender(blend, pixel, color1); gl_FragColor = result*pixel.a; diff --git a/tokenmagic/fx/presets/defaultpresets.js b/tokenmagic/fx/presets/defaultpresets.js new file mode 100644 index 0000000..28a6e2d --- /dev/null +++ b/tokenmagic/fx/presets/defaultpresets.js @@ -0,0 +1,1903 @@ +export var presets = []; + +let params = + [{ + filterType: "bevel", + filterId: "bevel", + rotation: 0, + thickness: 5, + lightColor: 0xFF0000, + lightAlpha: 0.8, + shadowColor: 0x00FF00, + shadowAlpha: 0.5, + animated: + { + rotation: + { + active: true, + clockWise: true, + loopDuration: 1600, + animType: "syncRotation" + } + } + }]; + +var presetObject = {}; +presetObject.name = "bevel"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "adjustment", + filterId: "adjustment", + saturation: 1.5, + brightness: 1.5, + contrast: 2, + gamma: 2, + red: 4, + green: 0.25, + blue: 0.25, + alpha: 1, + animated: + { + alpha: + { + active: true, + loopDuration: 5000, + animType: "syncCosOscillation", + val1: 0.15, + val2: 1 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "adjustment"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "shadow", + filterId: "dropshadow", + rotation: 35, + blur: 2, + quality: 5, + distance: 20, + alpha: 0.7, + padding: 10, + shadowOnly: false, + color: 0x000000, + animated: + { + blur: + { + active: true, + loopDuration: 1500, + animType: "syncCosOscillation", + val1: 2, + val2: 3 + }, + rotation: + { + active: true, + loopDuration: 150, + animType: "syncSinOscillation", + val1: 33, + val2: 35 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "dropshadow"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "outline", + filterId: "outline", + padding: 10, + color: 0xEE6035, + thickness: 1, + quality: 5, + animated: + { + thickness: + { + active: true, + loopDuration: 800, + animType: "syncCosOscillation", + val1: 1, + val2: 6 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "outline"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "glow", + filterId: "glow", + outerStrength: 7, + innerStrength: 0, + color: 0x006000, + quality: 0.5, + padding: 10, + animated: + { + color: + { + active: true, + loopDuration: 3000, + animType: "colorOscillation", + val1: 0x003000, + val2: 0x00FF00 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "glow"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "xbloom", + filterId: "bloom", + threshold: 0.35, + bloomScale: 0, + brightness: 1, + blur: 0.1, + padding: 10, + quality: 15, + blendMode: 0, + animated: + { + bloomScale: + { + active: true, + loopDuration: 2000, + animType: "syncCosOscillation", + val1: 0, + val2: 2.1 + }, + threshold: + { + active: false, + loopDuration: 1000, + animType: "syncCosOscillation", + val1: 0.00, + val2: 1.90 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "bloom"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "distortion", + filterId: "distortion", + maskPath: "/modules/tokenmagic/fx/assets/distortion-1.png", + maskSpriteScaleX: 5, + maskSpriteScaleY: 5, + padding: 20, + animated: + { + maskSpriteX: { active: true, speed: 0.05, animType: "move" }, + maskSpriteY: { active: true, speed: 0.07, animType: "move" } + } + }]; + +presetObject = new Object(); +presetObject.name = "distortion"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "oldfilm", + filterId: "oldfilm", + sepia: 0.6, + noise: 0.2, + noiseSize: 1.0, + scratch: 0.8, + scratchDensity: 0.5, + scratchWidth: 1.2, + vignetting: 0.9, + vignettingAlpha: 0.6, + vignettingBlur: 0.2, + animated: + { + seed: + { + active: true, + animType: "randomNumber", + val1: 0, + val2: 1 + }, + vignetting: + { + active: true, + animType: "syncCosOscillation", + loopDuration: 2000, + val1: 0.2, + val2: 0.4 + } + } + }, + { + filterType: "outline", + filterId: "oldfilm", + color: 0x000000, + thickness: 0, + }]; + +presetObject = new Object(); +presetObject.name = "oldfilm"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "twist", + filterId: "twist", + radiusPercent: 120, + angle: 0, + animated: + { + angle: + { + active: true, + animType: "sinOscillation", + loopDuration: 10000, + val1: -0.6 * Math.PI, + val2: +0.6 * Math.PI + } + } + }]; + +presetObject = new Object(); +presetObject.name = "twist"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "bulgepinch", + filterId: "bulge", + padding: 150, + strength: 0, + zIndex: 2, + radiusPercent: 200, + animated: + { + strength: + { + active: true, + animType: "cosOscillation", + loopDuration: 2000, + val1: 0, + val2: 0.45 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "bulge"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "blur", + filterId: "blur", + padding: 10, + quality: 4.0, + blur: 0, + blurX: 0, + blurY: 0, + animated: + { + blurX: + { + active: true, + animType: "syncCosOscillation", + loopDuration: 500, + val1: 0, + val2: 6 + }, + blurY: + { + active: true, + animType: "syncCosOscillation", + loopDuration: 750, + val1: 0, + val2: 6 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "blur"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "zoomblur", + filterId: "zoomblur", + strength: 0.15, + innerRadiusPercent: 65, + radiusPercent: 100, + padding: 30, + animated: + { + innerRadiusPercent: + { + active: true, + animType: "sinOscillation", + loopDuration: 500, + val1: 65, + val2: 75 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "zoomblur"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "shockwave", + filterId: "shockwave", + time: 0, + amplitude: 8, + wavelength: 75, + radius: 500, + brightness: 1.5, + speed: 25, + padding: 0, + animated: + { + time: + { + animType: "cosOscillation", + active: true, + loopDuration: 1800, + val1: 0, val2: 10 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "shockwave"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "zapshadow", + filterId: "zapshadow", + alphaTolerance: 0.45 + }]; + +presetObject = new Object(); +presetObject.name = "zapshadow"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "ray", + filterId: "rays", + time: 0, + color: 0xCF8000, + alpha: 0.5, + divisor: 32, + anchorX: 0, + anchorY: 0, + animated: + { + time: + { + active: true, + speed: 0.0005, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "rays"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "fog", + filterId: "fog", + color: 0x000000, + density: 0.65, + time: 0, + dimX: 1, + dimY: 1, + animated: + { + time: + { + active: true, + speed: 2.2, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "fog"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "fumes", + filterId: "fumes", + color: 0x808080, + time: 0, + blend: 8, + animated: + { + time: + { + active: true, + speed: 0.001, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "fumes"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "electric", + filterId: "electric", + color: 0xFFFFFF, + time: 0, + blend: 1, + intensity: 5, + animated: + { + time: + { + active: true, + speed: 0.0020, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "electric"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "fire", + filterId: "fire", + intensity: 1, + color: 0xFFFFFF, + amplitude: 1, + time: 0, + blend: 2, + fireBlend: 1, + animated: + { + time: + { + active: true, + speed: -0.0024, + animType: "move" + }, + intensity: + { + active: true, + loopDuration: 15000, + val1: 0.8, + val2: 2, + animType: "syncCosOscillation" + }, + amplitude: + { + active: true, + loopDuration: 4400, + val1: 1, + val2: 1.4, + animType: "syncCosOscillation" + } + + } + }]; + +presetObject = new Object(); +presetObject.name = "fire"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "wave", + filterId: "waves", + time: 0, + anchorX: 0.5, + anchorY: 0.5, + strength: 0.015, + frequency: 120, + color: 0xFFFFFF, + maxIntensity: 2.5, + minIntensity: 0.9, + padding: 10, + animated: + { + time: + { + active: true, + speed: 0.0085, + animType: "move" + }, + anchorX: + { + active: false, + val1: 0.15, + val2: 0.85, + animType: "syncChaoticOscillation", + loopDuration: 20000 + }, + anchorY: + { + active: false, + val1: 0.15, + val2: 0.85, + animType: "syncSinOscillation", + loopDuration: 20000 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "waves"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "flood", + filterId: "flood", + time: 0, + color: 0x0020BB, + billowy: 0.43, + tintIntensity: 0.72, + glint: 0.31, + scale: 70, + padding: 10, + animated: + { + time: + { + active: true, + speed: 0.0006, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "flood"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "smoke", + filterId: "smoke", + color: 0x5099DD, + time: 0, + blend: 2, + dimX: 0.1, + dimY: 1, + animated: + { + time: + { + active: true, + speed: 0.009, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "smoke"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "images", + filterId: "images", + time: 0, + nbImage: 4, + alphaImg: 1.0, + alphaChr: 0.0, + blend: 4, + ampX: 0.10, + ampY: 0.10, + animated: + { + time: + { + active: true, + speed: 0.0010, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "images"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "images", + filterId: "chaos-images", + time: 0, + nbImage: 4, + alphaImg: 1.0, + alphaChr: 0.0, + blend: 4, + ampX: 0.10, + ampY: 0.10, + padding: 80, + animated: + { + time: + { + active: true, + speed: 0.0010, + animType: "move" + }, + ampX: + { + active: true, + val1: 0.00, + val2: 0.30, + chaosFactor: 0.03, + animType: "syncChaoticOscillation", + loopDuration: 2000 + }, + ampY: + { + active: true, + val1: 0.00, + val2: 0.30, + chaosFactor: 0.04, + animType: "syncChaoticOscillation", + loopDuration: 1650 + }, + alphaChr: + { + active: true, + animType: "randomNumberPerLoop", + val1: 0.0, + val2: 1, + loopDuration: 250 + }, + alphaImg: + { + active: true, + animType: "randomNumberPerLoop", + val1: 0.8, + val2: 1, + loopDuration: 250 + }, + nbImage: + { + active: true, + val1: 1, + val2: 9, + animType: "syncSinOscillation", + loopDuration: 1400 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "chaos-images"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "images", + filterId: "spectral-images", + time: 0, + blend: 4, + nbImage: 4, + padding: 100, + alphaImg: 0.5, + alphaChr: 0.0, + ampX: 0.10, + ampY: 0.10, + animated: + { + time: + { + speed: 0.0010, + animType: "move" + }, + ampX: + { + val1: 0, val2: 0.22, + animType: "syncCosOscillation", + loopDuration: 2500 + }, + ampY: + { + val1: 0, val2: 0.24, + animType: "syncCosOscillation", + loopDuration: 2500, + pauseBetweenDuration: 2500 + }, + alphaChr: + { + val1: 1, val2: 0, + animType: "syncCosOscillation", + loopDuration: 2500 + }, + alphaImg: + { + val1: 0.2, val2: 0.8, + animType: "syncSinOscillation", + loopDuration: 2500 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "spectral-images"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "hexa-field", + shieldType: 2, + gridPadding: 1.5, + color: 0xCC00CC, + time: 0, + blend: 3, + intensity: 1, + lightAlpha: 0.5, + lightSize: 0.5, + scale: 1, + radius: 1, + chromatic: false, + animated: + { + time: + { + active: true, + speed: 0.0015, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "hexa-field"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "fire-field", + shieldType: 1, + gridPadding: 2, + color: 0xE58550, + time: 0, + blend: 2, + intensity: 1.15, + lightAlpha: 2, + lightSize: 0.7, + scale: 1, + radius: 1, + chromatic: false, + animated: + { + time: + { + active: true, + speed: 0.0015, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "fire-field"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "smoke-field", + shieldType: 3, + gridPadding: 1.5, + color: 0x60CC70, + time: 0, + blend: 2, + intensity: 0.9, + lightAlpha: 1, + lightSize: 0.7, + scale: 1, + radius: 1, + chromatic: false, + animated: + { + time: + { + active: true, + speed: 0.0015, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "smoke-field"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "earth-field", + shieldType: 4, + gridPadding: 2, + color: 0xBB9070, + time: 0, + blend: 1, + intensity: 1.25, + lightAlpha: 1, + lightSize: 0.7, + scale: 1, + radius: 1, + chromatic: false, + animated: + { + time: + { + active: true, + speed: 0.0015, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "earth-field"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "earth-field-top", + shieldType: 5, + gridPadding: 3, + color: 0xAAAAAA, + time: 0, + blend: 5, + intensity: 1.9, + lightAlpha: 1, + lightSize: 0.7, + scale: 1, + radius: 1, + zIndex: 5, + chromatic: true, + animated: + { + time: + { + active: true, + speed: 0.0015, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "earth-field-top"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "air-field", + shieldType: 6, + gridPadding: 1.2, + color: 0x7090AA, + time: 0, + blend: 14, + intensity: 1, + lightAlpha: 1, + lightSize: 0.7, + scale: 1, + radius: 1, + chromatic: false, + animated: + { + time: + { + active: true, + speed: 0.0015, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "air-field"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "magic-field", + shieldType: 7, + gridPadding: 1, + color: 0xFFFFFF, + time: 0, + blend: 10, + intensity: 0.8, + lightAlpha: 1, + lightSize: 0.45, + scale: 1, + radius: 1, + chromatic: false, + animated: + { + time: + { + active: true, + speed: 0.0015, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "magic-field"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "chromatic-field", + shieldType: 8, + gridPadding: 2, + color: 0xAAAAAA, + time: 0, + blend: 0, + intensity: 1, + lightAlpha: 0, + lightSize: 0, + scale: 1, + radius: 1, + chromatic: true, + animated: + { + time: + { + active: true, + speed: 0.0045, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "chromatic-field"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "water-field", + shieldType: 9, + gridPadding: 1.2, + color: 0x20BBEE, + time: 0, + blend: 4, + intensity: 1, + lightAlpha: 0.7, + lightSize: 0.5, + scale: 0.6, + radius: 1, + chromatic: false, + animated: + { + time: + { + active: true, + speed: 0.0015, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "water-field"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "evil-field", + shieldType: 9, + gridPadding: 2, + color: 0xFF3010, + time: 0, + blend: 5, + intensity: 1, + lightAlpha: 4, + lightSize: 0.8, + scale: 0.5, + radius: 1, + chromatic: false, + animated: + { + time: + { + active: true, + speed: 0.0012, + animType: "move" + }, + lightSize: + { + val1: 0.4, val2: 1.5, + animType: "syncCosOscillation", + loopDuration: 5000 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "evil-field"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "grid-field", + shieldType: 11, + gridPadding: 2, + color: 0x00CCCC, + time: 0, + blend: 2, + intensity: 1, + lightAlpha: 1, + lightSize: 0.3, + scale: 0.5, + radius: 1, + chromatic: false, + animated: + { + time: + { + active: true, + speed: 0.0009, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "grid-field"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "warp-field", + shieldType: 12, + gridPadding: 2, + color: 0xFFFFFF, + time: 0, + blend: 2, + intensity: 1, + lightAlpha: 0.8, + lightSize: 0.5, + scale: 0.9, + radius: 1, + chromatic: false, + animated: + { + time: + { + active: true, + speed: 0.0009, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "warp-field"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "field", + filterId: "color-field", + shieldType: 13, + gridPadding: 2, + color: 0x00CC00, + time: 0, + blend: 14, + intensity: 1, + lightAlpha: 0, + lightSize: 0, + scale: 1, + radius: 1, + chromatic: false, + animated: + { + time: + { + active: true, + speed: 0.0009, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "color-field"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "xray", + filterId: "sunburst", + time: 0, + color: 0xFFBB00, + blend: 9, + dimX: 1, + dimY: 1, + anchorX: 0, + anchorY: 0, + divisor: 36, + intensity: 4, + animated: + { + time: + { + active: true, + speed: 0.0012, + animType: "move" + }, + anchorX: + { + animType: "syncCosOscillation", + loopDuration: 6000, + val1: 0.40, + val2: 0.60 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "sunburst"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "xray", + filterId: "clover", + time: 0, + color: 0x00FF00, + blend: 9, + dimX: 0.05, + dimY: 0.05, + anchorX: 0.5, + anchorY: 0.5, + divisor: 4, + intensity: 1, + animated: + { + time: + { + active: true, + speed: 0.0012, + animType: "move" + }, + anchorX: + { + animType: "syncCosOscillation", + loopDuration: 6000, + val1: 0.40, + val2: 0.60 + }, + anchorY: + { + animType: "syncSinOscillation", + loopDuration: 6000, + val1: 0.40, + val2: 0.60 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "clover"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "xray", + filterId: "scan", + time: 0, + color: 0xFFFFFF, + blend: 5, + dimX: 20, + dimY: 20, + anchorX: 0.5, + anchorY: 0, + divisor: 8, + intensity: 1, + animated: + { + time: + { + active: true, + speed: 0.0005, + animType: "move" + } + } + }]; + +presetObject = new Object(); +presetObject.name = "scan"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "xray", + filterId: "blue-rays", + time: 0, + color: 0x1030FF, + blend: 9, + dimX: 1, + dimY: 1, + anchorX: 0, + anchorY: 0, + divisor: 24, + intensity: 1, + animated: + { + time: + { + active: true, + speed: 0.0002, + animType: "move" + }, + anchorX: + { + animType: "syncCosOscillation", + loopDuration: 18000, + val1: 0.05, + val2: 0.95 + }, + anchorY: + { + animType: "syncSinOscillation", + loopDuration: 18000, + val1: 0.05, + val2: 0.95 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "blue-rays"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "liquid", + filterId: "spectral-body", + color: 0x20AAEE, + time: 0, + blend: 8, + intensity: 4, + spectral: true, + scale: 0.9, + animated: + { + time: + { + active: true, + speed: 0.0010, + animType: "move" + }, + color: + { + active: true, + loopDuration: 6000, + animType: "colorOscillation", + val1: 0xFFFFFF, + val2: 0x00AAFF + } + } + }]; + +presetObject = new Object(); +presetObject.name = "spectral-body"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "liquid", + filterId: "mantle-of-madness", + color: 0x0090FF, + time: 0, + blend: 5, + intensity: 0.0001, + spectral: false, + scale: 7, + animated: + { + time: + { + active: true, + speed: 0.0015, + animType: "move" + }, + intensity: + { + active: true, + animType: "syncCosOscillation", + loopDuration: 30000, + val1: 0.0001, + val2: 4 + }, + scale: + { + active: true, + animType: "syncCosOscillation", + loopDuration: 30000, + val1: 7, + val2: 1 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "mantle-of-madness"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "wave", + filterId: "drift-in-plans", + time: 0, + anchorX: 0.5, + anchorY: 0.5, + strength: 0.035, + frequency: 80, + color: 0xFFFFFF, + maxIntensity: 1.5, + minIntensity: 0.5, + padding: 10, + animated: + { + time: + { + active: true, + speed: 0.0085, + animType: "move" + }, + anchorX: + { + active: true, + val1: 0.35, + val2: 0.65, + animType: "syncCosOscillation", + loopDuration: 10000 + }, + anchorY: + { + active: true, + val1: 0.35, + val2: 0.65, + animType: "syncSinOscillation", + loopDuration: 10000 + } + } + }, + { + filterType: "liquid", + filterId: "drift-in-plans", + color: 0xFF0000, + time: 0, + blend: 6, + intensity: 5, + spectral: false, + scale: 2.5, + animated: + { + time: + { + active: true, + speed: 0.0018, + animType: "move" + }, + color: + { + active: true, + loopDuration: 9000, + animType: "colorOscillation", + val1: 0xFF0000, + val2: 0xFFFFFF + } + } + }]; + +presetObject = new Object(); +presetObject.name = "drift-in-plans"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "zapshadow", + filterId: "fire-aura", + alphaTolerance: 0.50 + }, + { + filterType: "xglow", + filterId: "fire-aura", + auraType: 2, + color: 0x903010, + thickness: 9.8, + scale: 4., + time: 0, + auraIntensity: 2, + subAuraIntensity: 1.5, + threshold: 0.40, + discard: true, + animated: + { + time: + { + active: true, + speed: 0.0027, + animType: "move" + }, + thickness: + { + active: true, + loopDuration: 3000, + animType: "cosOscillation", + val1: 2, + val2: 5 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "fire-aura"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "zapshadow", + filterId: "glacial-aura", + alphaTolerance: 0.50 + }, + { + filterType: "xglow", + filterId: "glacial-aura", + auraType: 1, + color: 0x5099DD, + thickness: 4.5, + scale: 3, + time: 0, + auraIntensity: 0.8, + subAuraIntensity: 0.25, + threshold: 0.5, + discard: false, + animated: + { + time: + { + active: true, + speed: 0.0018, + animType: "move" + }, + thickness: + { + val1: 2, val2: 4.7, + animType: "cosOscillation", + loopDuration: 3000 + }, + subAuraIntensity: + { + val1: 0.45, val2: 0.65, + animType: "cosOscillation", + loopDuration: 6000 + }, + auraIntensity: + { + val1: 0.9, val2: 2.2, + animType: "cosOscillation", + loopDuration: 3000 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "glacial-aura"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "zapshadow", + filterId: "anti-aura", + alphaTolerance: 0.50 + }, + { + filterType: "xglow", + filterId: "anti-aura", + auraType: 2, + color: 0x050505, + thickness: 2.7, + scale: 7, + time: 0, + auraIntensity: 5, + subAuraIntensity: 2, + threshold: 0.08, + discard: false, + animated: + { + time: + { + active: true, + speed: 0.0012, + animType: "move" + }, + auraIntensity: + { + active: true, + loopDuration: 3000, + animType: "syncCosOscillation", + val1: 5, + val2: 0 + }, + subAuraIntensity: + { + active: true, + loopDuration: 3000, + animType: "syncCosOscillation", + val1: 2, + val2: 0 + }, + color: + { + active: true, + loopDuration: 6000, + animType: "syncColorOscillation", + val1: 0x050505, + val2: 0x200000 + }, + threshold: + { + active: true, + loopDuration: 1500, + animType: "syncCosOscillation", + val1: 0.02, + val2: 0.50 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "anti-aura"; +presetObject.params = params; +presets.push(presetObject); + + +params = + [{ + filterType: "fire", + filterId: "pure-fire-aura", + intensity: 1, + color: 0xFFFFFF, + amplitude: 1, + time: 0, + blend: 2, + fireBlend: 1, + animated: + { + time: + { + active: true, + speed: -0.0024, + animType: "move" + }, + intensity: + { + active: true, + loopDuration: 15000, + val1: 0.8, + val2: 2, + animType: "syncCosOscillation" + }, + amplitude: + { + active: true, + loopDuration: 4400, + val1: 1, + val2: 1.4, + animType: "syncCosOscillation" + } + + } + }, + { + filterType: "zapshadow", + filterId: "pure-fire-aura", + alphaTolerance: 0.50 + }, + { + filterType: "xglow", + filterId: "pure-fire-aura", + auraType: 2, + color: 0x903010, + thickness: 9.8, + scale: 4., + time: 0, + auraIntensity: 2, + subAuraIntensity: 1.5, + threshold: 0.40, + discard: true, + animated: + { + time: + { + active: true, + speed: 0.0027, + animType: "move" + }, + thickness: + { + active: true, + loopDuration: 3000, + animType: "cosOscillation", + val1: 2, + val2: 5 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "pure-fire-aura"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "zapshadow", + filterId: "pure-fire-aura-2", + alphaTolerance: 0.50 + }, + { + filterType: "xglow", + filterId: "pure-fire-aura-2", + auraType: 2, + color: 0x903010, + thickness: 9.8, + scale: 4., + time: 0, + auraIntensity: 1, + subAuraIntensity: 0.3, + threshold: 0.50, + discard: true, + animated: + { + time: + { + active: true, + speed: 0.0027, + animType: "move" + }, + thickness: + { + active: true, + loopDuration: 3000, + animType: "cosOscillation", + val1: 2, + val2: 3.6 + } + } + }, + { + filterType: "fire", + filterId: "pure-fire-aura-2", + intensity: 1, + color: 0xFFFFFF, + amplitude: 1, + time: 0, + blend: 2, + fireBlend: 1, + animated: + { + time: + { + active: true, + speed: -0.0024, + animType: "move" + }, + intensity: + { + active: true, + loopDuration: 15000, + val1: 0.8, + val2: 3, + animType: "syncCosOscillation" + }, + amplitude: + { + active: true, + loopDuration: 4400, + val1: 1, + val2: 1.6, + animType: "syncCosOscillation" + } + + } + }]; + +presetObject = new Object(); +presetObject.name = "pure-fire-aura-2"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "zapshadow", + filterId: "pure-ice-aura", + alphaTolerance: 0.50 + }, + { + filterType: "xglow", + filterId: "pure-ice-aura", + auraType: 1, + color: 0x5099DD, + thickness: 4.5, + scale: 10, + time: 0, + auraIntensity: 0.25, + subAuraIntensity: 1, + threshold: 0.5, + discard: false, + animated: + { + time: + { + active: true, + speed: 0.0018, + animType: "move" + }, + thickness: + { + val1: 2, val2: 3.3, + animType: "cosOscillation", + loopDuration: 3000 + }, + subAuraIntensity: + { + val1: 0.45, val2: 0.65, + animType: "cosOscillation", + loopDuration: 6000 + }, + auraIntensity: + { + val1: 0.9, val2: 2.2, + animType: "cosOscillation", + loopDuration: 3000 + } + } + }, + { + filterType: "smoke", + filterId: "pure-ice-aura", + color: 0x80CCFF, + time: 0, + blend: 2, + dimX: 0.3, + dimY: 1, + animated: + { + time: + { + active: true, + speed: -0.006, + animType: "move" + }, + dimX: + { + val1: 0.4, val2: 0.2, + animType: "cosOscillation", + loopDuration: 3000 + } + } + }]; + +presetObject = new Object(); +presetObject.name = "pure-ice-aura"; +presetObject.params = params; +presets.push(presetObject); + +params = + [{ + filterType: "pixel", + filterId: "pixelate", + sizeX: 2.5, + sizeY: 2.5 + }] + +presetObject = new Object(); +presetObject.name = "pixelate"; +presetObject.params = params; +presets.push(presetObject); \ No newline at end of file diff --git a/tokenmagic/import/TMFX-default-presets.json b/tokenmagic/import/TMFX-default-presets.json new file mode 100644 index 0000000..f20716c --- /dev/null +++ b/tokenmagic/import/TMFX-default-presets.json @@ -0,0 +1,1663 @@ +[ + { + "name": "bevel", + "params": [ + { + "filterType": "bevel", + "filterId": "bevel", + "rotation": 0, + "thickness": 5, + "lightColor": 16711680, + "lightAlpha": 0.8, + "shadowColor": 65280, + "shadowAlpha": 0.5, + "animated": { + "rotation": { + "active": true, + "clockWise": true, + "loopDuration": 1600, + "animType": "syncRotation" + } + } + } + ] + }, + { + "name": "adjustment", + "params": [ + { + "filterType": "adjustment", + "filterId": "adjustment", + "saturation": 1.5, + "brightness": 1.5, + "contrast": 2, + "gamma": 2, + "red": 4, + "green": 0.25, + "blue": 0.25, + "alpha": 1, + "animated": { + "alpha": { + "active": true, + "loopDuration": 5000, + "animType": "syncCosOscillation", + "val1": 0.15, + "val2": 1 + } + } + } + ] + }, + { + "name": "dropshadow", + "params": [ + { + "filterType": "shadow", + "filterId": "dropshadow", + "rotation": 35, + "blur": 2, + "quality": 5, + "distance": 20, + "alpha": 0.7, + "padding": 10, + "shadowOnly": false, + "color": 0, + "animated": { + "blur": { + "active": true, + "loopDuration": 1500, + "animType": "syncCosOscillation", + "val1": 2, + "val2": 3 + }, + "rotation": { + "active": true, + "loopDuration": 150, + "animType": "syncSinOscillation", + "val1": 33, + "val2": 35 + } + } + } + ] + }, + { + "name": "outline", + "params": [ + { + "filterType": "outline", + "filterId": "outline", + "padding": 10, + "color": 15622197, + "thickness": 1, + "quality": 5, + "animated": { + "thickness": { + "active": true, + "loopDuration": 800, + "animType": "syncCosOscillation", + "val1": 1, + "val2": 6 + } + } + } + ] + }, + { + "name": "glow", + "params": [ + { + "filterType": "glow", + "filterId": "glow", + "outerStrength": 7, + "innerStrength": 0, + "color": 24576, + "quality": 0.5, + "padding": 10, + "animated": { + "color": { + "active": true, + "loopDuration": 3000, + "animType": "colorOscillation", + "val1": 12288, + "val2": 65280 + } + } + } + ] + }, + { + "name": "bloom", + "params": [ + { + "filterType": "xbloom", + "filterId": "bloom", + "threshold": 0.35, + "bloomScale": 0, + "brightness": 1, + "blur": 0.1, + "padding": 10, + "quality": 15, + "blendMode": 0, + "animated": { + "bloomScale": { + "active": true, + "loopDuration": 2000, + "animType": "syncCosOscillation", + "val1": 0, + "val2": 2.1 + }, + "threshold": { + "active": false, + "loopDuration": 1000, + "animType": "syncCosOscillation", + "val1": 0, + "val2": 1.9 + } + } + } + ] + }, + { + "name": "distortion", + "params": [ + { + "filterType": "distortion", + "filterId": "distortion", + "maskPath": "/modules/tokenmagic/fx/assets/distortion-1.png", + "maskSpriteScaleX": 5, + "maskSpriteScaleY": 5, + "padding": 20, + "animated": { + "maskSpriteX": { + "active": true, + "speed": 0.05, + "animType": "move" + }, + "maskSpriteY": { + "active": true, + "speed": 0.07, + "animType": "move" + } + } + } + ] + }, + { + "name": "oldfilm", + "params": [ + { + "filterType": "oldfilm", + "filterId": "oldfilm", + "sepia": 0.6, + "noise": 0.2, + "noiseSize": 1, + "scratch": 0.8, + "scratchDensity": 0.5, + "scratchWidth": 1.2, + "vignetting": 0.9, + "vignettingAlpha": 0.6, + "vignettingBlur": 0.2, + "animated": { + "seed": { + "active": true, + "animType": "randomNumber", + "val1": 0, + "val2": 1 + }, + "vignetting": { + "active": true, + "animType": "syncCosOscillation", + "loopDuration": 2000, + "val1": 0.2, + "val2": 0.4 + } + } + }, + { + "filterType": "outline", + "filterId": "oldfilm", + "color": 0, + "thickness": 0 + } + ] + }, + { + "name": "twist", + "params": [ + { + "filterType": "twist", + "filterId": "twist", + "radiusPercent": 120, + "angle": 0, + "animated": { + "angle": { + "active": true, + "animType": "sinOscillation", + "loopDuration": 10000, + "val1": -1.8849555921538759, + "val2": 1.8849555921538759 + } + } + } + ] + }, + { + "name": "bulge", + "params": [ + { + "filterType": "bulgepinch", + "filterId": "bulge", + "padding": 150, + "strength": 0, + "zIndex": 2, + "radiusPercent": 200, + "animated": { + "strength": { + "active": true, + "animType": "cosOscillation", + "loopDuration": 2000, + "val1": 0, + "val2": 0.45 + } + } + } + ] + }, + { + "name": "blur", + "params": [ + { + "filterType": "blur", + "filterId": "blur", + "padding": 10, + "quality": 4, + "blur": 0, + "blurX": 0, + "blurY": 0, + "animated": { + "blurX": { + "active": true, + "animType": "syncCosOscillation", + "loopDuration": 500, + "val1": 0, + "val2": 6 + }, + "blurY": { + "active": true, + "animType": "syncCosOscillation", + "loopDuration": 750, + "val1": 0, + "val2": 6 + } + } + } + ] + }, + { + "name": "zoomblur", + "params": [ + { + "filterType": "zoomblur", + "filterId": "zoomblur", + "strength": 0.15, + "innerRadiusPercent": 65, + "radiusPercent": 100, + "padding": 30, + "animated": { + "innerRadiusPercent": { + "active": true, + "animType": "sinOscillation", + "loopDuration": 500, + "val1": 65, + "val2": 75 + } + } + } + ] + }, + { + "name": "shockwave", + "params": [ + { + "filterType": "shockwave", + "filterId": "shockwave", + "time": 0, + "amplitude": 8, + "wavelength": 75, + "radius": 500, + "brightness": 1.5, + "speed": 25, + "padding": 0, + "animated": { + "time": { + "animType": "cosOscillation", + "active": true, + "loopDuration": 1800, + "val1": 0, + "val2": 10 + } + } + } + ] + }, + { + "name": "zapshadow", + "params": [ + { + "filterType": "zapshadow", + "filterId": "zapshadow", + "alphaTolerance": 0.45 + } + ] + }, + { + "name": "rays", + "params": [ + { + "filterType": "ray", + "filterId": "rays", + "time": 0, + "color": 13598720, + "alpha": 0.5, + "divisor": 32, + "anchorX": 0, + "anchorY": 0, + "animated": { + "time": { + "active": true, + "speed": 0.0005, + "animType": "move" + } + } + } + ] + }, + { + "name": "fog", + "params": [ + { + "filterType": "fog", + "filterId": "fog", + "color": 0, + "density": 0.65, + "time": 0, + "dimX": 1, + "dimY": 1, + "animated": { + "time": { + "active": true, + "speed": 2.2, + "animType": "move" + } + } + } + ] + }, + { + "name": "fumes", + "params": [ + { + "filterType": "fumes", + "filterId": "fumes", + "color": 8421504, + "time": 0, + "blend": 8, + "animated": { + "time": { + "active": true, + "speed": 0.001, + "animType": "move" + } + } + } + ] + }, + { + "name": "electric", + "params": [ + { + "filterType": "electric", + "filterId": "electric", + "color": 16777215, + "time": 0, + "blend": 1, + "intensity": 5, + "animated": { + "time": { + "active": true, + "speed": 0.002, + "animType": "move" + } + } + } + ] + }, + { + "name": "fire", + "params": [ + { + "filterType": "fire", + "filterId": "fire", + "intensity": 1, + "color": 16777215, + "amplitude": 1, + "time": 0, + "blend": 2, + "fireBlend": 1, + "animated": { + "time": { + "active": true, + "speed": -0.0024, + "animType": "move" + }, + "intensity": { + "active": true, + "loopDuration": 15000, + "val1": 0.8, + "val2": 2, + "animType": "syncCosOscillation" + }, + "amplitude": { + "active": true, + "loopDuration": 4400, + "val1": 1, + "val2": 1.4, + "animType": "syncCosOscillation" + } + } + } + ] + }, + { + "name": "waves", + "params": [ + { + "filterType": "wave", + "filterId": "waves", + "time": 0, + "anchorX": 0.5, + "anchorY": 0.5, + "strength": 0.015, + "frequency": 120, + "color": 16777215, + "maxIntensity": 2.5, + "minIntensity": 0.9, + "padding": 10, + "animated": { + "time": { + "active": true, + "speed": 0.0085, + "animType": "move" + }, + "anchorX": { + "active": false, + "val1": 0.15, + "val2": 0.85, + "animType": "syncChaoticOscillation", + "loopDuration": 20000 + }, + "anchorY": { + "active": false, + "val1": 0.15, + "val2": 0.85, + "animType": "syncSinOscillation", + "loopDuration": 20000 + } + } + } + ] + }, + { + "name": "flood", + "params": [ + { + "filterType": "flood", + "filterId": "flood", + "time": 0, + "color": 8379, + "billowy": 0.43, + "tintIntensity": 0.72, + "glint": 0.31, + "scale": 70, + "padding": 10, + "animated": { + "time": { + "active": true, + "speed": 0.0006, + "animType": "move" + } + } + } + ] + }, + { + "name": "smoke", + "params": [ + { + "filterType": "smoke", + "filterId": "smoke", + "color": 5282269, + "time": 0, + "blend": 2, + "dimX": 0.1, + "dimY": 1, + "animated": { + "time": { + "active": true, + "speed": 0.009, + "animType": "move" + } + } + } + ] + }, + { + "name": "images", + "params": [ + { + "filterType": "images", + "filterId": "images", + "time": 0, + "nbImage": 4, + "alphaImg": 1, + "alphaChr": 0, + "blend": 4, + "ampX": 0.1, + "ampY": 0.1, + "animated": { + "time": { + "active": true, + "speed": 0.001, + "animType": "move" + } + } + } + ] + }, + { + "name": "chaos-images", + "params": [ + { + "filterType": "images", + "filterId": "chaos-images", + "time": 0, + "nbImage": 4, + "alphaImg": 1, + "alphaChr": 0, + "blend": 4, + "ampX": 0.1, + "ampY": 0.1, + "padding": 80, + "animated": { + "time": { + "active": true, + "speed": 0.001, + "animType": "move" + }, + "ampX": { + "active": true, + "val1": 0, + "val2": 0.3, + "chaosFactor": 0.03, + "animType": "syncChaoticOscillation", + "loopDuration": 2000 + }, + "ampY": { + "active": true, + "val1": 0, + "val2": 0.3, + "chaosFactor": 0.04, + "animType": "syncChaoticOscillation", + "loopDuration": 1650 + }, + "alphaChr": { + "active": true, + "animType": "randomNumberPerLoop", + "val1": 0, + "val2": 1, + "loopDuration": 250 + }, + "alphaImg": { + "active": true, + "animType": "randomNumberPerLoop", + "val1": 0.8, + "val2": 1, + "loopDuration": 250 + }, + "nbImage": { + "active": true, + "val1": 1, + "val2": 9, + "animType": "syncSinOscillation", + "loopDuration": 1400 + } + } + } + ] + }, + { + "name": "spectral-images", + "params": [ + { + "filterType": "images", + "filterId": "spectral-images", + "time": 0, + "blend": 4, + "nbImage": 4, + "padding": 100, + "alphaImg": 0.5, + "alphaChr": 0, + "ampX": 0.1, + "ampY": 0.1, + "animated": { + "time": { + "speed": 0.001, + "animType": "move" + }, + "ampX": { + "val1": 0, + "val2": 0.22, + "animType": "syncCosOscillation", + "loopDuration": 2500 + }, + "ampY": { + "val1": 0, + "val2": 0.24, + "animType": "syncCosOscillation", + "loopDuration": 2500, + "pauseBetweenDuration": 2500 + }, + "alphaChr": { + "val1": 1, + "val2": 0, + "animType": "syncCosOscillation", + "loopDuration": 2500 + }, + "alphaImg": { + "val1": 0.2, + "val2": 0.8, + "animType": "syncSinOscillation", + "loopDuration": 2500 + } + } + } + ] + }, + { + "name": "hexa-field", + "params": [ + { + "filterType": "field", + "filterId": "hexa-field", + "shieldType": 2, + "gridPadding": 1.5, + "color": 13369548, + "time": 0, + "blend": 3, + "intensity": 1, + "lightAlpha": 0.5, + "lightSize": 0.5, + "scale": 1, + "radius": 1, + "chromatic": false, + "animated": { + "time": { + "active": true, + "speed": 0.0015, + "animType": "move" + } + } + } + ] + }, + { + "name": "fire-field", + "params": [ + { + "filterType": "field", + "filterId": "fire-field", + "shieldType": 1, + "gridPadding": 2, + "color": 15041872, + "time": 0, + "blend": 2, + "intensity": 1.15, + "lightAlpha": 2, + "lightSize": 0.7, + "scale": 1, + "radius": 1, + "chromatic": false, + "animated": { + "time": { + "active": true, + "speed": 0.0015, + "animType": "move" + } + } + } + ] + }, + { + "name": "smoke-field", + "params": [ + { + "filterType": "field", + "filterId": "smoke-field", + "shieldType": 3, + "gridPadding": 1.5, + "color": 6343792, + "time": 0, + "blend": 2, + "intensity": 0.9, + "lightAlpha": 1, + "lightSize": 0.7, + "scale": 1, + "radius": 1, + "chromatic": false, + "animated": { + "time": { + "active": true, + "speed": 0.0015, + "animType": "move" + } + } + } + ] + }, + { + "name": "earth-field", + "params": [ + { + "filterType": "field", + "filterId": "earth-field", + "shieldType": 4, + "gridPadding": 2, + "color": 12292208, + "time": 0, + "blend": 1, + "intensity": 1.25, + "lightAlpha": 1, + "lightSize": 0.7, + "scale": 1, + "radius": 1, + "chromatic": false, + "animated": { + "time": { + "active": true, + "speed": 0.0015, + "animType": "move" + } + } + } + ] + }, + { + "name": "earth-field-top", + "params": [ + { + "filterType": "field", + "filterId": "earth-field-top", + "shieldType": 5, + "gridPadding": 3, + "color": 11184810, + "time": 0, + "blend": 5, + "intensity": 1.9, + "lightAlpha": 1, + "lightSize": 0.7, + "scale": 1, + "radius": 1, + "zIndex": 5, + "chromatic": true, + "animated": { + "time": { + "active": true, + "speed": 0.0015, + "animType": "move" + } + } + } + ] + }, + { + "name": "air-field", + "params": [ + { + "filterType": "field", + "filterId": "air-field", + "shieldType": 6, + "gridPadding": 1.2, + "color": 7377066, + "time": 0, + "blend": 14, + "intensity": 1, + "lightAlpha": 1, + "lightSize": 0.7, + "scale": 1, + "radius": 1, + "chromatic": false, + "animated": { + "time": { + "active": true, + "speed": 0.0015, + "animType": "move" + } + } + } + ] + }, + { + "name": "magic-field", + "params": [ + { + "filterType": "field", + "filterId": "magic-field", + "shieldType": 7, + "gridPadding": 1, + "color": 16777215, + "time": 0, + "blend": 10, + "intensity": 0.8, + "lightAlpha": 1, + "lightSize": 0.45, + "scale": 1, + "radius": 1, + "chromatic": false, + "animated": { + "time": { + "active": true, + "speed": 0.0015, + "animType": "move" + } + } + } + ] + }, + { + "name": "chromatic-field", + "params": [ + { + "filterType": "field", + "filterId": "chromatic-field", + "shieldType": 8, + "gridPadding": 2, + "color": 11184810, + "time": 0, + "blend": 0, + "intensity": 1, + "lightAlpha": 0, + "lightSize": 0, + "scale": 1, + "radius": 1, + "chromatic": true, + "animated": { + "time": { + "active": true, + "speed": 0.0045, + "animType": "move" + } + } + } + ] + }, + { + "name": "water-field", + "params": [ + { + "filterType": "field", + "filterId": "water-field", + "shieldType": 9, + "gridPadding": 1.2, + "color": 2145262, + "time": 0, + "blend": 4, + "intensity": 1, + "lightAlpha": 0.7, + "lightSize": 0.5, + "scale": 0.6, + "radius": 1, + "chromatic": false, + "animated": { + "time": { + "active": true, + "speed": 0.0015, + "animType": "move" + } + } + } + ] + }, + { + "name": "evil-field", + "params": [ + { + "filterType": "field", + "filterId": "evil-field", + "shieldType": 9, + "gridPadding": 2, + "color": 16723984, + "time": 0, + "blend": 5, + "intensity": 1, + "lightAlpha": 4, + "lightSize": 0.8, + "scale": 0.5, + "radius": 1, + "chromatic": false, + "animated": { + "time": { + "active": true, + "speed": 0.0012, + "animType": "move" + }, + "lightSize": { + "val1": 0.4, + "val2": 1.5, + "animType": "syncCosOscillation", + "loopDuration": 5000 + } + } + } + ] + }, + { + "name": "grid-field", + "params": [ + { + "filterType": "field", + "filterId": "grid-field", + "shieldType": 11, + "gridPadding": 2, + "color": 52428, + "time": 0, + "blend": 2, + "intensity": 1, + "lightAlpha": 1, + "lightSize": 0.3, + "scale": 0.5, + "radius": 1, + "chromatic": false, + "animated": { + "time": { + "active": true, + "speed": 0.0009, + "animType": "move" + } + } + } + ] + }, + { + "name": "warp-field", + "params": [ + { + "filterType": "field", + "filterId": "warp-field", + "shieldType": 12, + "gridPadding": 2, + "color": 16777215, + "time": 0, + "blend": 2, + "intensity": 1, + "lightAlpha": 0.8, + "lightSize": 0.5, + "scale": 0.9, + "radius": 1, + "chromatic": false, + "animated": { + "time": { + "active": true, + "speed": 0.0009, + "animType": "move" + } + } + } + ] + }, + { + "name": "color-field", + "params": [ + { + "filterType": "field", + "filterId": "color-field", + "shieldType": 13, + "gridPadding": 2, + "color": 52224, + "time": 0, + "blend": 14, + "intensity": 1, + "lightAlpha": 0, + "lightSize": 0, + "scale": 1, + "radius": 1, + "chromatic": false, + "animated": { + "time": { + "active": true, + "speed": 0.0009, + "animType": "move" + } + } + } + ] + }, + { + "name": "sunburst", + "params": [ + { + "filterType": "xray", + "filterId": "sunburst", + "time": 0, + "color": 16759552, + "blend": 9, + "dimX": 1, + "dimY": 1, + "anchorX": 0, + "anchorY": 0, + "divisor": 36, + "intensity": 4, + "animated": { + "time": { + "active": true, + "speed": 0.0012, + "animType": "move" + }, + "anchorX": { + "animType": "syncCosOscillation", + "loopDuration": 6000, + "val1": 0.4, + "val2": 0.6 + } + } + } + ] + }, + { + "name": "clover", + "params": [ + { + "filterType": "xray", + "filterId": "clover", + "time": 0, + "color": 65280, + "blend": 9, + "dimX": 0.05, + "dimY": 0.05, + "anchorX": 0.5, + "anchorY": 0.5, + "divisor": 4, + "intensity": 1, + "animated": { + "time": { + "active": true, + "speed": 0.0012, + "animType": "move" + }, + "anchorX": { + "animType": "syncCosOscillation", + "loopDuration": 6000, + "val1": 0.4, + "val2": 0.6 + }, + "anchorY": { + "animType": "syncSinOscillation", + "loopDuration": 6000, + "val1": 0.4, + "val2": 0.6 + } + } + } + ] + }, + { + "name": "scan", + "params": [ + { + "filterType": "xray", + "filterId": "scan", + "time": 0, + "color": 16777215, + "blend": 5, + "dimX": 20, + "dimY": 20, + "anchorX": 0.5, + "anchorY": 0, + "divisor": 8, + "intensity": 1, + "animated": { + "time": { + "active": true, + "speed": 0.0005, + "animType": "move" + } + } + } + ] + }, + { + "name": "blue-rays", + "params": [ + { + "filterType": "xray", + "filterId": "blue-rays", + "time": 0, + "color": 1061119, + "blend": 9, + "dimX": 1, + "dimY": 1, + "anchorX": 0, + "anchorY": 0, + "divisor": 24, + "intensity": 1, + "animated": { + "time": { + "active": true, + "speed": 0.0002, + "animType": "move" + }, + "anchorX": { + "animType": "syncCosOscillation", + "loopDuration": 18000, + "val1": 0.05, + "val2": 0.95 + }, + "anchorY": { + "animType": "syncSinOscillation", + "loopDuration": 18000, + "val1": 0.05, + "val2": 0.95 + } + } + } + ] + }, + { + "name": "spectral-body", + "params": [ + { + "filterType": "liquid", + "filterId": "spectral-body", + "color": 2140910, + "time": 0, + "blend": 8, + "intensity": 4, + "spectral": true, + "scale": 0.9, + "animated": { + "time": { + "active": true, + "speed": 0.001, + "animType": "move" + }, + "color": { + "active": true, + "loopDuration": 6000, + "animType": "colorOscillation", + "val1": 16777215, + "val2": 43775 + } + } + } + ] + }, + { + "name": "mantle-of-madness", + "params": [ + { + "filterType": "liquid", + "filterId": "mantle-of-madness", + "color": 37119, + "time": 0, + "blend": 5, + "intensity": 0.0001, + "spectral": false, + "scale": 7, + "animated": { + "time": { + "active": true, + "speed": 0.0015, + "animType": "move" + }, + "intensity": { + "active": true, + "animType": "syncCosOscillation", + "loopDuration": 30000, + "val1": 0.0001, + "val2": 4 + }, + "scale": { + "active": true, + "animType": "syncCosOscillation", + "loopDuration": 30000, + "val1": 7, + "val2": 1 + } + } + } + ] + }, + { + "name": "drift-in-plans", + "params": [ + { + "filterType": "wave", + "filterId": "drift-in-plans", + "time": 0, + "anchorX": 0.5, + "anchorY": 0.5, + "strength": 0.035, + "frequency": 80, + "color": 16777215, + "maxIntensity": 1.5, + "minIntensity": 0.5, + "padding": 10, + "animated": { + "time": { + "active": true, + "speed": 0.0085, + "animType": "move" + }, + "anchorX": { + "active": true, + "val1": 0.35, + "val2": 0.65, + "animType": "syncCosOscillation", + "loopDuration": 10000 + }, + "anchorY": { + "active": true, + "val1": 0.35, + "val2": 0.65, + "animType": "syncSinOscillation", + "loopDuration": 10000 + } + } + }, + { + "filterType": "liquid", + "filterId": "drift-in-plans", + "color": 16711680, + "time": 0, + "blend": 6, + "intensity": 5, + "spectral": false, + "scale": 2.5, + "animated": { + "time": { + "active": true, + "speed": 0.0018, + "animType": "move" + }, + "color": { + "active": true, + "loopDuration": 9000, + "animType": "colorOscillation", + "val1": 16711680, + "val2": 16777215 + } + } + } + ] + }, + { + "name": "fire-aura", + "params": [ + { + "filterType": "zapshadow", + "filterId": "fire-aura", + "alphaTolerance": 0.5 + }, + { + "filterType": "xglow", + "filterId": "fire-aura", + "auraType": 2, + "color": 9449488, + "thickness": 9.8, + "scale": 4, + "time": 0, + "auraIntensity": 2, + "subAuraIntensity": 1.5, + "threshold": 0.4, + "discard": true, + "animated": { + "time": { + "active": true, + "speed": 0.0027, + "animType": "move" + }, + "thickness": { + "active": true, + "loopDuration": 3000, + "animType": "cosOscillation", + "val1": 2, + "val2": 5 + } + } + } + ] + }, + { + "name": "glacial-aura", + "params": [ + { + "filterType": "zapshadow", + "filterId": "glacial-aura", + "alphaTolerance": 0.5 + }, + { + "filterType": "xglow", + "filterId": "glacial-aura", + "auraType": 1, + "color": 5282269, + "thickness": 4.5, + "scale": 3, + "time": 0, + "auraIntensity": 0.8, + "subAuraIntensity": 0.25, + "threshold": 0.5, + "discard": false, + "animated": { + "time": { + "active": true, + "speed": 0.0018, + "animType": "move" + }, + "thickness": { + "val1": 2, + "val2": 4.7, + "animType": "cosOscillation", + "loopDuration": 3000 + }, + "subAuraIntensity": { + "val1": 0.45, + "val2": 0.65, + "animType": "cosOscillation", + "loopDuration": 6000 + }, + "auraIntensity": { + "val1": 0.9, + "val2": 2.2, + "animType": "cosOscillation", + "loopDuration": 3000 + } + } + } + ] + }, + { + "name": "anti-aura", + "params": [ + { + "filterType": "zapshadow", + "filterId": "anti-aura", + "alphaTolerance": 0.5 + }, + { + "filterType": "xglow", + "filterId": "anti-aura", + "auraType": 2, + "color": 328965, + "thickness": 2.7, + "scale": 7, + "time": 0, + "auraIntensity": 5, + "subAuraIntensity": 2, + "threshold": 0.08, + "discard": false, + "animated": { + "time": { + "active": true, + "speed": 0.0012, + "animType": "move" + }, + "auraIntensity": { + "active": true, + "loopDuration": 3000, + "animType": "syncCosOscillation", + "val1": 5, + "val2": 0 + }, + "subAuraIntensity": { + "active": true, + "loopDuration": 3000, + "animType": "syncCosOscillation", + "val1": 2, + "val2": 0 + }, + "color": { + "active": true, + "loopDuration": 6000, + "animType": "syncColorOscillation", + "val1": 328965, + "val2": 2097152 + }, + "threshold": { + "active": true, + "loopDuration": 1500, + "animType": "syncCosOscillation", + "val1": 0.02, + "val2": 0.5 + } + } + } + ] + }, + { + "name": "pure-fire-aura", + "params": [ + { + "filterType": "fire", + "filterId": "pure-fire-aura", + "intensity": 1, + "color": 16777215, + "amplitude": 1, + "time": 0, + "blend": 2, + "fireBlend": 1, + "animated": { + "time": { + "active": true, + "speed": -0.0024, + "animType": "move" + }, + "intensity": { + "active": true, + "loopDuration": 15000, + "val1": 0.8, + "val2": 2, + "animType": "syncCosOscillation" + }, + "amplitude": { + "active": true, + "loopDuration": 4400, + "val1": 1, + "val2": 1.4, + "animType": "syncCosOscillation" + } + } + }, + { + "filterType": "zapshadow", + "filterId": "pure-fire-aura", + "alphaTolerance": 0.5 + }, + { + "filterType": "xglow", + "filterId": "pure-fire-aura", + "auraType": 2, + "color": 9449488, + "thickness": 9.8, + "scale": 4, + "time": 0, + "auraIntensity": 2, + "subAuraIntensity": 1.5, + "threshold": 0.4, + "discard": true, + "animated": { + "time": { + "active": true, + "speed": 0.0027, + "animType": "move" + }, + "thickness": { + "active": true, + "loopDuration": 3000, + "animType": "cosOscillation", + "val1": 2, + "val2": 5 + } + } + } + ] + }, + { + "name": "pure-fire-aura-2", + "params": [ + { + "filterType": "zapshadow", + "filterId": "pure-fire-aura-2", + "alphaTolerance": 0.5 + }, + { + "filterType": "xglow", + "filterId": "pure-fire-aura-2", + "auraType": 2, + "color": 9449488, + "thickness": 9.8, + "scale": 4, + "time": 0, + "auraIntensity": 1, + "subAuraIntensity": 0.3, + "threshold": 0.5, + "discard": true, + "animated": { + "time": { + "active": true, + "speed": 0.0027, + "animType": "move" + }, + "thickness": { + "active": true, + "loopDuration": 3000, + "animType": "cosOscillation", + "val1": 2, + "val2": 3.6 + } + } + }, + { + "filterType": "fire", + "filterId": "pure-fire-aura-2", + "intensity": 1, + "color": 16777215, + "amplitude": 1, + "time": 0, + "blend": 2, + "fireBlend": 1, + "animated": { + "time": { + "active": true, + "speed": -0.0024, + "animType": "move" + }, + "intensity": { + "active": true, + "loopDuration": 15000, + "val1": 0.8, + "val2": 3, + "animType": "syncCosOscillation" + }, + "amplitude": { + "active": true, + "loopDuration": 4400, + "val1": 1, + "val2": 1.6, + "animType": "syncCosOscillation" + } + } + } + ] + }, + { + "name": "pure-ice-aura", + "params": [ + { + "filterType": "zapshadow", + "filterId": "pure-ice-aura", + "alphaTolerance": 0.5 + }, + { + "filterType": "xglow", + "filterId": "pure-ice-aura", + "auraType": 1, + "color": 5282269, + "thickness": 4.5, + "scale": 10, + "time": 0, + "auraIntensity": 0.25, + "subAuraIntensity": 1, + "threshold": 0.5, + "discard": false, + "animated": { + "time": { + "active": true, + "speed": 0.0018, + "animType": "move" + }, + "thickness": { + "val1": 2, + "val2": 3.3, + "animType": "cosOscillation", + "loopDuration": 3000 + }, + "subAuraIntensity": { + "val1": 0.45, + "val2": 0.65, + "animType": "cosOscillation", + "loopDuration": 6000 + }, + "auraIntensity": { + "val1": 0.9, + "val2": 2.2, + "animType": "cosOscillation", + "loopDuration": 3000 + } + } + }, + { + "filterType": "smoke", + "filterId": "pure-ice-aura", + "color": 8441087, + "time": 0, + "blend": 2, + "dimX": 0.3, + "dimY": 1, + "animated": { + "time": { + "active": true, + "speed": -0.006, + "animType": "move" + }, + "dimX": { + "val1": 0.4, + "val2": 0.2, + "animType": "cosOscillation", + "loopDuration": 3000 + } + } + } + ] + }, + { + "name": "pixelate", + "params": [ + { + "filterType": "pixel", + "filterId": "pixelate", + "sizeX": 2.5, + "sizeY": 2.5 + } + ] + } +] \ No newline at end of file diff --git a/tokenmagic/lang/en.json b/tokenmagic/lang/en.json index 6c4989a..541dc44 100644 --- a/tokenmagic/lang/en.json +++ b/tokenmagic/lang/en.json @@ -1,7 +1,25 @@ { "TMFX.TokenMagic": "TokenMagic", + "TMFX.preset.add.success": "The FX has been successfully added to the preset library.", + "TMFX.preset.add.permission.failure": "You are not allowed to add FX to the preset library.", + "TMFX.preset.add.params.failure": "The FX could not be added to the preset library. The parameters are incorrect.", + "TMFX.preset.add.duplicate.failure": "The FX could not be added to the preset library. An FX with the same name already exists.", + "TMFX.preset.delete.success": "The FX has been successfully removed from the preset library.", + "TMFX.preset.delete.permission.failure": "You are not allowed to delete FX in the preset library.", + "TMFX.preset.delete.params.failure": "Deletion failed : the \"name\" parameter must be a string.", + "TMFX.preset.delete.notfound.failure": "The FX to delete does not exist in the preset library.", + "TMFX.preset.delete.empty.failure": "Failure : the preset library is already empty !", + "TMFX.preset.import.format.failure": "The import could not be completed. Invalid format.", + "TMFX.preset.import.success": "The FX import was completed successfully.", + "TMFX.preset.import.failure": "The import could not be completed.", + "TMFX.preset.reset.message": "Are you sure you want to reset your library of presets?", + "TMFX.preset.reset.success": "Your preset library has been successfully reset.", + "TMFX.importOverwrite.name": "Overwrite on import", + "TMFX.importOverwrite.hint": "Check this option if you want to replace presets with the same name during an import.", "TMFX.useMaxPadding.name": "FX in additive padding mode", "TMFX.useMaxPadding.hint": "By default, FX paddings are additives when applied on a given placeable. If the checkbox is unchecked, the maximum padding is used.", "TMFX.minPadding.name": "Minimum padding", - "TMFX.minPadding.hint": "The minimum padding applied to a FX." + "TMFX.minPadding.hint": "The minimum padding applied to an FX.", + "TMFX.fxPlayerPermission.name": "Permissive mode", + "TMFX.fxPlayerPermission.hint": "If this option is checked, non-GM players can add, modify and delete FX on placeables which they do not own. A GM must be connected." } diff --git a/tokenmagic/lang/fr.json b/tokenmagic/lang/fr.json index 3fd3878..6a4cff3 100644 --- a/tokenmagic/lang/fr.json +++ b/tokenmagic/lang/fr.json @@ -1,7 +1,25 @@ { "TMFX.TokenMagic": "TokenMagic", - "TMFX.useMaxPadding.name": "Effets en mode padding additif", + "TMFX.preset.add.success": "L'effet a été ajouté avec succès à la bibliothèque de prédéfinitions.", + "TMFX.preset.add.permission.failure": "Vous n'êtes pas autorisé à ajouter des effets dans la bibliothèque de prédéfinitions.", + "TMFX.preset.add.params.failure": "L'effet n'a pas pu être ajouté à la bibliothèque de prédéfinitions. Les paramètres sont incorrects.", + "TMFX.preset.add.duplicate.failure": "L'effet n'a pas pu être ajouté à la bibliothèque de prédéfinitions. Un effet avec le même nom existe déjà.", + "TMFX.preset.delete.success": "L'effet a été supprimé avec succès de la bibliothèque de prédéfinitions.", + "TMFX.preset.delete.permission.failure": "Vous n'êtes pas autorisé à supprimer des effets dans la bibliothèque de prédéfinitions.", + "TMFX.preset.delete.params.failure": "La suppression a échoué : le paramètre \"name\" doit être une chaîne de caractères.", + "TMFX.preset.delete.notfound.failure": "L'effet à supprimer n'existe pas dans la bibliothèque de prédéfinitions.", + "TMFX.preset.delete.empty.failure": "Echec : la bibliothèque de prédéfinitions est déjà vide !", + "TMFX.preset.import.format.failure": "Échec de l'importation. Objet JSON invalide.", + "TMFX.preset.import.success": "L'importation s'est terminée avec succès.", + "TMFX.preset.import.failure": "L'importation n'a pas pu aboutir.", + "TMFX.preset.reset.message": "Voulez-vous vraiment réinitialiser votre bibliothèque de prédéfinitions ?", + "TMFX.preset.reset.success": "Votre bibliothèque de prédéfinitions a été réinitialisée avec succès.", + "TMFX.importOverwrite.name": "Écraser lors d'une importation", + "TMFX.importOverwrite.hint": "Cochez cette option si vous souhaitez écraser les prédéfinitions avec le même nom pendant une importation.", + "TMFX.useMaxPadding.name": "Effet en mode padding additif", "TMFX.useMaxPadding.hint": "Par défaut, les effets additionnent leur padding en s'appliquant sur un objet donné. Si la case est décochée, c'est le padding maximum qui est utilisé.", "TMFX.minPadding.name": "Padding minimum", - "TMFX.minPadding.hint": "Padding minimum appliqué aux effets." + "TMFX.minPadding.hint": "Padding minimum appliqué aux effets.", + "TMFX.fxPlayerPermission.name": "Mode permissif", + "TMFX.fxPlayerPermission.hint": "Si cette option est cochée, les joueurs non-MJ peuvent ajouter, modifier et supprimer des effets sur des jetons qu'ils ne possèdent pas. Un MJ doit être connecté." } diff --git a/tokenmagic/module.json b/tokenmagic/module.json index 385f516..27f02ac 100644 --- a/tokenmagic/module.json +++ b/tokenmagic/module.json @@ -1,8 +1,8 @@ { "name": "tokenmagic", - "title": "Tokenmagic", + "title": "Token Magic FX", "description": "

Add graphic filters and animations on your tokens and tiles.

", - "version": "0.2.0", + "version": "0.2.1", "compatibleCoreVersion": "0.6.5", "minimumCoreVersion": "0.6.0", "author": "SecretFire", @@ -54,6 +54,7 @@ "fx/filters/FilterXRays.js", "fx/filters/FilterLiquid.js", "fx/filters/FilterGleamingGlow.js", + "fx/filters/FilterPixelate.js", "fx/filters/proto/FilterProto.js" ], diff --git a/tokenmagic/module/proto/PlaceableObjectProto.js b/tokenmagic/module/proto/PlaceableObjectProto.js index 012c5fb..f667853 100644 --- a/tokenmagic/module/proto/PlaceableObjectProto.js +++ b/tokenmagic/module/proto/PlaceableObjectProto.js @@ -1,24 +1,101 @@ +import { PlaceableType, Magic, broadcast, SocketAction, mustBroadCast, isTheOne } from "../tokenmagic.js"; PlaceableObject.prototype.TMFXaddFilters = async function (paramsArray) { - await window.TokenMagic.addFilters(this, paramsArray); + await Magic.addFilters(this, paramsArray); } PlaceableObject.prototype.TMFXupdateFilters = async function (paramsArray) { - await window.TokenMagic.updateFiltersByPlaceable(this, paramsArray); + await Magic.updateFiltersByPlaceable(this, paramsArray); } PlaceableObject.prototype.TMFXaddUpdateFilters = async function (paramsArray) { - await window.TokenMagic.addUpdateFilters(this, paramsArray); + await Magic.addUpdateFilters(this, paramsArray); } PlaceableObject.prototype.TMFXdeleteFilters = async function (filterId = null) { - await window.TokenMagic.deleteFilters(this, filterId); + await Magic.deleteFilters(this, filterId); } PlaceableObject.prototype.TMFXhasFilterType = function (filterType) { - return window.TokenMagic.hasFilterType(this, filterType); + return Magic.hasFilterType(this, filterType); } PlaceableObject.prototype.TMFXhasFilterId = function (filterId) { - return window.TokenMagic.hasFilterId(this, filterId); + return Magic.hasFilterId(this, filterId); +} + +PlaceableObject.prototype._TMFXsetFlag = async function (flag) { + if (mustBroadCast()) broadcast(this, flag, SocketAction.SET_FLAG); + else await this.setFlag("tokenmagic", "filters", flag); +} + +PlaceableObject.prototype._TMFXunsetFlag = async function () { + if (mustBroadCast()) broadcast(this, null, SocketAction.SET_FLAG); + else await this.unsetFlag("tokenmagic", "filters"); +} + +PlaceableObject.prototype._TMFXgetSprite = function () { + + switch (this.constructor.embeddedName) { + case PlaceableType.TOKEN: + return this.icon; + break; + case PlaceableType.TILE: + return this.tile.img; + break; + case PlaceableType.TEMPLATE: + return this.template; + break; + default: + return null; + } +} + +PlaceableObject.prototype._TMFXcheckSprite = function () { + + switch (this.constructor.embeddedName) { + case PlaceableType.TOKEN: + return (this.hasOwnProperty("icon") + && !(this.icon == null)); + break; + case PlaceableType.TILE: + return (this.hasOwnProperty("tile") + && this.tile.hasOwnProperty("img") + && !(this.tile.img == null)); + break; + case PlaceableType.TEMPLATE: + return (this.hasOwnProperty("template") + && !(this.template == null)); + break; + default: + return null; + } +} + +PlaceableObject.prototype._TMFXsetRawFilters = function (filters) { + + let sprite; + sprite = this._TMFXgetSprite(); + if (sprite == null) { return false; } + + if (filters == null) { + sprite.filters = null; + } else { + sprite.filters == null + ? sprite.filters = [filters] + : sprite.filters.push(filters); + } + + return true; +} + +PlaceableObject.prototype._TMFXunsetRawFilters = function () { + return this._TMFXsetRawFilters(null); +} + +PlaceableObject.prototype._TMFXgetPlaceableType = function () { + if ([PlaceableType.TOKEN, PlaceableType.TILE, PlaceableType.TEMPLATE] + .includes(this.constructor.embeddedName)) return this.constructor.embeddedName; + + return PlaceableType.NOT_SUPPORTED; } \ No newline at end of file diff --git a/tokenmagic/module/tokenmagic.js b/tokenmagic/module/tokenmagic.js index 51dd12d..61d4c05 100644 --- a/tokenmagic/module/tokenmagic.js +++ b/tokenmagic/module/tokenmagic.js @@ -25,7 +25,9 @@ import { FilterMirrorImages } from "../fx/filters/FilterMirrorImages.js"; import { FilterXRays } from "../fx/filters/FilterXRays.js"; import { FilterLiquid } from "../fx/filters/FilterLiquid.js"; import { FilterGleamingGlow } from "../fx/filters/FilterGleamingGlow.js"; +import { FilterPixelate } from "../fx/filters/FilterPixelate.js"; import { Anime } from "../fx/Anime.js"; +import { presets as defaultPresets } from "../fx/presets/defaultpresets.js"; import "./proto/PlaceableObjectProto.js"; const moduleTM = "module.tokenmagic"; @@ -58,20 +60,70 @@ export const FilterType = { field: FilterForceField, xray: FilterXRays, liquid: FilterLiquid, - xglow: FilterGleamingGlow + xglow: FilterGleamingGlow, + pixel: FilterPixelate +}; + +var cachedFilters = {}; + +async function cacheFilters() { + // Only caching filters with heavy shaders that takes time to compile + // https://www.html5gamedevs.com/topic/43652-shader-compile-performance/ + let params = + { + filterType: "field", + enabled: true, + dummy: true + }; + cachedFilters.filterForceField = new FilterForceField(params); + + params.filterType = "electric"; + cachedFilters.filterElectric = new FilterElectric(params); + + params.filterType = "xglow"; + cachedFilters.filterGleamingGlow = new FilterGleamingGlow(params); + + params.filterType = "fire"; + cachedFilters.filterFire = new FilterFire(params); + + params.filterType = "smoke"; + cachedFilters.filterSmoke = new FilterSmoke(params); + + params.filterType = "images"; + cachedFilters.filterImages = new FilterMirrorImages(params); +} + +export const PlaceableType = { + TOKEN: Token.embeddedName, + TILE: Tile.embeddedName, + TEMPLATE: MeasuredTemplate.embeddedName, + NOT_SUPPORTED: null }; function i18n(key) { return game.i18n.localize(key); } -export function registerSettings() { +async function exportObjectAsJson(exportObj, exportName) { + let jsonStr = JSON.stringify(exportObj, null, 4); + + const a = document.createElement('a'); + const file = new Blob([jsonStr], { type: 'plain/text' }); + + a.href = URL.createObjectURL(file); + a.download = exportName + '.json'; + a.click(); + + URL.revokeObjectURL(a.href); +} + +function registerSettings() { game.settings.register("tokenmagic", "useAdditivePadding", { name: i18n("TMFX.useMaxPadding.name"), hint: i18n("TMFX.useMaxPadding.hint"), scope: "world", config: true, - default: true, + default: false, type: Boolean }); @@ -80,12 +132,54 @@ export function registerSettings() { hint: i18n("TMFX.minPadding.hint"), scope: "world", config: true, - default: 0, + default: 50, type: Number }); + + game.settings.register("tokenmagic", "fxPlayerPermission", { + name: i18n("TMFX.fxPlayerPermission.name"), + hint: i18n("TMFX.fxPlayerPermission.hint"), + scope: "world", + config: true, + default: false, + type: Boolean + }); + + game.settings.register("tokenmagic", "importOverwrite", { + name: i18n("TMFX.importOverwrite.name"), + hint: i18n("TMFX.importOverwrite.hint"), + scope: "world", + config: true, + default: false, + type: Boolean + }); + + game.settings.register("tokenmagic", "presets", { + name: "Token Magic FX presets", + hint: "Token Magic FX presets", + scope: "world", + config: false, + default: defaultPresets, + type: Object + }); } -const sleep = m => new Promise(r => setTimeout(r, m)); +export const SocketAction = { + SET_FLAG: "TMFXSetFlag" +}; + +export function broadcast(placeable, flag, socketAction) { + + var data = + { + tmAction: socketAction, + tmPlaceableId: placeable.id, + tmPlaceableType: placeable._TMFXgetPlaceableType(), + tmFlag: flag, + tmViewedScene: game.user.viewedScene + }; + game.socket.emit(moduleTM, data, resp => { }); +} export function isActiveModule(moduleName) { return game.modules.has(moduleName) @@ -100,6 +194,17 @@ export function isAdditivePaddingConfig() { return game.settings.get("tokenmagic", "useAdditivePadding"); } +export function isTheOne() { + const theOne = game.users.find((user) => user.isGM && user.active); + if (theOne && game.user !== theOne) { + return false; + } else return true +} + +export function mustBroadCast() { + return game.settings.get("tokenmagic", "fxPlayerPermission") && !isTheOne(); +} + export function autosetPaddingMode() { canvas.app.renderer.filter.useMaxPadding = !isAdditivePaddingConfig(); } @@ -109,35 +214,47 @@ export function log(output) { console.log(logged, "color:#4BC470", "color:#B3B3B3"); } +export function warn(output) { + let logged = "TokenMagic | " + output; + console.warn(logged); +} + +export function error(output) { + let logged = "TokenMagic | " + output; + console.error(logged); +} + export function getControlledPlaceables() { var controlled = []; switch (canvas.activeLayer.name) { - case "TokenLayer": + case TokenLayer.name: controlled = canvas.tokens.controlled; break; - case "TilesLayer": + case TilesLayer.name: controlled = canvas.tiles.controlled; break; } return controlled; } -// Only for tokens export function getTargetedTokens() { return canvas.tokens.placeables.filter(placeable => placeable.isTargeted); } export function getPlaceableById(id, type) { - let placeable; - let placeables; + let placeable = null; + let placeables = null; switch (type) { - case "Token": + case PlaceableType.TOKEN: placeables = canvas.tokens.placeables; break; - case "Tile": + case PlaceableType.TILE: placeables = canvas.tiles.placeables; break; + case PlaceableType.TEMPLATE: + placeables = canvas.templates.placeables; + break; } if (!(placeables == null) && placeables.length > 0) { @@ -160,16 +277,10 @@ export function objectAssign(target, ...sources) { return target; } -// NOTES FOR DEV : API will be extended in a near future, to allow more control over filters export function TokenMagic() { - // Add a filter on selected placeable(s) async function addFilterOnSelected(params) { - if (params == null - || !params.hasOwnProperty("filterType") - || !FilterType.hasOwnProperty(params.filterType)) { - return; - } + if (params == null) return; var controlled = getControlledPlaceables(); @@ -180,7 +291,24 @@ export function TokenMagic() { } }; + async function addUpdateFilterOnSelected(params) { + if (params == null) return; + + var controlled = getControlledPlaceables(); + + if (!(controlled == null) && controlled.length > 0) { + for (const placeable of controlled) { + await addUpdateFilter(placeable, params); + } + } + }; + async function addFiltersOnSelected(paramsArray) { + + if (typeof paramsArray === "string") { + paramsArray = getPreset(paramsArray); + } + if (paramsArray instanceof Array && paramsArray.length > 0) { for (const params of paramsArray) { await addFilterOnSelected(params); @@ -188,12 +316,21 @@ export function TokenMagic() { } }; - async function addFilterOnTargeted(params) { - if (params == null - || !params.hasOwnProperty("filterType") - || !FilterType.hasOwnProperty(params.filterType)) { - return; + async function addUpdateFiltersOnSelected(paramsArray) { + + if (typeof paramsArray === "string") { + paramsArray = getPreset(paramsArray); + } + + if (paramsArray instanceof Array && paramsArray.length > 0) { + for (const params of paramsArray) { + await addUpdateFilterOnSelected(params); + } } + }; + + async function addFilterOnTargeted(params) { + if (params == null) return; var targeted = getTargetedTokens(); @@ -205,6 +342,11 @@ export function TokenMagic() { } async function addFiltersOnTargeted(paramsArray) { + + if (typeof paramsArray === "string") { + paramsArray = getPreset(paramsArray); + } + if (paramsArray instanceof Array && paramsArray.length > 0) { for (const params of paramsArray) { await addFilterOnTargeted(params); @@ -212,7 +354,6 @@ export function TokenMagic() { } } - // Add a filter on a placeable async function addFilter(placeable, params) { if (placeable == null || params == null @@ -232,15 +373,7 @@ export function TokenMagic() { params.placeableId = placeable.id; params.filterInternalId = randomID(); params.filterOwner = game.data.userId; - - // TODO : to rework - if (placeable instanceof Token) { - params.placeableType = "Token"; - } else if (placeable instanceof Tile) { - params.placeableType = "Tile"; - } else { - params.placeableType = ""; - } + params.placeableType = placeable._TMFXgetPlaceableType(); var placeableNewFlag = [{ tmFilters: { @@ -261,7 +394,7 @@ export function TokenMagic() { placeableFlag = placeableActualFlag.concat(placeableNewFlag); } - await placeable.setFlag("tokenmagic", "filters", placeableFlag); + await placeable._TMFXsetFlag(placeableFlag); }; async function addUpdateFilters(placeable, paramsArray) { @@ -280,7 +413,8 @@ export function TokenMagic() { return; } - if (params.hasOwnProperty("filterId") && placeable.TMFXhasFilterId(params.filterId)) { + if (params.hasOwnProperty("filterId") && placeable.TMFXhasFilterId(params.filterId) + && placeable.TMFXhasFilterType(params.filterType)) { await updateFilterByPlaceable(params, placeable); } else { await addFilter(placeable, params); @@ -288,6 +422,9 @@ export function TokenMagic() { }; async function addFilters(placeable, paramsArray) { + if (typeof paramsArray === "string") { + paramsArray = getPreset(paramsArray); + } if (paramsArray instanceof Array && paramsArray.length > 0) { for (const params of paramsArray) { await addFilter(placeable, params); @@ -321,10 +458,14 @@ export function TokenMagic() { if (placeableIdSet.size <= 0) { return; } for (const placeableId of placeableIdSet) { - // TODO : to improve - var placeable = getPlaceableById(placeableId, "Token"); + // we must browse the collection of placeables whatever their types + // we have just a filterId. + var placeable = getPlaceableById(placeableId, PlaceableType.TOKEN); if (placeable == null) { - placeable = getPlaceableById(placeableId, "Tile"); + placeable = getPlaceableById(placeableId, PlaceableType.TILE); + } + if (placeable == null) { + placeable = getPlaceableById(placeableId, PlaceableType.TEMPLATE); } if (!(placeable == null) && placeable instanceof PlaceableObject) { await updateFilterByPlaceable(params, placeable); @@ -336,6 +477,9 @@ export function TokenMagic() { var placeables = getControlledPlaceables(); if (placeables == null || placeables.length < 1) { return; } + if (typeof paramsArray === "string") { + paramsArray = getPreset(paramsArray); + } if (!paramsArray instanceof Array || paramsArray.length < 1) { return; } for (const placeable of placeables) { @@ -349,6 +493,9 @@ export function TokenMagic() { var placeables = getTargetedTokens(); if (placeables == null || placeables.length < 1) { return; } + if (typeof paramsArray === "string") { + paramsArray = getPreset(paramsArray); + } if (!paramsArray instanceof Array || paramsArray.length < 1) { return; } for (const placeable of placeables) { @@ -359,6 +506,10 @@ export function TokenMagic() { } async function updateFiltersByPlaceable(placeable, paramsArray) { + + if (typeof paramsArray === "string") { + paramsArray = getPreset(paramsArray); + } if (paramsArray instanceof Array && paramsArray.length > 0) { for (const params of paramsArray) { await updateFilterByPlaceable(params, placeable); @@ -376,13 +527,14 @@ export function TokenMagic() { }); workingFlags.forEach(flag => { - if (flag.tmFilters.tmFilterId === params.filterId) { + if (flag.tmFilters.tmFilterId === params.filterId + && flag.tmFilters.tmFilterType === params.filterType) { if (flag.tmFilters.hasOwnProperty("tmParams")) { objectAssign(flag.tmFilters.tmParams, params); } } }); - await placeable.setFlag("tokenmagic", "filters", workingFlags); + await placeable._TMFXsetFlag(workingFlags); }; @@ -412,9 +564,8 @@ export function TokenMagic() { async function deleteFilters(placeable, filterId = null) { if (placeable == null) { return; } - if (filterId == null) { - await placeable.unsetFlag("tokenmagic", "filters"); - } else if (typeof filterId === "string") { + if (filterId == null) await placeable._TMFXunsetFlag(); + else if (typeof filterId === "string") { var flags = placeable.getFlag("tokenmagic", "filters"); if (flags == null || !flags instanceof Array || flags.length < 1) { return; } // nothing to delete... @@ -426,11 +577,8 @@ export function TokenMagic() { } }); - if (workingFlags.length > 0) { - await placeable.setFlag("tokenmagic", "filters", workingFlags); - } else { - await placeable.unsetFlag("tokenmagic", "filters"); - } + if (workingFlags.length > 0) await placeable._TMFXsetFlag(workingFlags); + else await placeable._TMFXunsetFlag(); } }; @@ -464,26 +612,11 @@ export function TokenMagic() { return true; }; - // TODO : to improve function setFilter(placeable, filter, params = {}) { params.placeableId = placeable.id; - - if (placeable instanceof Token) { - params.placeableType = "Token"; - if (placeable.icon.filters == null) { - placeable.icon.filters = [filter]; - } else { - placeable.icon.filters.push(filter); - } - } else if (placeable instanceof Tile) { - params.placeableType = "Tile"; - if (placeable.tile.img.filters == null) { - placeable.tile.img.filters = [filter]; - } else { - placeable.tile.img.filters.push(filter); - } - } + params.placeableType = placeable._TMFXgetPlaceableType(); + placeable._TMFXsetRawFilters(filter); }; function _assignFilters(placeable, filters) { @@ -622,20 +755,261 @@ export function TokenMagic() { return theFilters; }; - // The clean up - if (placeable instanceof Token) { - placeable.icon.filters = filterTheFiltering(placeable.icon.filters); - } else if (placeable instanceof Tile) { - placeable.tile.img.filters = filterTheFiltering(placeable.tile.img.filters); + var sprite = placeable._TMFXgetSprite(); + if (sprite != null) { + sprite.filters = filterTheFiltering(sprite.filters); } }; + async function _importContent(content, options = {}) { + + options.overwrite = game.settings.get("tokenmagic", "importOverwrite"); + + /////////////////////////////////////////////// + // Checking the imported object format + + log("import -> checking import file format..."); + if (!(content instanceof Array) || content.length < 1) { + error("import -> file format check KO !"); + error(i18n("TMFX.preset.import.format.failure")); + return false; + } + log("import -> file format check OK !"); + // check object format end + ///////////////////////////////////////////////// + + var check = true; + + /////////////////////////////////////////////// + // Checking the imported content + log("import -> checking import file content..."); + for (const element of content) { + if (element.hasOwnProperty("name") + && typeof element.name === "string" + && element.hasOwnProperty("params") + && element.params instanceof Array) { + + for (const effect of element.params) { + if (!(effect.hasOwnProperty("filterType") + && FilterType.hasOwnProperty(effect.filterType))) { + check = false; + break; + } + } + if (!check) break; + } else { + check = false; + break; + } + } + + if (!check) { + error("import -> file content check KO !"); + error(i18n("TMFX.preset.import.format.failure")); + return false; + } + log("import -> file content check OK !"); + + // check content end + ///////////////////////////////////////////////// + + // The preset libray must be replaced ? + if (options.hasOwnProperty("replaceLibrary") + && options.replaceLibrary) { + await game.settings.set("tokenmagic", "presets", content); + log("import -> preset library replaced"); + log(i18n("TMFX.preset.import.success")); + return true; + } + + var pst = game.settings.get("tokenmagic", "presets"); + var it = 0; + for (const element of content) { + const preset = pst.find(el => el.name === element.name); + if (preset == null) { + log("import -> add: " + element.name); + pst.push(element); + it++; + } else { + if (options.hasOwnProperty("overwrite") + && options.overwrite) { + const index = pst.indexOf(preset); + if (index > -1) { + log("import -> overwrite: " + element.name); + pst[index] = element; + it++; + } + } else { + warn("import -> ignored: " + element.name + " -> already exists"); + } + } + } + + await game.settings.set("tokenmagic", "presets", pst); + log("import -> " + it + " preset(s) added to the library"); + log(i18n("TMFX.preset.import.success")); + return true; + } + + async function resetPresetLibrary() { + if (!game.user.isGM) return; + + if (confirm(i18n("TMFX.preset.reset.message"))) { + try { + await game.settings.set("tokenmagic", "presets", defaultPresets); + ui.notifications.info(i18n("TMFX.preset.reset.success")); + } catch (e) { + error(e.message); + } + } + } + + async function importPresetLibraryFromURL(url) { + try { + $.getJSON(url, async function (content) { + return await _importContent(content); + }); + } catch (e) { + error(e.message); + error(i18n("TMFX.preset.import.failure")); + return false; + } + } + + async function importPresetLibraryFromPath(path) { + try { + const response = await fetch(path); + const content = await response.json(); + + return await _importContent(content); + + } catch (e) { + error(e.message); + error(i18n("TMFX.preset.import.failure")); + return false; + } + }; + + async function importPresetLibrary() { + const path = '/modules/tokenmagic/import'; + new FilePicker({ + type: "json", + current: path, + callback: importPresetLibraryFromPath, + }).browse(); + } + + function exportPresetLibrary(exportName = "token-magic-fx-presets") { + var pst = game.settings.get("tokenmagic", "presets"); + if (pst == null || typeof pst !== "object") return false; + exportObjectAsJson(pst, exportName); + } + + function getPreset(presetName) { + var pst = game.settings.get("tokenmagic", "presets"); + if (pst == null || typeof pst !== "object") return undefined; + + const preset = pst.find(el => el['name'] === presetName); + if (!(preset == null) + && preset.hasOwnProperty("params") + && preset.params instanceof Array) return preset.params; + return undefined; + }; + + async function deletePreset(presetName, silent = false) { + if (!game.user.isGM) { + if (!silent) ui.notifications.warn(i18n("TMFX.preset.delete.permission.failure")); + return false; + } + + if (typeof presetName !== "string") { + if (!silent) ui.notifications.error(i18n("TMFX.preset.delete.params.failure")); + return false; + } + + var pst = game.settings.get("tokenmagic", "presets"); + if (pst == null) { + if (!silent) ui.notifications.warn(i18n("TMFX.preset.delete.empty.failure")); + return false; + } + + var state = true; + const preset = pst.find(el => el['name'] === presetName); + + if (preset == null) { + if (!silent) ui.notifications.warn(i18n("TMFX.preset.delete.notfound.failure")); + state = false; + } else { + const index = pst.indexOf(preset); + if (index > -1) { + pst.splice(index, 1); + try { + await game.settings.set("tokenmagic", "presets", pst); + if (!silent) ui.notifications.info(i18n("TMFX.preset.delete.success")); + } catch (e) { + if (!silent) ui.notifications.error(e.message); + console.error(e); + state = false; + } + } + } + return state; + } + + async function addPreset(presetName, params, silent = false) { + if (!game.user.isGM) { + if (!silent) ui.notifications.warn(i18n("TMFX.preset.add.permission.failure")); + return false; + } + + if (typeof presetName !== "string" + && !(params instanceof Array)) { + if (!silent) ui.notifications.error(i18n("TMFX.preset.add.params.failure")); + return false; + } + + for (const param of params) { + param.filterId = presetName; + } + + var pst = game.settings.get("tokenmagic", "presets"); + var presetObject = {}; + presetObject.name = presetName; + presetObject.params = params; + + var state = true; + if (pst == null) { + pst = [presetObject]; + } else { + const preset = pst.find(el => el['name'] === presetName); + if (preset == null) pst.push(presetObject); + else { + if (!silent) ui.notifications.warn(i18n("TMFX.preset.add.duplicate.failure")); + state = false; + } + } + + if (state) { + try { + await game.settings.set("tokenmagic", "presets", pst); + if (!silent) ui.notifications.info(i18n("TMFX.preset.add.success")); + } catch (e) { + if (!silent) ui.notifications.error(e.message); + console.error(e); + state = false; + } + } + return state; + }; + return { addFilter: addFilter, addFilters: addFilters, addFilterOnSelected: addFilterOnSelected, addFiltersOnSelected: addFiltersOnSelected, addFiltersOnTargeted: addFiltersOnTargeted, + addUpdateFiltersOnSelected: addUpdateFiltersOnSelected, + addUpdateFilterOnSelected: addUpdateFilterOnSelected, addUpdateFilters: addUpdateFilters, addUpdateFilter: addUpdateFilter, deleteFilters: deleteFilters, @@ -649,6 +1023,14 @@ export function TokenMagic() { updateFilterByPlaceable: updateFilterByPlaceable, hasFilterType: hasFilterType, hasFilterId: hasFilterId, + exportPresetLibrary: exportPresetLibrary, + importPresetLibrary: importPresetLibrary, + importPresetLibraryFromURL: importPresetLibraryFromURL, + importPresetLibraryFromPath: importPresetLibraryFromPath, + resetPresetLibrary: resetPresetLibrary, + getPreset: getPreset, + addPreset: addPreset, + deletePreset: deletePreset, _assignFilters: _assignFilters, _loadFilters: _loadFilters, _clearImgFiltersByPlaceable: _clearImgFiltersByPlaceable, @@ -660,12 +1042,70 @@ export function TokenMagic() { export const Magic = TokenMagic(); +function initSocketListener() { + + // Activate the listener only for the One + const theOne = game.users.find((user) => user.isGM && user.active); + if (theOne && game.user !== theOne) { + return; + } + + // Listener the listening + game.socket.on(moduleTM, async (data) => { + + if (data == null || !data.hasOwnProperty("tmAction")) { return; } + + switch (data.tmAction) { + case SocketAction.SET_FLAG: + // getting the scene coming from the socket + var scene = game.scenes.get(data.tmViewedScene); + if (scene == null) return; + + // preparing flag data (with -= if the data is null) + var updateData; + if (data.tmFlag == null) updateData = { [`flags.tokenmagic.-=filters`]: null } + else updateData = { [`flags.tokenmagic.filters`]: data.tmFlag }; + updateData["_id"] = data.tmPlaceableId; + + // updating the placeable in the scene + await scene.updateEmbeddedEntity(data.tmPlaceableType, updateData); + break; + } + }); +}; + +async function requestLoadFilters(placeable, startTimeout = 0) { + var reqTimer; + + function launchRequest(placeable) { + reqTimer = setTimeout(() => { + if (placeable == null) return; + var check = placeable._TMFXcheckSprite(); + if (check == null) return; + else if (check) Magic._singleLoadFilters(placeable); + else launchRequest(placeable); + }, 35); + } + + function setRequestTimeOut() { + setTimeout(() => { + clearTimeout(reqTimer); + }, 2000); + } + + setTimeout(() => { + setRequestTimeOut(); + launchRequest(placeable); + }, startTimeout); +}; + Hooks.once("init", () => { registerSettings(); }); Hooks.on("ready", () => { log("Hook -> ready"); + initSocketListener(); window.TokenMagic = Magic; }); @@ -676,6 +1116,11 @@ Hooks.on("canvasInit", (canvas) => { Anime.resetAnimation(); }); +Hooks.once("canvasReady", (canvas) => { + log("Init -> canvasReady -> caching shaders"); + cacheFilters(); +}); + Hooks.on("canvasReady", (canvas) => { log("Hook -> canvasReady"); @@ -717,22 +1162,23 @@ Hooks.on("createToken", (scene, data, options) => { && data.flags.hasOwnProperty("tokenmagic") && data.flags.tokenmagic.hasOwnProperty("filters")) { - var placeable = getPlaceableById(data._id, "Token"); + var placeable = getPlaceableById(data._id, PlaceableType.TOKEN); - (async () => { - await sleep(100); - Magic._singleLoadFilters(placeable); - })(); + // request to load filters (when pixi containers are ready) + requestLoadFilters(placeable, 250); } }); Hooks.on("updateToken", (scene, data, options) => { log("Hook -> updateToken"); + if (scene.id !== game.user.viewedScene) return; + if (options.hasOwnProperty("img") || options.hasOwnProperty("tint") - || options.hasOwnProperty("height") || options.hasOwnProperty("width") ) { + || options.hasOwnProperty("height") || options.hasOwnProperty("width") + || options.hasOwnProperty("name")) { - var placeable = getPlaceableById(data._id, "Token"); + var placeable = getPlaceableById(data._id, PlaceableType.TOKEN); // removing animations on this placeable Anime.removeAnimation(data._id); @@ -740,13 +1186,11 @@ Hooks.on("updateToken", (scene, data, options) => { // clearing the filters (owned by tokenmagic) Magic._clearImgFiltersByPlaceable(placeable); - (async () => { - await sleep(100); - Magic._singleLoadFilters(placeable); - })(); + // querying filters reload (when pixi containers are ready) + requestLoadFilters(placeable, 250); } else { - Magic._updateFilters(data, options, "Token"); + Magic._updateFilters(data, options, PlaceableType.TOKEN); } }); @@ -760,23 +1204,23 @@ Hooks.on("deleteTile", (parent, doc, options, userId) => { Hooks.on("updateTile", (scene, data, options) => { log("Hook -> updateTile"); + if (scene.id !== game.user.viewedScene) return; + if (options.hasOwnProperty("img") || options.hasOwnProperty("tint")) { - var placeable = getPlaceableById(data._id, "Tile"); + var placeable = getPlaceableById(data._id, PlaceableType.TILE); // removing animations on this placeable Anime.removeAnimation(data._id); - (async () => { - await sleep(100); - Magic._singleLoadFilters(placeable); - })(); + // querying filters reload (when pixi containers are ready) + requestLoadFilters(placeable, 250); } else { - Magic._updateFilters(data, options, "Tile"); + Magic._updateFilters(data, options, PlaceableType.TILE); } }); Hooks.on("closeSettingsConfig", () => { autosetPaddingMode(); -}); +}); \ No newline at end of file diff --git a/tokenmagic/packs/token-magic-portfolio.db b/tokenmagic/packs/token-magic-portfolio.db index 32f53e9..3f4069c 100644 --- a/tokenmagic/packs/token-magic-portfolio.db +++ b/tokenmagic/packs/token-magic-portfolio.db @@ -1,46 +1,68 @@ -{"name":"24 - T12 - Warp Time Aura","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 12,\r\n gridPadding: 2,\r\n color: 0xAAAAAA,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1.1,\r\n lightAlpha: 0.5,\r\n lightSize: 0.3,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0009, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[],"_id":"2IOkNL2J1jETUvSP"} -{"_id":"2zRNjnw7Ps26h5xz","name":"22 - Smoke","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"smoke\",\r\n color: 0x00FF00,\r\n time: 0,\r\n blend: 0,\r\n dimX: 1,\r\n dimY: 1,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: -0.006, \r\n animType: \"move\"\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"359Mw23cvaEDevkP","name":"24 - T04 - Earth Shell","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 4,\r\n gridPadding: 2,\r\n color: 0x755050,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1,\r\n lightAlpha: 1,\r\n lightSize: 0.7,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"37aHASDQzFvbqmJG","name":"15 - Cosmic Ray","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"ray\",\r\n time: 0,\r\n color: 0xCF8000,\r\n alpha: 0.5,\r\n divisor: 32,\r\n anchorX: 0,\r\n anchorY: 0,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0005, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"name":"24 - T10 - Evil Aura","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 10,\r\n gridPadding: 1,\r\n color: 0x902005,\r\n time: 0,\r\n blend: 5,\r\n intensity: 1,\r\n lightAlpha: 4,\r\n lightSize: 0.8,\r\n scale: 0.5,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[],"_id":"4Ywsytul1no7EwKb"} -{"_id":"6Do4AOxfbtCG8R4j","name":"24 - T06 - Air Bubble","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 6,\r\n gridPadding: 1,\r\n color: 0x306090,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1.3,\r\n lightAlpha: 1,\r\n lightSize: 0.7,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"6ZIpqLC3agLw2Vgx","name":"24 - T07 - Mage Armor","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 7,\r\n gridPadding: 1,\r\n color: 0x777777,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1,\r\n lightAlpha: 1,\r\n lightSize: 0.7,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"AHoBr50LyDjnphDw","name":"07 - Distortion","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// you can change the mask of the filter\r\n// the mask must have a power of 2 h and w (512x512, 128x128, ...) \r\n// the distortion applies on black and white and shades of grey\r\n// after testing the first version of this macro try this :\r\n// -> maskPath: \"/modules/tokenmagic/fx/assets/waves-2.png\"\r\n\r\nlet params =\r\n{\r\n filterType: \"distortion\",\r\n maskPath: \"/modules/tokenmagic/fx/assets/distortion-1.png\",\r\n maskSpriteScaleX: 5,\r\n maskSpriteScaleY: 5,\r\n padding: 20,\r\n animated:\r\n {\r\n maskSpriteX: { active: true, speed: 0.05, animType: \"move\" },\r\n maskSpriteY: { active: true, speed: 0.07, animType: \"move\" }\r\n }\r\n};\r\n\r\nTokenMagic.addFilterOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"2IOkNL2J1jETUvSP","name":"24 - T12 - Warp Time Aura","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"myWarpField\",\r\n shieldType: 12,\r\n gridPadding: 2,\r\n color: 0xFFFFFF,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1,\r\n lightAlpha: 0.8,\r\n lightSize: 0.5,\r\n scale: 0.9,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0009, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"2zRNjnw7Ps26h5xz","name":"22 - Smoke","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"smoke\",\r\n filterId: \"mySmoke\",\r\n color: 0x50FFAA,\r\n time: 0,\r\n blend: 2,\r\n dimX: 1,\r\n dimY: 1,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\"\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"359Mw23cvaEDevkP","name":"24 - T04 - Earth Shell","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"myEarthField\",\r\n shieldType: 4,\r\n gridPadding: 2,\r\n color: 0xBB9070,\r\n time: 0,\r\n blend: 1,\r\n intensity: 1.25,\r\n lightAlpha: 1,\r\n lightSize: 0.7,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"37aHASDQzFvbqmJG","name":"15 - Cosmic Ray","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"ray\",\r\n filterId : \"myRay\",\r\n time: 0,\r\n color: 0xCF8000,\r\n alpha: 0.5,\r\n divisor: 32,\r\n anchorX: 0,\r\n anchorY: 0,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0005, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"4Ywsytul1no7EwKb","name":"24 - T10 - Evil Aura","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"myEvilField\",\r\n shieldType: 9,\r\n gridPadding: 1,\r\n color: 0xFF3010,\r\n time: 0,\r\n blend: 5,\r\n intensity: 1,\r\n lightAlpha: 4,\r\n lightSize: 0.8,\r\n scale: 0.5,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0012, \r\n animType: \"move\" \r\n },\r\n lightSize: \r\n {\r\n val1: 0.4, val2: 1.5,\r\n animType: \"syncCosOscillation\",\r\n loopDuration: 5000\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"6Do4AOxfbtCG8R4j","name":"24 - T06 - Air Bubble","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"myAirField\",\r\n shieldType: 6,\r\n gridPadding: 1.2,\r\n color: 0x7090AA,\r\n time: 0,\r\n blend: 14,\r\n intensity: 1,\r\n lightAlpha: 1,\r\n lightSize: 0.7,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"6ZIpqLC3agLw2Vgx","name":"24 - T07 - Mage Armor","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"myMageField\",\r\n shieldType: 7,\r\n gridPadding: 1.05,\r\n color: 0xFFFFFF,\r\n time: 0,\r\n blend: 10,\r\n intensity: 0.8,\r\n lightAlpha: 1,\r\n lightSize: 0.45,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"8nsxKDYhS1Wcc139","name":"26 - T02 - Mantle of Madness (liquid)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"liquid\",\r\n filterId: \"myMantle\",\r\n color: 0x0090FF,\r\n time: 0,\r\n blend: 5,\r\n intensity: 0.0001,\r\n spectral: false,\r\n scale: 7,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n },\r\n intensity : \r\n { \r\n active: true, \r\n animType: \"syncCosOscillation\",\r\n loopDuration: 30000,\r\n val1: 0.0001, \r\n val2: 4 \r\n },\r\n scale: \r\n { \r\n active: true, \r\n animType: \"syncCosOscillation\",\r\n loopDuration: 30000,\r\n val1: 7, \r\n val2: 1 \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"AHoBr50LyDjnphDw","name":"07 - Distortion","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// you can change the mask of the filter\r\n// the mask must have a power of 2 h and w (512x512, 128x128, ...) \r\n// the distortion applies on black and white and shades of grey\r\n// after testing the first version of this macro try this :\r\n// -> maskPath: \"/modules/tokenmagic/fx/assets/waves-2.png\"\r\n\r\nlet params =\r\n{\r\n filterType: \"distortion\",\r\n filterId: \"myDistortion\",\r\n maskPath: \"/modules/tokenmagic/fx/assets/distortion-1.png\",\r\n maskSpriteScaleX: 5,\r\n maskSpriteScaleY: 5,\r\n padding: 20,\r\n animated:\r\n {\r\n maskSpriteX: { active: true, speed: 0.05, animType: \"move\" },\r\n maskSpriteY: { active: true, speed: 0.07, animType: \"move\" }\r\n }\r\n};\r\n\r\nTokenMagic.addUpdateFilterOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} {"_id":"As1JrHLEm38Nm667","name":"F - 01 - Delete filters by Placeable","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// Delete all filters on the placeable in parameter (token or tile)\r\nTokenMagic.deleteFilters(_token);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"BGz9j7xPy0H2QlBf","name":"E - Click, click, click and click !","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let glowFunc = async function() {\r\n\r\n const tokens = canvas.tokens.placeables;\r\n\r\n for (const token of tokens){\r\n if (token.TMFXhasFilterId(\"funnyAlternateGlow\")) {\r\n await token.TMFXdeleteFilters(\"funnyAlternateGlow\");\r\n } else {\r\n let params =\r\n [{\r\n filterType: \"glow\",\r\n filterId: \"funnyAlternateGlow\",\r\n color: Math.floor(Math.random() * 16777215),\r\n animated: null\r\n }];\r\n await token.TMFXaddUpdateFilters(params);\r\n }\r\n }\r\n};\r\n\r\nglowFunc();","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"CdFhWPKBMb5wj7cM","name":"11 - Blur","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"blur\",\r\n padding: 10,\r\n quality: 4.0,\r\n blur: 0,\r\n blurX: 0,\r\n blurY: 0,\r\n animated:\r\n {\r\n blurX: \r\n { \r\n active: true, \r\n animType: \"syncCosOscillation\", \r\n loopDuration: 500, \r\n val1: 0, \r\n val2: 6\r\n },\r\n blurY: \r\n { \r\n active: true, \r\n animType: \"syncCosOscillation\", \r\n loopDuration: 750, \r\n val1: 0, \r\n val2: 6}\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"BGz9j7xPy0H2QlBf","name":"E - Click, click, click and click !","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let glowFunc = async function() {\r\n\r\n const myTokens = canvas.tokens.placeables;\r\n\r\n for (const myToken of myTokens ){\r\n if (myToken.TMFXhasFilterId(\"funnyAlternateGlow\")) {\r\n await myToken.TMFXdeleteFilters(\"funnyAlternateGlow\");\r\n } else {\r\n let params =\r\n [{\r\n filterType: \"glow\",\r\n filterId: \"funnyAlternateGlow\",\r\n color: Math.floor(Math.random() * 16777215),\r\n animated: null\r\n }];\r\n await myToken.TMFXaddUpdateFilters(params);\r\n }\r\n }\r\n};\r\n\r\nglowFunc();","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"CdFhWPKBMb5wj7cM","name":"11 - Blur","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"blur\",\r\n filterId: \"myBlur\",\r\n padding: 10,\r\n quality: 4.0,\r\n blur: 0,\r\n blurX: 0,\r\n blurY: 0,\r\n animated:\r\n {\r\n blurX: \r\n { \r\n active: true, \r\n animType: \"syncCosOscillation\", \r\n loopDuration: 500, \r\n val1: 0, \r\n val2: 6\r\n },\r\n blurY: \r\n { \r\n active: true, \r\n animType: \"syncCosOscillation\", \r\n loopDuration: 750, \r\n val1: 0, \r\n val2: 6}\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} {"_id":"DCRnfJDBd25fOQxc","name":"F - 02 - Delete filters on Selected","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// Delete all filters on the selected tokens/tiles\r\nTokenMagic.deleteFiltersOnSelected();","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"DoXvYWKPRcTpHbPG","name":"20 - Waves","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// Below, you can turn on the anchor animation.\r\nlet params =\r\n[{\r\n filterType: \"wave\",\r\n time: 0,\r\n anchorX: 0.5,\r\n anchorY: 0.5,\r\n strength: 0.015,\r\n frequency: 60,\r\n color: 0xFFFFFF,\r\n maxIntensity: 3.0,\r\n minIntensity: 0.8,\r\n padding:10,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0085, \r\n animType: \"move\" \r\n },\r\n anchorX :\r\n {\r\n active: false,\r\n val1: 0.15,\r\n val2: 0.85,\r\n animType: \"syncCosOscillation\",\r\n loopDuration: 20000\r\n },\r\n anchorY :\r\n {\r\n active: false,\r\n val1: 0.15,\r\n val2: 0.85,\r\n animType: \"syncSinOscillation\",\r\n loopDuration: 20000\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"Edw0KaZiBtWEG86g","name":"16 - Inner Fog","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"fog\",\r\n color: 0xFFFFFF,\r\n density: 0.45,\r\n time: 0,\r\n dimX: 1,\r\n dimY: 1,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 1.2, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"F47j6ivhmXxeYVmY","name":"19 - Fire","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"fire\",\r\n intensity: 1,\r\n color: 0xFFFFFF,\r\n amplitude: 1,\r\n time: 0,\r\n blend: 2,\r\n fireBlend : 1,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: -0.0019, \r\n animType: \"move\" \r\n },\r\n intensity:\r\n {\r\n active:true,\r\n loopDuration: 15485,\r\n val1: 1,\r\n val2: 2,\r\n animType: \"syncCosOscillation\"\r\n },\r\n amplitude:\r\n {\r\n active:true,\r\n loopDuration: 4567,\r\n val1: 1,\r\n val2: 2,\r\n animType: \"syncCosOscillation\"\r\n }\r\n \r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"FBQzhLveCvFKOvJ7","name":"10 - BulgePinch","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"bulgepinch\",\r\n padding: 150,\r\n strength: 0,\r\n zIndex: 2,\r\n radiusPercent: 200,\r\n animated:\r\n {\r\n strength: \r\n { \r\n active: true, \r\n animType: \"cosOscillation\", \r\n loopDuration: 2000, \r\n val1: 0, \r\n val2: 0.8\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"GHbWoqQWjeUjcStr","name":"24 - T13 - Simple Color","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 13,\r\n gridPadding: 2,\r\n color: 0x006030,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1,\r\n lightAlpha: 0,\r\n lightSize: 0,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0009, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"GvYp56Thtf3n9RYy","name":"01 - Bevel","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params = \r\n[{\r\n filterType: \"bevel\",\r\n rotation: 0,\r\n thickness: 4,\r\n lightColor: 0x00FF00,\r\n lightAlpha: 0.7,\r\n shadowColor: 0xFF0000,\r\n shadowAlpha: 0.4,\r\n animated :\r\n {\r\n rotation: \r\n { \r\n active: true,\r\n clockWise: true, \r\n loopDuration: 500, \r\n animType: \"syncRotation\"\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);\r\n","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"H3rF4XGEf76ZylwP","name":"14 - Remove Shadow","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// this simple filter remove pixels with a certain amount of alpha\r\n// it can be useful to remove shadows before using glow or outline filters.\r\n\r\nlet params =\r\n[{\r\n filterType: \"zapshadow\",\r\n alphaTolerance: 0.60\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"DoXvYWKPRcTpHbPG","name":"20 - Waves","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// Below, you can turn on the anchor animation.\r\nlet params =\r\n[{\r\n filterType: \"wave\",\r\n filterId: \"myWaves\",\r\n time: 0,\r\n anchorX: 0.5,\r\n anchorY: 0.5,\r\n strength: 0.015,\r\n frequency: 120,\r\n color: 0xFFFFFF,\r\n maxIntensity: 2.5,\r\n minIntensity: 0.9,\r\n padding:10,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0085, \r\n animType: \"move\" \r\n },\r\n anchorX :\r\n {\r\n active: false,\r\n val1: 0.15,\r\n val2: 0.85,\r\n animType: \"syncChaoticOscillation\",\r\n loopDuration: 20000\r\n },\r\n anchorY :\r\n {\r\n active: false,\r\n val1: 0.15,\r\n val2: 0.85,\r\n animType: \"syncSinOscillation\",\r\n loopDuration: 20000\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"Edw0KaZiBtWEG86g","name":"16 - Inner Fog","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"fog\",\r\n filterId: \"myFog\",\r\n color: 0x000000,\r\n density: 0.65,\r\n time: 0,\r\n dimX: 1,\r\n dimY: 1,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 2.2, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"F47j6ivhmXxeYVmY","name":"19 - Fire","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"fire\",\r\n filterId: \"myFire\",\r\n intensity: 1,\r\n color: 0xFFFFFF,\r\n amplitude: 1,\r\n time: 0,\r\n blend: 2,\r\n fireBlend : 1,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: -0.0024, \r\n animType: \"move\" \r\n },\r\n intensity:\r\n {\r\n active:true,\r\n loopDuration: 15000,\r\n val1: 0.8,\r\n val2: 2,\r\n animType: \"syncCosOscillation\"\r\n },\r\n amplitude:\r\n {\r\n active:true,\r\n loopDuration: 4400,\r\n val1: 1,\r\n val2: 1.4,\r\n animType: \"syncCosOscillation\"\r\n }\r\n \r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"FBQzhLveCvFKOvJ7","name":"10 - BulgePinch","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"bulgepinch\",\r\n filterId: \"myBulge\",\r\n padding: 150,\r\n strength: 0,\r\n zIndex: 2,\r\n radiusPercent: 200,\r\n animated:\r\n {\r\n strength: \r\n { \r\n active: true, \r\n animType: \"cosOscillation\", \r\n loopDuration: 2000, \r\n val1: 0, \r\n val2: 0.45\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"GHbWoqQWjeUjcStr","name":"24 - T13 - Simple Color","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"mySimpleField\",\r\n shieldType: 13,\r\n gridPadding: 2,\r\n color: 0x00CC00,\r\n time: 0,\r\n blend: 14,\r\n intensity: 1,\r\n lightAlpha: 0,\r\n lightSize: 0,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0009, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"GvYp56Thtf3n9RYy","name":"01 - Bevel","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params = \r\n[{\r\n filterType: \"bevel\",\r\n filterId: \"myBevel\",\r\n rotation: 0,\r\n thickness: 5,\r\n lightColor: 0xFF0000,\r\n lightAlpha: 0.8,\r\n shadowColor: 0x00FF00,\r\n shadowAlpha: 0.5,\r\n animated :\r\n {\r\n rotation: \r\n { \r\n active: true,\r\n clockWise: true, \r\n loopDuration: 1600, \r\n animType: \"syncRotation\"\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);\r\n","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"Gzt5MfynWLcXDTZF","name":"23 - T03 - Spectral Images","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// Another extreme example...\r\nlet params =\r\n[{\r\n filterType: \"images\",\r\n filterId: \"mySpectralImages\",\r\n time: 0, \r\n blend: 4,\r\n nbImage: 4, \r\n padding: 100,\r\n alphaImg: 0.5, \r\n alphaChr: 0.0,\r\n ampX: 0.10, \r\n ampY: 0.10,\r\n animated :\r\n {\r\n time: \r\n { \r\n speed: 0.0010, \r\n animType: \"move\" \r\n },\r\n ampX:\r\n {\r\n val1: 0, val2: 0.22,\r\n animType: \"syncCosOscillation\",\r\n loopDuration: 2500\r\n },\r\n ampY:\r\n {\r\n val1: 0, val2: 0.24,\r\n animType: \"syncCosOscillation\",\r\n loopDuration: 2500,\r\n pauseBetweenDuration: 2500\r\n },\r\n alphaChr: \r\n {\r\n val1: 1, val2: 0,\r\n animType: \"syncCosOscillation\",\r\n loopDuration: 2500\r\n },\r\n alphaImg: \r\n {\r\n val1: 0.2, val2: 0.8,\r\n animType: \"syncSinOscillation\",\r\n loopDuration: 2500\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"H3rF4XGEf76ZylwP","name":"14 - Remove Shadow","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// this simple filter remove pixels with a certain amount of alpha\r\n// it can be useful to remove shadows before using glow or outline filters.\r\n\r\nlet params =\r\n[{\r\n filterType: \"zapshadow\",\r\n filterId: \"myZap\",\r\n alphaTolerance: 0.45\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} {"_id":"HjzhkTFUng8sxWkH","name":"D - Auto-Destroy Example","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params = \r\n[{\r\n filterType: \"bevel\",\r\n autoDestroy: true,\r\n rotation: 0,\r\n thickness: 5,\r\n lightColor: 0x00FF00,\r\n lightAlpha: 0.7,\r\n shadowColor: 0xFF0000,\r\n shadowAlpha: 0.4,\r\n animated :\r\n {\r\n rotation: \r\n { \r\n active: true,\r\n clockWise: true, \r\n loopDuration: 1000,\r\n loops: 5,\r\n animType: \"rotation\"\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);\r\n","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"IA3ofbRDpi3Rjgcy","name":"24 - T02 - Fire Shield","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 1,\r\n gridPadding: 2,\r\n color: 0xD08050,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1.15,\r\n lightAlpha: 2,\r\n lightSize: 0.7,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"IA3ofbRDpi3Rjgcy","name":"24 - T02 - Fire Shield","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"myFireField\",\r\n shieldType: 1,\r\n gridPadding: 2,\r\n color: 0xE58550,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1.15,\r\n lightAlpha: 2,\r\n lightSize: 0.7,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"IEl6F5dtFcYBZDDZ","name":"25 - T01 - Sunburst Rays (xray)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"xray\",\r\n filterId: \"mySunburstRays\",\r\n time: 0,\r\n color: 0xFFBB00,\r\n blend: 9,\r\n dimX: 1,\r\n dimY: 1,\r\n anchorX: 0,\r\n anchorY: 0,\r\n divisor: 36,\r\n intensity: 4,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0012, \r\n animType: \"move\" \r\n },\r\n anchorX:\r\n {\r\n animType: \"syncCosOscillation\",\r\n loopDuration : 6000,\r\n val1: 0.40,\r\n val2: 0.60\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} {"_id":"Ia0tPcllVQq96yXF","name":"C - Electric Multi-Filters","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// works better with tokens or tiles with no shadows\r\nlet params =\r\n[{\r\n filterType: \"shadow\",\r\n blur: 2,\r\n quality: 5,\r\n distance: 0,\r\n alpha: 1.,\r\n padding: 100,\r\n color: 0xFFFFFF,\r\n animated:\r\n {\r\n blur: \r\n { \r\n active: true, \r\n loopDuration: 500, \r\n animType: \"syncCosOscillation\", \r\n val1: 2, \r\n val2: 4\r\n },\r\n }\r\n},\r\n{\r\n filterType: \"electric\",\r\n color: 0xFFFFFF,\r\n time: 0,\r\n blend: 2,\r\n intensity: 5,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0020, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"LrfXNjrImAWK5Hb2","name":"24 - T05 - Mega Earth Shell (on top)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 5,\r\n gridPadding: 3,\r\n color: 0x905555,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1.2,\r\n lightAlpha: 1,\r\n lightSize: 0.7,\r\n scale: 1,\r\n radius: 1,\r\n zIndex: 5,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"OWgJD9lvBlDzXALz","name":"09 - Twist","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"twist\",\r\n radiusPercent: 120,\r\n angle: 0,\r\n animated:\r\n {\r\n angle: \r\n { \r\n active: true, \r\n animType: \"sinOscillation\",\r\n loopDuration: 10000, \r\n val1: -0.6*Math.PI, \r\n val2: +0.6*Math.PI\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"SSY0fjib0PgJaKEK","name":"24 - T03 - Poisoned Smoke","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 3,\r\n gridPadding: 1,\r\n color: 0x106040,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1,\r\n lightAlpha: 1,\r\n lightSize: 0.7,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"VWTz2fKfSb6WK7Mo","name":"02 - Adjustment","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"adjustment\",\r\n saturation: 1,\r\n brightness: 1,\r\n contrast: 1,\r\n gamma: 1,\r\n red: 4,\r\n green: 0.5,\r\n blue: 0.5,\r\n alpha: 0.5,\r\n animated:\r\n {\r\n alpha: \r\n { \r\n active: true, \r\n loopDuration: 5000, \r\n animType: \"syncCosOscillation\",\r\n val1: 0.5,\r\n val2: 1 }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"VuMHH9LMD51MNJzZ","name":"24 - T11 - Grid Force Field","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 11,\r\n gridPadding: 2,\r\n color: 0x009090,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1,\r\n lightAlpha: 1,\r\n lightSize: 0.3,\r\n scale: 0.5,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0009, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"YJjeB7N0L1rGfZD2","name":"18 - Electric","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"electric\",\r\n color: 0xFFFFFF,\r\n time: 0,\r\n blend: 1,\r\n intensity: 5,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0020, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"aoqr6qPxif62zWLo","name":"24 - T09 - Water Defense","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 9,\r\n gridPadding: 1,\r\n color: 0x1090CC,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1,\r\n lightAlpha: 1,\r\n lightSize: 0.7,\r\n scale: 2,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"b5Enw7tEwfjDNHuY","name":"04 - Outline","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{"combat-utility-belt":{"macroTrigger":""}},"scope":"global","command":"let params = \r\n[{\r\n filterType: \"outline\",\r\n padding: 10,\r\n color: 0x05B0B0,\r\n thickness: 1,\r\n quality: 10,\r\n animated :\r\n {\r\n thickness: \r\n { \r\n active: true,\r\n loopDuration: 1000,\r\n animType: \"syncCosOscillation\",\r\n val1: 1, \r\n val2: 8\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"cCEOQFsJvjhSTbbM","name":"06 - Bloom","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params = \r\n[{\r\n filterType: \"xbloom\",\r\n threshold: 0.35,\r\n bloomScale: 0,\r\n brightness: 1.2,\r\n blur: 0.1,\r\n padding: 10,\r\n quality: 15,\r\n blendMode: 0,\r\n animated:\r\n {\r\n bloomScale: \r\n { \r\n active: true, \r\n loopDuration: 2000, \r\n animType: \"syncCosOscillation\", \r\n val1: 0, \r\n val2: 2\r\n },\r\n threshold: \r\n { \r\n active: false, \r\n loopDuration: 2000, \r\n animType: \"syncCosOscillation\", \r\n val1: 0.05, \r\n val2: 1.9\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);\r\n","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"cOaB7NxSQ5jNDd5g","name":"27 - T01 - Burning Aura (xglow)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"zapshadow\",\r\n filterId: \"myZapShadow\",\r\n alphaTolerance: 0.50\r\n},\r\n{\r\n filterType: \"xglow\",\r\n filterId: \"myMagicGlow\",\r\n auraType: 2,\r\n color: 0x903010,\r\n thickness: 4.8,\r\n scale: 4.,\r\n time: 0,\r\n auraIntensity: 2,\r\n subAuraIntensity: 1.5,\r\n threshold: 0.40,\r\n discard: true,\r\n animated:\r\n {\r\n time : \r\n { \r\n active: true,\r\n speed: 0.0027, \r\n animType: \"move\" \r\n },\r\n thickness:\r\n {\r\n active: true,\r\n loopDuration: 3000, \r\n animType: \"cosOscillation\", \r\n val1:4.5, \r\n val2:6\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"Ku4jBl972O7hHczs","name":"F - 03 - Export FX Presets","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"TokenMagic.exportPresetLibrary();","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"LrfXNjrImAWK5Hb2","name":"24 - T05 - Mega Chroma Shell (on top)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"myEarthFieldTop\",\r\n shieldType: 5,\r\n gridPadding: 3,\r\n color: 0xAAAAAA,\r\n time: 0,\r\n blend: 5,\r\n intensity: 1.9,\r\n lightAlpha: 1,\r\n lightSize: 0.7,\r\n scale: 1,\r\n radius: 1,\r\n zIndex: 5,\r\n chromatic: true,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"OWgJD9lvBlDzXALz","name":"09 - Twist","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"twist\",\r\n filterId: \"myTwist\",\r\n radiusPercent: 120,\r\n angle: 0,\r\n animated:\r\n {\r\n angle: \r\n { \r\n active: true, \r\n animType: \"sinOscillation\",\r\n loopDuration: 10000, \r\n val1: -0.6*Math.PI, \r\n val2: +0.6*Math.PI\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"QzFJd7hkaYesE7Ud","name":"F - 04 - Import FX Presets (local)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// Open the console (F12) to check the state of the import\r\n// You can configure in the module option panel the \"overwrite mode on import\"\r\n\r\nTokenMagic.importPresetLibrary();","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"SSY0fjib0PgJaKEK","name":"24 - T03 - Poisoned Smoke","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"mySmokeField\",\r\n shieldType: 3,\r\n gridPadding: 10,\r\n color: 0x60CC70,\r\n time: 0,\r\n blend: 2,\r\n intensity: 0.9,\r\n lightAlpha: 1,\r\n lightSize: 0.7,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"SpHEaIwubKpbwzvV","name":"25 - T04 - Blue Rays ! (xray)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"xray\",\r\n filterId: \"myBlueRay\",\r\n time: 0,\r\n color: 0x1030FF,\r\n blend: 9,\r\n dimX: 1,\r\n dimY: 1,\r\n anchorX: 0,\r\n anchorY: 0,\r\n divisor: 24,\r\n intensity: 1,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0002, \r\n animType: \"move\" \r\n },\r\n anchorX:\r\n {\r\n animType: \"syncCosOscillation\",\r\n loopDuration : 18000,\r\n val1: 0.05,\r\n val2: 0.95\r\n },\r\n anchorY:\r\n {\r\n animType: \"syncSinOscillation\",\r\n loopDuration : 18000,\r\n val1: 0.05,\r\n val2: 0.95\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"SpvVIO1eHYG96TGX","name":"26 - T01 - Spectral Body (liquid)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"liquid\",\r\n filterId: \"mySpectralBody\",\r\n color: 0x20AAEE,\r\n time: 0,\r\n blend: 8,\r\n intensity: 4,\r\n spectral: true,\r\n scale: 0.9,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0010, \r\n animType: \"move\" \r\n },\r\n color: \r\n {\r\n active: true, \r\n loopDuration: 6000, \r\n animType: \"colorOscillation\", \r\n val1:0xFFFFFF, \r\n val2:0x00AAFF\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"T953GJB235BbrCll","name":"26 - T03 - Drift in Plans (liquid+waves)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"wave\",\r\n filterId: \"myDriftWaves\",\r\n time: 0,\r\n anchorX: 0.5,\r\n anchorY: 0.5,\r\n strength: 0.035,\r\n frequency: 20,\r\n color: 0xFFFFFF,\r\n maxIntensity: 1.5,\r\n minIntensity: 0.5,\r\n padding:10,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0085, \r\n animType: \"move\" \r\n },\r\n anchorX :\r\n {\r\n active: true,\r\n val1: 0.35,\r\n val2: 0.65,\r\n animType: \"syncCosOscillation\",\r\n loopDuration: 10000\r\n },\r\n anchorY :\r\n {\r\n active: true,\r\n val1: 0.35,\r\n val2: 0.65,\r\n animType: \"syncSinOscillation\",\r\n loopDuration: 10000\r\n }\r\n }\r\n},\r\n{\r\n filterType: \"liquid\",\r\n filterId: \"myDriftLiquid\",\r\n color: 0xFF0000,\r\n time: 0,\r\n blend: 6,\r\n intensity: 5,\r\n spectral: false,\r\n scale: 2.5,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0018, \r\n animType: \"move\" \r\n },\r\n color: \r\n {\r\n active: true, \r\n loopDuration: 9000, \r\n animType: \"colorOscillation\", \r\n val1:0xFF0000, \r\n val2:0xFFFFFF\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"VWTz2fKfSb6WK7Mo","name":"02 - Adjustment","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"adjustment\",\r\n filterId: \"myAdjust\",\r\n saturation: 1.5,\r\n brightness: 1.5,\r\n contrast: 2,\r\n gamma: 2,\r\n red: 4,\r\n green: 0.25,\r\n blue: 0.25,\r\n alpha: 1,\r\n animated:\r\n {\r\n alpha: \r\n { \r\n active: true, \r\n loopDuration: 5000, \r\n animType: \"syncCosOscillation\",\r\n val1: 0.15,\r\n val2: 1 }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"VuMHH9LMD51MNJzZ","name":"24 - T11 - Grid Force Field","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"myGridField\",\r\n shieldType: 11,\r\n gridPadding: 2,\r\n color: 0x00CCCC,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1,\r\n lightAlpha: 1,\r\n lightSize: 0.3,\r\n scale: 0.5,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0009, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"YJjeB7N0L1rGfZD2","name":"18 - Electric","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// Because the shader is dynamically compiled,\r\n// intensity is a one time init and can't be updated.\r\n// you must delete the filters to \"change\" it.\r\nlet params =\r\n[{\r\n filterType: \"electric\",\r\n filterId: \"myElectric\",\r\n color: 0xFFFFFF,\r\n time: 0,\r\n blend: 1,\r\n intensity: 5,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0020, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"YPOoPH63FqcEoVTk","name":"25 - T02 - Lucky Clover (xray)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"xray\",\r\n filterId: \"myLuckyRays\",\r\n time: 0,\r\n color: 0x00FF00,\r\n blend: 9,\r\n dimX: 0.05,\r\n dimY: 0.05,\r\n anchorX: 0.5,\r\n anchorY: 0.5,\r\n divisor: 4,\r\n intensity: 1,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0012, \r\n animType: \"move\" \r\n },\r\n anchorX:\r\n {\r\n animType: \"syncCosOscillation\",\r\n loopDuration : 6000,\r\n val1: 0.40,\r\n val2: 0.60\r\n },\r\n anchorY:\r\n {\r\n animType: \"syncSinOscillation\",\r\n loopDuration : 6000,\r\n val1: 0.40,\r\n val2: 0.60\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"aoqr6qPxif62zWLo","name":"24 - T09 - Water Defense","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"myWaterField\",\r\n shieldType: 9,\r\n gridPadding: 1.2,\r\n color: 0x20BBEE,\r\n time: 0,\r\n blend: 4,\r\n intensity: 1,\r\n lightAlpha: 0.7,\r\n lightSize: 0.5,\r\n scale: 0.6,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"b5Enw7tEwfjDNHuY","name":"04 - Outline","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{"combat-utility-belt":{"macroTrigger":""}},"scope":"global","command":"let params = \r\n[{\r\n filterType: \"outline\",\r\n filterId: \"myOutline\",\r\n padding: 10,\r\n color: 0xEE6035,\r\n thickness: 1,\r\n quality: 5,\r\n animated :\r\n {\r\n thickness: \r\n { \r\n active: true,\r\n loopDuration: 800,\r\n animType: \"syncCosOscillation\",\r\n val1: 1, \r\n val2: 6\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"bFFSpcJSickAe2Tr","name":"27 - T06 - Pure Ice (xglow+smoke)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n [{\r\n filterType: \"zapshadow\",\r\n filterId: \"myPureIceZapShadow\",\r\n alphaTolerance: 0.50\r\n },\r\n {\r\n filterType: \"xglow\",\r\n filterId: \"myPureIceAura\",\r\n auraType: 1,\r\n color: 0x5099DD,\r\n thickness: 4.5,\r\n scale: 10,\r\n time: 0,\r\n auraIntensity: 0.25,\r\n subAuraIntensity: 1,\r\n threshold: 0.5,\r\n discard: false,\r\n animated:\r\n {\r\n time:\r\n {\r\n active: true,\r\n speed: 0.0018,\r\n animType: \"move\"\r\n },\r\n thickness:\r\n {\r\n val1: 2, val2: 3.3,\r\n animType: \"cosOscillation\",\r\n loopDuration: 3000\r\n },\r\n subAuraIntensity:\r\n {\r\n val1: 0.45, val2: 0.65,\r\n animType: \"cosOscillation\",\r\n loopDuration: 6000\r\n },\r\n auraIntensity:\r\n {\r\n val1: 0.9, val2: 2.2,\r\n animType: \"cosOscillation\",\r\n loopDuration: 3000\r\n }\r\n }\r\n },\r\n {\r\n filterType: \"smoke\",\r\n filterId: \"myPureIceSmoke\",\r\n color: 0x80CCFF,\r\n time: 0,\r\n blend: 2,\r\n dimX: 0.3,\r\n dimY: 1,\r\n animated:\r\n {\r\n time:\r\n {\r\n active: true,\r\n speed: -0.006,\r\n animType: \"move\"\r\n },\r\n dimX:\r\n {\r\n val1: 0.4, val2: 0.2,\r\n animType: \"cosOscillation\",\r\n loopDuration: 3000\r\n }\r\n }\r\n }];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"cCEOQFsJvjhSTbbM","name":"06 - Bloom","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params = \r\n[{\r\n filterType: \"xbloom\",\r\n filterId: \"letsShine\",\r\n threshold: 0.35,\r\n bloomScale: 0,\r\n brightness: 1,\r\n blur: 0.1,\r\n padding: 10,\r\n quality: 15,\r\n blendMode: 0,\r\n animated:\r\n {\r\n bloomScale: \r\n { \r\n active: true, \r\n loopDuration: 2000, \r\n animType: \"syncCosOscillation\", \r\n val1: 0, \r\n val2: 2.1\r\n },\r\n threshold: \r\n { \r\n active: false, \r\n loopDuration: 1000, \r\n animType: \"syncCosOscillation\", \r\n val1: 0.00, \r\n val2: 1.90\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);\r\n","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"cOaB7NxSQ5jNDd5g","name":"27 - T01 - Burning Aura (xglow)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"zapshadow\",\r\n filterId: \"myZapShadow\",\r\n alphaTolerance: 0.50\r\n},\r\n{\r\n filterType: \"xglow\",\r\n filterId: \"myBurningAura\",\r\n auraType: 2,\r\n color: 0x903010,\r\n thickness: 9.8,\r\n scale: 4.,\r\n time: 0,\r\n auraIntensity: 2,\r\n subAuraIntensity: 1.5,\r\n threshold: 0.40,\r\n discard: true,\r\n animated:\r\n {\r\n time : \r\n { \r\n active: true,\r\n speed: 0.0027, \r\n animType: \"move\" \r\n },\r\n thickness:\r\n {\r\n active: true,\r\n loopDuration: 3000, \r\n animType: \"cosOscillation\", \r\n val1:2, \r\n val2:5\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"eJQSmnIitUUQMKDS","name":"27 - T04 - Pure Fire (xglow+fire)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"fire\",\r\n filterId: \"myPureFire\",\r\n intensity: 1,\r\n color: 0xFFFFFF,\r\n amplitude: 1,\r\n time: 0,\r\n blend: 2,\r\n fireBlend : 1,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: -0.0024, \r\n animType: \"move\" \r\n },\r\n intensity:\r\n {\r\n active:true,\r\n loopDuration: 15000,\r\n val1: 0.8,\r\n val2: 2,\r\n animType: \"syncCosOscillation\"\r\n },\r\n amplitude:\r\n {\r\n active:true,\r\n loopDuration: 4400,\r\n val1: 1,\r\n val2: 1.4,\r\n animType: \"syncCosOscillation\"\r\n }\r\n \r\n }\r\n},\r\n{\r\n filterType: \"zapshadow\",\r\n filterId: \"myPureFireShadow\",\r\n alphaTolerance: 0.50\r\n},\r\n{\r\n filterType: \"xglow\",\r\n filterId: \"myPureFireAura\",\r\n auraType: 2,\r\n color: 0x903010,\r\n thickness: 9.8,\r\n scale: 4.,\r\n time: 0,\r\n auraIntensity: 2,\r\n subAuraIntensity: 1.5,\r\n threshold: 0.40,\r\n discard: true,\r\n animated:\r\n {\r\n time : \r\n { \r\n active: true,\r\n speed: 0.0027, \r\n animType: \"move\" \r\n },\r\n thickness:\r\n {\r\n active: true,\r\n loopDuration: 3000, \r\n animType: \"cosOscillation\", \r\n val1:2, \r\n val2:5\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} {"_id":"eJnsq5g4Pldh8Z6Q","name":"B - Multi-Filters Example","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"distortion\",\r\n maskPath: \"/modules/tokenmagic/fx/assets/waves-2.png\",\r\n maskSpriteScaleX: 7,\r\n maskSpriteScaleY: 7,\r\n padding: 50,\r\n animated:\r\n {\r\n maskSpriteX: { active: true, speed: 0.05, animType: \"move\" },\r\n maskSpriteY: { active: true, speed: 0.07, animType: \"move\" }\r\n }\r\n},\r\n{\r\n filterType: \"ray\",\r\n time: 0,\r\n color: 0xEF9000,\r\n alpha: 0.25,\r\n divisor: 32,\r\n anchorY: 1,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0005, \r\n animType: \"move\" \r\n }\r\n }\r\n},\r\n{\r\n filterType: \"glow\",\r\n distance: 10,\r\n outerStrength: 8,\r\n innerStrength: 0,\r\n color: 0xB03000,\r\n quality: 0.5,\r\n animated:\r\n {\r\n color: \r\n {\r\n active: true, \r\n loopDuration: 3000, \r\n animType: \"colorOscillation\", \r\n val1:0xB03000, \r\n val2:0xFFD010\r\n }\r\n }\r\n}\r\n];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"ebWbFeiJP8UZG4Fd","name":"17 - Fumes","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"fumes\",\r\n color: 0x909090,\r\n time: 0,\r\n blend: 8,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.001, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"f74nx1SMT5m8RRn8","name":"24 - T08 - Chromatic Bubble","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 8,\r\n gridPadding: 2,\r\n color: 0x505050,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1,\r\n lightAlpha: 0,\r\n lightSize: 0,\r\n scale: 2,\r\n radius: 1,\r\n chromatic: true,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0045, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"g7O4u4dTaWcnajW7","name":"05 - Glow","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"glow\",\r\n distance: 10,\r\n outerStrength: 8,\r\n innerStrength: 0,\r\n color: 0x003000,\r\n quality: 0.5,\r\n padding: 10,\r\n animated:\r\n {\r\n color: \r\n {\r\n active: true, \r\n loopDuration: 3000, \r\n animType: \"colorOscillation\", \r\n val1:0x003000, \r\n val2:0x00FF00\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"hayiRem3LXoEP3tL","name":"03 - Drop Shadow","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"shadow\",\r\n rotation: 35,\r\n blur: 2,\r\n quality: 5,\r\n distance: 20,\r\n alpha: 0.7,\r\n padding: 10,\r\n shadowOnly: false,\r\n color: 0x000000,\r\n animated:\r\n {\r\n blur: \r\n { \r\n active: true, \r\n loopDuration: 500, \r\n animType: \"syncCosOscillation\", \r\n val1: 2, \r\n val2: 4\r\n },\r\n rotation:\r\n {\r\n active: true,\r\n loopDuration: 100,\r\n animType: \"syncSinOscillation\",\r\n val1: 33,\r\n val2: 37\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"lH53KTce3zYEFXos","name":"08 - Old film","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// special : the OldFilm filter need an Outline filter to be contained (or else, it will affect all the container)\r\nlet params =\r\n[{\r\n filterType: \"oldfilm\",\r\n sepia: 0.9,\r\n noise: 0.3,\r\n noiseSize: 1.0,\r\n scratch: 0.8,\r\n scratchDensity: 0.5,\r\n scratchWidth: 1.2,\r\n vignetting: 0.3,\r\n vignettingAlpha: 0.7,\r\n vignettingBlur: 0.3,\r\n animated:\r\n {\r\n seed: \r\n { \r\n active: true, \r\n animType: \"randomNumber\", \r\n val1: 0, \r\n val2: 1 \r\n },\r\n vignetting: \r\n { \r\n active: true, \r\n animType: \"syncCosOscillation\" , \r\n loopDuration: 2000, \r\n val1: 0.2, \r\n val2: 0.4 }\r\n }\r\n},\r\n{\r\n filterType: \"outline\",\r\n color: 0x000000,\r\n thickness: 0,\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"r3JzTibAUnlpgPsD","name":"13 - Shockwave","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"shockwave\",\r\n time: 0,\r\n amplitude: 8,\r\n wavelength: 75,\r\n radius: 500,\r\n brightness: 1.5,\r\n speed: 25,\r\n padding: 0,\r\n animated:\r\n {\r\n time: \r\n { \r\n animType: \"cosOscillation\",\r\n active: true, \r\n loopDuration: 1800, \r\n val1: -4, val2: +4\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"s01RgeSRy4En1aKP","name":"23 - Mirror Images","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"images\",\r\n time: 0,\r\n padding: 60,\r\n alpha: 0.9,\r\n blend: 4,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0010, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"sbP8KX50YRYtxVyB","name":"24 - T01 - Hexa Force Field","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n shieldType: 2,\r\n gridPadding: 0,\r\n color: 0x900090,\r\n time: 0,\r\n blend: 2,\r\n intensity: 1,\r\n lightAlpha: 0.75,\r\n lightSize: 0.45,\r\n scale: 2,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"t2MjFs4cVUCYsbMr","name":"12 - Zoom Blur","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"zoomblur\",\r\n strength: 0.3,\r\n innerRadiusPercent: 70,\r\n radiusPercent: 120,\r\n padding: 30,\r\n animated:\r\n {\r\n innerRadiusPercent: \r\n { \r\n active: true, \r\n animType: \"sinOscillation\", \r\n loopDuration: 500, \r\n val1: 65, \r\n val2: 75\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"ebWbFeiJP8UZG4Fd","name":"17 - Fumes","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"fumes\",\r\n filterId: \"myFumes\",\r\n color: 0x808080,\r\n time: 0,\r\n blend: 8,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.001, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"f74nx1SMT5m8RRn8","name":"24 - T08 - Chromatic Bubble","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"myChromaField\",\r\n shieldType: 8,\r\n gridPadding: 2,\r\n color: 0xAAAAAA,\r\n time: 0,\r\n blend: 0,\r\n intensity: 1,\r\n lightAlpha: 0,\r\n lightSize: 0,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: true,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0045, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"g7O4u4dTaWcnajW7","name":"05 - Glow","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"glow\",\r\n filterId: \"superSpookyGlow\",\r\n outerStrength: 7,\r\n innerStrength: 0,\r\n color: 0x006000,\r\n quality: 0.5,\r\n padding: 10,\r\n animated:\r\n {\r\n color: \r\n {\r\n active: true, \r\n loopDuration: 3000, \r\n animType: \"colorOscillation\", \r\n val1:0x003000, \r\n val2:0x00FF00\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"hFZvMSE5VMCUiYNE","name":"25 - T03 - X-ray Scan (xray)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"xray\",\r\n filterId: \"myXrayScan\",\r\n time: 0,\r\n color: 0xFFFFFF,\r\n blend: 5,\r\n dimX: 20,\r\n dimY: 20,\r\n anchorX: 0.5,\r\n anchorY: 0,\r\n divisor: 8,\r\n intensity: 1,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.00038, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"hayiRem3LXoEP3tL","name":"03 - Drop Shadow","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"shadow\",\r\n filterId: \"myShadow\",\r\n rotation: 35,\r\n blur: 2,\r\n quality: 5,\r\n distance: 20,\r\n alpha: 0.7,\r\n padding: 10,\r\n shadowOnly: false,\r\n color: 0x000000,\r\n animated:\r\n {\r\n blur: \r\n { \r\n active: true, \r\n loopDuration: 500, \r\n animType: \"syncCosOscillation\", \r\n val1: 2, \r\n val2: 4\r\n },\r\n rotation:\r\n {\r\n active: true,\r\n loopDuration: 100,\r\n animType: \"syncSinOscillation\",\r\n val1: 33,\r\n val2: 37\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"lH53KTce3zYEFXos","name":"08 - Old film","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// special : the OldFilm filter need an Outline filter to be contained (or else, it will affect all the container)\r\nlet params =\r\n[{\r\n filterType: \"oldfilm\",\r\n filterId: \"myOldfilm\",\r\n sepia: 0.6,\r\n noise: 0.2,\r\n noiseSize: 1.0,\r\n scratch: 0.8,\r\n scratchDensity: 0.5,\r\n scratchWidth: 1.2,\r\n vignetting: 0.9,\r\n vignettingAlpha: 0.6,\r\n vignettingBlur: 0.2,\r\n animated:\r\n {\r\n seed: \r\n { \r\n active: true, \r\n animType: \"randomNumber\", \r\n val1: 0, \r\n val2: 1 \r\n },\r\n vignetting: \r\n { \r\n active: true, \r\n animType: \"syncCosOscillation\" , \r\n loopDuration: 2000, \r\n val1: 0.2, \r\n val2: 0.4 }\r\n }\r\n},\r\n{\r\n filterType: \"outline\",\r\n filterId: \"oldfilmOutline\",\r\n color: 0x000000,\r\n thickness: 0,\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"r3JzTibAUnlpgPsD","name":"13 - Shockwave","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"shockwave\",\r\n filterId: \"myShockwave\",\r\n time: 0,\r\n amplitude: 8,\r\n wavelength: 75,\r\n radius: 500,\r\n brightness: 1.5,\r\n speed: 25,\r\n padding: 0,\r\n animated:\r\n {\r\n time: \r\n { \r\n animType: \"cosOscillation\",\r\n active: true, \r\n loopDuration: 1800, \r\n val1: 0, val2: 10\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"s01RgeSRy4En1aKP","name":"23 - T01 - Mirror Images","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"images\",\r\n filterId: \"myMirrorImages\",\r\n time: 0,\r\n nbImage: 4,\r\n alphaImg: 1.0,\r\n alphaChr: 0.0,\r\n blend: 4,\r\n ampX: 0.10,\r\n ampY: 0.10,\r\n animated :\r\n {\r\n time: \r\n { \r\n active: true, \r\n speed: 0.0010, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"sZmVZvLEYmlEC1bK","name":"F - 05 - Import FX Presets (URL)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// Replace the dummy url with a valid url that points to a Token Magic FX presets file (json)\r\n// Open the console (F12) to check the state of the import\r\n// You can configure in the module option panel the \"overwrite mode on import\"\r\n\r\n// TokenMagic.importPresetLibraryFromURL(\"https://presets-to-import-url\");\r\n\r\nui.notifications.warn(\"Open this macro and read the instructions.\");","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"sbP8KX50YRYtxVyB","name":"24 - T01 - Hexa Force Field","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"field\",\r\n filterId: \"myHexaField\",\r\n shieldType: 2,\r\n gridPadding: 3,\r\n color: 0xCC00CC,\r\n time: 0,\r\n blend: 3,\r\n intensity: 1,\r\n lightAlpha: 0.5,\r\n lightSize: 0.5,\r\n scale: 1,\r\n radius: 1,\r\n chromatic: false,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0015, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"t2MjFs4cVUCYsbMr","name":"12 - Zoom Blur","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"zoomblur\",\r\n filterId: \"myZoomBlur\",\r\n strength: 0.15,\r\n innerRadiusPercent: 65,\r\n radiusPercent: 100,\r\n padding: 30,\r\n animated:\r\n {\r\n innerRadiusPercent: \r\n { \r\n active: true, \r\n animType: \"sinOscillation\", \r\n loopDuration: 500, \r\n val1: 65, \r\n val2: 75\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} {"_id":"tvDGSwbeQ97HNS8v","name":"A - Multi-Filters Example","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"fog\",\r\n color: 0x00FF50,\r\n density: 0.20,\r\n time: 0,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 1.2, \r\n animType: \"move\" \r\n }\r\n }\r\n},\r\n{\r\n filterType: \"ray\",\r\n time: 0,\r\n color: 0x00DE50,\r\n alpha: 0.25,\r\n divisor: 32,\r\n anchorY: 0,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0005, \r\n animType: \"move\" \r\n }\r\n }\r\n},\r\n{\r\n filterType: \"glow\",\r\n distance: 10,\r\n outerStrength: 8,\r\n innerStrength: 0,\r\n color: 0x003000,\r\n quality: 0.5,\r\n padding: 10,\r\n animated:\r\n {\r\n color: \r\n {\r\n active: true, \r\n loopDuration: 3000, \r\n animType: \"colorOscillation\", \r\n val1:0x003000, \r\n val2:0x00EF00\r\n }\r\n }\r\n}\r\n];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"_id":"wdbgHdNcBwBETc1y","name":"27 - T02 - Glacial Aura (xglow)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"zapshadow\",\r\n filterId: \"myZapShadow\",\r\n alphaTolerance: 0.50\r\n},\r\n{\r\n filterType: \"xglow\",\r\n filterId: \"myMagicGlow\",\r\n auraType: 1,\r\n color: 0x70BBFF,\r\n thickness: 3.3,\r\n scale: 0.25,\r\n time: 0,\r\n auraIntensity: 1,\r\n subAuraIntensity: 0.25,\r\n threshold: 0.25,\r\n discard: false,\r\n animated:\r\n {\r\n time : \r\n { \r\n active: true,\r\n speed: 0.0006, \r\n animType: \"move\" \r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} -{"name":"27 - T03 - Ugly villains Aura (xglow)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"zapshadow\",\r\n filterId: \"myZapShadow\",\r\n alphaTolerance: 0.50\r\n},\r\n{\r\n filterType: \"xglow\",\r\n filterId: \"myMagicGlow\",\r\n auraType: 2,\r\n color: 0x050505,\r\n thickness: 2.7,\r\n scale: 7,\r\n time: 0,\r\n auraIntensity: 5,\r\n subAuraIntensity: 2,\r\n threshold: 0.08,\r\n discard: false,\r\n animated:\r\n {\r\n time : \r\n { \r\n active: true,\r\n speed: 0.0012, \r\n animType: \"move\" \r\n },\r\n auraIntensity:\r\n {\r\n active: true,\r\n loopDuration: 3000, \r\n animType: \"syncCosOscillation\", \r\n val1:5, \r\n val2:0\r\n },\r\n subAuraIntensity:\r\n {\r\n active: true,\r\n loopDuration: 3000, \r\n animType: \"syncCosOscillation\", \r\n val1:2, \r\n val2:0\r\n },\r\n color:\r\n {\r\n active: true,\r\n loopDuration: 6000, \r\n animType: \"syncColorOscillation\", \r\n val1:0x050505, \r\n val2:0x200000\r\n },\r\n threshold:\r\n {\r\n active: true,\r\n loopDuration: 1500, \r\n animType: \"syncCosOscillation\", \r\n val1:0.02, \r\n val2:0.50\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[],"_id":"ydY1XOCO4yIhunkj"} -{"_id":"zCCp4x0EResFji7O","name":"21 - Flood","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"flood\",\r\n time: 0,\r\n color: 0x0020BB,\r\n billowy: 0.43,\r\n tintIntensity: 0.72,\r\n glint: 0.31,\r\n scale: 70,\r\n padding: 10,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0006, \r\n animType: \"move\"\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"wRWqUK0wliNZSsgl","name":"27 - T05 - Pure Fire v2 (xglow+fire)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// In this version, the glow is blending with the fire\r\n// This is to show that the order of the filters is important\r\nlet params =\r\n[{\r\n filterType: \"zapshadow\",\r\n filterId: \"myPureFireShadow\",\r\n alphaTolerance: 0.50\r\n},\r\n{\r\n filterType: \"xglow\",\r\n filterId: \"myPureFireAura\",\r\n auraType: 2,\r\n color: 0x903010,\r\n thickness: 9.8,\r\n scale: 3.,\r\n time: 0,\r\n auraIntensity: 1,\r\n subAuraIntensity: 0.3,\r\n threshold: 0.25,\r\n discard: true,\r\n animated:\r\n {\r\n time : \r\n { \r\n active: true,\r\n speed: 0.0027, \r\n animType: \"move\" \r\n },\r\n thickness:\r\n {\r\n active: true,\r\n loopDuration: 3000, \r\n animType: \"cosOscillation\", \r\n val1:2, \r\n val2:3.6\r\n }\r\n }\r\n},\r\n{\r\n filterType: \"fire\",\r\n filterId: \"myPureFire\",\r\n intensity: 1,\r\n color: 0xFFFFFF,\r\n amplitude: 1,\r\n time: 0,\r\n blend: 2,\r\n fireBlend : 1,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: -0.0024, \r\n animType: \"move\" \r\n },\r\n intensity:\r\n {\r\n active:true,\r\n loopDuration: 15000,\r\n val1: 0.8,\r\n val2: 3,\r\n animType: \"syncCosOscillation\"\r\n },\r\n amplitude:\r\n {\r\n active:true,\r\n loopDuration: 4400,\r\n val1: 1,\r\n val2: 1.6,\r\n animType: \"syncCosOscillation\"\r\n }\r\n \r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"wdbgHdNcBwBETc1y","name":"27 - T02 - Glacial Aura (xglow)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"zapshadow\",\r\n filterId: \"myGlacialZapShadow\",\r\n alphaTolerance: 0.50\r\n},\r\n{\r\n filterType: \"xglow\",\r\n filterId: \"myGlacialAura\",\r\n auraType: 1,\r\n color: 0x5099DD,\r\n thickness: 4.5,\r\n scale: 3,\r\n time: 0,\r\n auraIntensity: 0.8,\r\n subAuraIntensity: 0.25,\r\n threshold: 0.5,\r\n discard: false,\r\n animated:\r\n {\r\n time : \r\n { \r\n active: true,\r\n speed: 0.0018, \r\n animType: \"move\" \r\n },\r\n thickness: \r\n {\r\n val1: 2, val2: 4.7,\r\n animType: \"cosOscillation\",\r\n loopDuration: 3000\r\n },\r\n subAuraIntensity: \r\n {\r\n val1: 0.45, val2: 0.65,\r\n animType: \"cosOscillation\",\r\n loopDuration: 6000\r\n },\r\n auraIntensity: \r\n {\r\n val1: 0.9, val2: 2.2,\r\n animType: \"cosOscillation\",\r\n loopDuration: 3000\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"ydY1XOCO4yIhunkj","name":"27 - T03 - Ugly Villains Aura (xglow)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"zapshadow\",\r\n filterId: \"myUglyZapShadow\",\r\n alphaTolerance: 0.50\r\n},\r\n{\r\n filterType: \"xglow\",\r\n filterId: \"myUglyGlow\",\r\n auraType: 2,\r\n color: 0x050505,\r\n thickness: 2.7,\r\n scale: 7,\r\n time: 0,\r\n auraIntensity: 5,\r\n subAuraIntensity: 2,\r\n threshold: 0.08,\r\n discard: false,\r\n animated:\r\n {\r\n time : \r\n { \r\n active: true,\r\n speed: 0.0012, \r\n animType: \"move\" \r\n },\r\n auraIntensity:\r\n {\r\n active: true,\r\n loopDuration: 3000, \r\n animType: \"syncCosOscillation\", \r\n val1:5, \r\n val2:0\r\n },\r\n subAuraIntensity:\r\n {\r\n active: true,\r\n loopDuration: 3000, \r\n animType: \"syncCosOscillation\", \r\n val1:2, \r\n val2:0\r\n },\r\n color:\r\n {\r\n active: true,\r\n loopDuration: 6000, \r\n animType: \"syncColorOscillation\", \r\n val1:0x050505, \r\n val2:0x200000\r\n },\r\n threshold:\r\n {\r\n active: true,\r\n loopDuration: 1500, \r\n animType: \"syncCosOscillation\", \r\n val1:0.02, \r\n val2:0.50\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"yl0TtF0CKuOkOPZv","name":"23 - T02 - Chaotic Images","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"// This is an extreme example...\r\nlet params =\r\n[{\r\n filterType: \"images\",\r\n filterId: \"myChaoticImages\",\r\n time: 0,\r\n nbImage: 4,\r\n alphaImg: 1.0,\r\n alphaChr: 0.0,\r\n blend: 4,\r\n ampX: 0.10,\r\n ampY: 0.10,\r\n padding: 80,\r\n animated :\r\n {\r\n time: \r\n { \r\n active: true, \r\n speed: 0.0010, \r\n animType: \"move\" \r\n },\r\n ampX:\r\n {\r\n active: true,\r\n val1: 0.00,\r\n val2: 0.30,\r\n chaosFactor: 0.03,\r\n animType: \"syncChaoticOscillation\",\r\n loopDuration: 2000\r\n },\r\n ampY:\r\n {\r\n active: true,\r\n val1: 0.00,\r\n val2: 0.30,\r\n chaosFactor: 0.04,\r\n animType: \"syncChaoticOscillation\",\r\n loopDuration: 1650\r\n },\r\n alphaChr: \r\n { \r\n active: true, \r\n animType: \"randomNumberPerLoop\", \r\n val1: 0.0, \r\n val2: 1,\r\n loopDuration: 250\r\n },\r\n alphaImg: \r\n { \r\n active: true, \r\n animType: \"randomNumberPerLoop\", \r\n val1: 0.8, \r\n val2: 1,\r\n loopDuration: 250\r\n },\r\n nbImage:\r\n {\r\n active: true,\r\n val1: 1,\r\n val2: 9,\r\n animType: \"syncSinOscillation\",\r\n loopDuration: 1400\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"zCCp4x0EResFji7O","name":"21 - Flood","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"flood\",\r\n filterId: \"myFlood\",\r\n time: 0,\r\n color: 0x0020BB,\r\n billowy: 0.43,\r\n tintIntensity: 0.72,\r\n glint: 0.31,\r\n scale: 70,\r\n padding: 10,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0006, \r\n animType: \"move\"\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"Ku4jBl972O7hHczs","name":"F - 03 - Export FX Presets","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"TokenMagic.exportPresetLibrary();","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"T953GJB235BbrCll","name":"26 - T03 - Drift in Plans (liquid+waves)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"wave\",\r\n filterId: \"myDriftWaves\",\r\n time: 0,\r\n anchorX: 0.5,\r\n anchorY: 0.5,\r\n strength: 0.035,\r\n frequency: 20,\r\n color: 0xFFFFFF,\r\n maxIntensity: 1.5,\r\n minIntensity: 0.5,\r\n padding:10,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0085, \r\n animType: \"move\" \r\n },\r\n anchorX :\r\n {\r\n active: true,\r\n val1: 0.35,\r\n val2: 0.65,\r\n animType: \"syncCosOscillation\",\r\n loopDuration: 10000\r\n },\r\n anchorY :\r\n {\r\n active: true,\r\n val1: 0.35,\r\n val2: 0.65,\r\n animType: \"syncSinOscillation\",\r\n loopDuration: 10000\r\n }\r\n }\r\n},\r\n{\r\n filterType: \"liquid\",\r\n filterId: \"myDriftLiquid\",\r\n color: 0xFF0000,\r\n time: 0,\r\n blend: 6,\r\n intensity: 5,\r\n spectral: false,\r\n scale: 2.5,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0018, \r\n animType: \"move\" \r\n },\r\n color: \r\n {\r\n active: true, \r\n loopDuration: 9000, \r\n animType: \"colorOscillation\", \r\n val1:0xFF0000, \r\n val2:0xFFFFFF\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"ydY1XOCO4yIhunkj","name":"27 - T03 - Ugly Villains Aura (xglow)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"zapshadow\",\r\n filterId: \"myUglyZapShadow\",\r\n alphaTolerance: 0.50\r\n},\r\n{\r\n filterType: \"xglow\",\r\n filterId: \"myUglyGlow\",\r\n auraType: 2,\r\n color: 0x050505,\r\n thickness: 2.7,\r\n scale: 7,\r\n time: 0,\r\n auraIntensity: 5,\r\n subAuraIntensity: 2,\r\n threshold: 0.08,\r\n discard: false,\r\n animated:\r\n {\r\n time : \r\n { \r\n active: true,\r\n speed: 0.0012, \r\n animType: \"move\" \r\n },\r\n auraIntensity:\r\n {\r\n active: true,\r\n loopDuration: 3000, \r\n animType: \"syncCosOscillation\", \r\n val1:5, \r\n val2:0\r\n },\r\n subAuraIntensity:\r\n {\r\n active: true,\r\n loopDuration: 3000, \r\n animType: \"syncCosOscillation\", \r\n val1:2, \r\n val2:0\r\n },\r\n color:\r\n {\r\n active: true,\r\n loopDuration: 6000, \r\n animType: \"syncColorOscillation\", \r\n val1:0x050505, \r\n val2:0x200000\r\n },\r\n threshold:\r\n {\r\n active: true,\r\n loopDuration: 1500, \r\n animType: \"syncCosOscillation\", \r\n val1:0.02, \r\n val2:0.50\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"ydY1XOCO4yIhunkj","name":"27 - T03 - Ugly Villains Aura (xglow)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"zapshadow\",\r\n filterId: \"myUglyZapShadow\",\r\n alphaTolerance: 0.50\r\n},\r\n{\r\n filterType: \"xglow\",\r\n filterId: \"myUglyGlow\",\r\n auraType: 2,\r\n color: 0x050505,\r\n thickness: 2.7,\r\n scale: 7,\r\n time: 0,\r\n auraIntensity: 5,\r\n subAuraIntensity: 2,\r\n threshold: 0.08,\r\n discard: false,\r\n animated:\r\n {\r\n time : \r\n { \r\n active: true,\r\n speed: 0.0012, \r\n animType: \"move\" \r\n },\r\n auraIntensity:\r\n {\r\n active: true,\r\n loopDuration: 3000, \r\n animType: \"syncCosOscillation\", \r\n val1:5, \r\n val2:0\r\n },\r\n subAuraIntensity:\r\n {\r\n active: true,\r\n loopDuration: 3000, \r\n animType: \"syncCosOscillation\", \r\n val1:2, \r\n val2:0\r\n },\r\n color:\r\n {\r\n active: true,\r\n loopDuration: 6000, \r\n animType: \"syncColorOscillation\", \r\n val1:0x050505, \r\n val2:0x200000\r\n },\r\n threshold:\r\n {\r\n active: true,\r\n loopDuration: 1500, \r\n animType: \"syncCosOscillation\", \r\n val1:0.02, \r\n val2:0.50\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"_id":"SpvVIO1eHYG96TGX","name":"26 - T01 - Spectral Body (liquid)","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params =\r\n[{\r\n filterType: \"liquid\",\r\n filterId: \"mySpectralBody\",\r\n color: 0x20AAEE,\r\n time: 0,\r\n blend: 8,\r\n intensity: 4,\r\n spectral: true,\r\n scale: 0.9,\r\n animated :\r\n {\r\n time : \r\n { \r\n active: true, \r\n speed: 0.0010, \r\n animType: \"move\" \r\n },\r\n color: \r\n {\r\n active: true, \r\n loopDuration: 6000, \r\n animType: \"colorOscillation\", \r\n val1:0xFFFFFF, \r\n val2:0x00AAFF\r\n }\r\n }\r\n}];\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} +{"name":"28 - Glory to Pixels","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params = \r\n[{\r\n filterType: \"pixel\",\r\n filterId: \"pixelate\",\r\n sizeX: 2.5,\r\n sizeY: 2.5\r\n}]\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[],"_id":"8KIRbHAgs6SCs8mT"} +{"_id":"8KIRbHAgs6SCs8mT","name":"28 - Glory to Pixels","permission":{"default":0,"Njc5YzFjZDI5NjZl":3},"type":"script","flags":{},"scope":"global","command":"let params = \r\n[{\r\n filterType: \"pixel\",\r\n filterId: \"pixelate\",\r\n sizeX: 2.5,\r\n sizeY: 2.5\r\n}]\r\n\r\nTokenMagic.addUpdateFiltersOnSelected(params);","author":"Njc5YzFjZDI5NjZl","img":"icons/svg/dice-target.svg","actorIds":[]} diff --git a/tokenmagic/updates/UPDATE-0.2.1.md b/tokenmagic/updates/UPDATE-0.2.1.md new file mode 100644 index 0000000..9a32a08 --- /dev/null +++ b/tokenmagic/updates/UPDATE-0.2.1.md @@ -0,0 +1,161 @@ +# Token Magic FX - Update v0.2.1-alpha + +*Added :* +- An option to allow non-GM players to add, modify or delete FX on tokens which they do not own. +- Mirror-images filter overhaul with new properties : + - number of images + - alpha of the images and the main character + - movement amplitude along the X and Y axis. + - 2 new macro in the portfolio (with an emphasis on new properties) +- Library of stored FX presets : + - comes with a default library (the same as in the portfolio) + - functions to add or delete presets + - functions to export presets library into a json file + - functions to import presets into your library (local or URL) +- Added smooth edges on Force Field filter + +*New FX :* +- A pixelate filter (sample added in the portfolio) + +*Fixed issues :* +- Added the v0.2.0 missing macros in the portfolio. + - X-rays, liquid and x-glow macros +- Force field filter had a brightness and contrast problem. + - The colors are now more vivid. + - You may have to review your macros by adjusting color intensity. + - The Force field macros have been rewritten. +- Corrected some performances issues in the shaders +- Some animations could freeze with a large video or texture (animated tokens, etc.) + +*Thanks :* +- special thanks to @tposney + +## Managing Presets + +*Added new functions :* + +To add a preset in your library : +```javascript +(async) TokenMagic.addPreset(,,optional ) + +// Example +// You don't need to add a filterId when creating a preset. The filterId is created with the preset name. +// In the example below, the filterId will be equal to "FunnyGlow" +// If your preset is composed of multiple filter types, all the filterId will share the preset name +let params = + [{ + filterType: "glow", + filterId: "funnyAlternateGlow", + color: Math.floor(Math.random() * 16777215) + }]; +TokenMagic.addPreset("FunnyGlow",params); +``` +To delete a preset in your library : +```javascript +(async) TokenMagic.deletePreset(,optional ); +``` +To get a preset from your library : +```javascript +TokenMagic.getPreset(); +``` + +To export your library in a json file +```javascript +TokenMagic.exportPresetLibrary(optional ); +``` + +To import presets into your library (open a file picker dialog) +```javascript +(async) TokenMagic.importPresetLibrary(); +``` + +To import presets into your library from a local path +```javascript +(async) TokenMagic.importPresetLibraryFromPath(); +``` + +To import presets into your library from an URL +```javascript +(async) TokenMagic.importPresetLibraryFromURL(); +``` + +To reset the preset library with the default presets (confirmation is requested) +```javascript +(async) TokenMagic.resetPresetLibrary(); +``` + +*A new option in the module option panel allow overwrite of duplicates (by preset name) on import. +By default, duplicates are ignored.* + +### Functions updates + +You can use presets with those functions below, by replacing the params with a preset name : +```javascript +TokenMagic.addFilters +TokenMagic.addFiltersOnSelected +TokenMagic.addFiltersOnTargeted +TokenMagic.addUpdateFiltersOnSelected +TokenMagic.addUpdateFiltersOnTargeted +TokenMagic.updateFiltersOnSelected +TokenMagic.updateFiltersOnTargeted +TokenMagic.updateFiltersByPlaceable + +// Example +TokenMagic.addFiltersOnTargeted("dead"); +``` + +### Default presets library content + +```javascript +0: {name: "bevel", params: Array(1)} +1: {name: "adjustment", params: Array(1)} +2: {name: "dropshadow", params: Array(1)} +3: {name: "outline", params: Array(1)} +4: {name: "glow", params: Array(1)} +5: {name: "bloom", params: Array(1)} +6: {name: "distortion", params: Array(1)} +7: {name: "oldfilm", params: Array(2)} +8: {name: "twist", params: Array(1)} +9: {name: "bulge", params: Array(1)} +10: {name: "blur", params: Array(1)} +11: {name: "zoomblur", params: Array(1)} +12: {name: "shockwave", params: Array(1)} +13: {name: "zapshadow", params: Array(1)} +14: {name: "rays", params: Array(1)} +15: {name: "fog", params: Array(1)} +16: {name: "fumes", params: Array(1)} +17: {name: "electric", params: Array(1)} +18: {name: "fire", params: Array(1)} +19: {name: "waves", params: Array(1)} +20: {name: "flood", params: Array(1)} +21: {name: "smoke", params: Array(1)} +22: {name: "images", params: Array(1)} +23: {name: "chaos-images", params: Array(1)} +24: {name: "spectral-images", params: Array(1)} +25: {name: "hexa-field", params: Array(1)} +26: {name: "fire-field", params: Array(1)} +27: {name: "smoke-field", params: Array(1)} +28: {name: "earth-field", params: Array(1)} +29: {name: "earth-field-top", params: Array(1)} +30: {name: "air-field", params: Array(1)} +31: {name: "magic-field", params: Array(1)} +32: {name: "chromatic-field", params: Array(1)} +33: {name: "water-field", params: Array(1)} +34: {name: "evil-field", params: Array(1)} +35: {name: "grid-field", params: Array(1)} +36: {name: "warp-field", params: Array(1)} +37: {name: "color-field", params: Array(1)} +38: {name: "sunburst", params: Array(1)} +39: {name: "clover", params: Array(1)} +40: {name: "scan", params: Array(1)} +41: {name: "blue-rays", params: Array(1)} +42: {name: "spectral-body", params: Array(1)} +43: {name: "mantle-of-madness", params: Array(1)} +44: {name: "drift-in-plans", params: Array(2)} +45: {name: "fire-aura", params: Array(2)} +46: {name: "glacial-aura", params: Array(2)} +47: {name: "anti-aura", params: Array(2)} +48: {name: "pure-fire-aura", params: Array(3)} +49: {name: "pure-fire-aura-2", params: Array(3)} +50: {name: "pure-ice-aura", params: Array(3)} +``` \ No newline at end of file