diff --git a/.vs/Tokenmagic/v16/.suo b/.vs/Tokenmagic/v16/.suo index 91edb99..6836581 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 13dae47..3015976 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -4,6 +4,7 @@ "\\tokenmagic", "\\tokenmagic\\fx", "\\tokenmagic\\fx\\filters", + "\\tokenmagic\\fx\\filters\\proto", "\\tokenmagic\\fx\\glsl", "\\tokenmagic\\fx\\glsl\\fragmentshaders", "\\tokenmagic\\fx\\glsl\\vertexshaders", @@ -11,6 +12,6 @@ "\\tokenmagic\\module", "\\tokenmagic\\updates" ], - "SelectedNode": "\\tokenmagic\\fx\\glsl\\fragmentshaders\\forcefield.js", + "SelectedNode": "\\tokenmagic\\fx\\glsl\\fragmentshaders\\glowoh.js", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 2a785f5..96fc219 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/README.md b/README.md index 72d28b2..cfd72b2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,100 @@ +# Token Magic FX - Update v0.2.0-alpha + +*Added :* +- A copy of a token also copies the FX +- FX are now stored on prototype tokens (if you update your prototype with a FXified Token) +- An option panel is now available : + - You can desactivate additive padding in favor of max padding + - You can set a minimum padding for all applied FX + +*New FX :* +- An advanced Ray filter (with better quality than cosmic ray filter) + - blending options +- Another liquid filter (complementary with the flood filter) + - blending options + - spectral property +- A gleaming glow filter + - two glow types + - adjustable FX scale + - adjustable thickness + - and lot more options to create magical glows. + +The new filters have been added to the TokenMagic macro compendium. + +*Fixed issues :* +- autoDestroy property did not work properly (the effect was restored when reloading the scene) +- Freezing when updating image, dimensions or tint of a token. +- Freezing when updating image of a tile. +- An effect without animated properties could not be updated normally. +- The global animated property could not be unset (can be unset now with `animated: null`) + +## Filters handling + +*Added new functions :* + +To verify if a placeable has a filter with the specified `filterType` : +```javascript +TokenMagic.hasFilterType(,) + +// Example +... +if (TokenMagic.hasFilterType(myToken,"glow")) { + console.log("myToken has a glow filter."); +} +... +``` +To verify if a placeable has a filter with the specified `filterId` : +```javascript +TokenMagic.hasFilterId(,) + +// Example +... +if (TokenMagic.hasFilterId(myToken,"mySuperShadow_01")) { + console.log("myToken has my customized super shadow 1 filter."); +} +... +``` +Add or update filter(s) on a placeable. If a filter applied on an object has a filterType and a filterId identical to those found in the parameters, the values are updated with the new ones. Otherwise a new filter is created. +```javascript +(async) TokenMagic.addUpdateFilters(, ) +``` + +## PlaceableObject TMFX prototypes + +*Added new prototype functions in class PlaceableObject (Token, Tile, etc.), to facilitate coding :* + +```javascript +(async) .TMFXaddFilters() +(async) .TMFXupdateFilters() +(async) .TMFXaddUpdateFilters() +(async) .TMFXdeleteFilters(optional ) +.TMFXhasFilterType() +.TMFXhasFilterId() + +// Example 1 +let glowFunc = async function() { + + const tokens = canvas.tokens.placeables; + + for (const token of tokens){ + if (token.TMFXhasFilterId("funnyAlternateGlow")) { + await token.TMFXdeleteFilters("funnyAlternateGlow"); + } else { + let params = + [{ + filterType: "glow", + filterId: "funnyAlternateGlow", + color: Math.floor(Math.random() * 16777215), + animated: null + }]; + await token.TMFXaddUpdateFilters(params); + } + } +}; + +glowFunc(); +``` + # Token Magic FX - Update v0.1.3d-alpha ## FX diff --git a/Tokenmagic.zip b/Tokenmagic.zip index c98d3c9..9c38fbb 100644 Binary files a/Tokenmagic.zip and b/Tokenmagic.zip differ diff --git a/tokenmagic/fx/Anime.js b/tokenmagic/fx/Anime.js index 40de67e..3fb8c2d 100644 --- a/tokenmagic/fx/Anime.js +++ b/tokenmagic/fx/Anime.js @@ -17,13 +17,14 @@ export class Anime { if (!(this.puppet == null)) { if (this.puppet.hasOwnProperty("animated") + && !(this.puppet.animated == null) && typeof this.puppet.animated === 'object' && Object.keys(this.puppet.animated).length > 0) { this.initAnimatedInternals(this.puppet.animated); this.animated = this.puppet.animated; // easy access to the puppet's animodes - Anime.addAnimation(self); // ready to tick } + Anime.addAnimation(self); // ready to tick } } @@ -56,7 +57,6 @@ export class Anime { this.elapsedTime[effect] += frameTime; } }); - this.autoDisableCheck(); } @@ -89,18 +89,21 @@ export class Anime { if (!(this.puppet.filterOwner === game.data.userId && (this.puppet.autoDisable || this.puppet.autoDestroy))) { return; } - if (this.puppet.enabled === false) { return; } + if (this.puppet.enabled === false && !this.puppet.autoDestroy) { return; } if (Object.values(this.animated).every(animeEffect => animeEffect.active === false)) { - let params = {}; - params.filterId = this.puppet.filterId; - this.puppet.autoDestroy ? params.destroy = true : params.enabled = false; - var placeable = this.puppet.getPlaceable(); - // updating the filter trigger an update{placeable} for everyone - await window.TokenMagic.updateFilterByPlaceable(params, placeable); + if (this.puppet.autoDestroy) { + await window.TokenMagic.deleteFilters(placeable, this.puppet.filterId); + } else { + let params = {}; + params.filterId = this.puppet.filterId; + params.enabled = false; + + await window.TokenMagic.updateFilterByPlaceable(params, placeable); + } } } @@ -387,7 +390,9 @@ export class Anime { if (anime.puppet.hasOwnProperty("preComputation")) { anime.puppet.preComputation(); } - anime.animate(Anime._frameTime); + if (anime.puppet.hasOwnProperty("animated") && !(anime.puppet.animated == null)) { + anime.animate(Anime._frameTime); + } }); Anime._prevTime = Anime._lastTime; } diff --git a/tokenmagic/fx/filters/FilterGleamingGlow.js b/tokenmagic/fx/filters/FilterGleamingGlow.js new file mode 100644 index 0000000..b25395e --- /dev/null +++ b/tokenmagic/fx/filters/FilterGleamingGlow.js @@ -0,0 +1,125 @@ +import { magicGlow } from '../glsl/fragmentshaders/magicglow.js'; +import { customVertex2D } from '../glsl/vertexshaders/customvertex2D.js'; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterGleamingGlow extends PIXI.Filter { + + constructor(params) { + + let { + time, + color, + thickness, + scale, + auraIntensity, + subAuraIntensity, + discard, + threshold, + auraType + } = Object.assign({}, FilterGleamingGlow.defaults, params); + + // using specific vertex shader and fragment shader + super(customVertex2D, magicGlow); + + this.uniforms.color = new Float32Array([1.0, 0.4, 0.1, 1.0]); + this.uniforms.thickness = new Float32Array([0.01, 0.01]); + + Object.assign(this, { + time, color, thickness, scale, auraIntensity, subAuraIntensity, discard, threshold, auraType + }); + + this.animated = {}; + this.setTMParams(params); + this.anime = new Anime(this); + this.normalizeTMParams(); + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get scale() { + return this.uniforms.scale; + } + + set scale(value) { + this.uniforms.scale = value; + } + + get auraIntensity() { + return this.uniforms.auraIntensity; + } + + set auraIntensity(value) { + this.uniforms.auraIntensity = value; + } + + get subAuraIntensity() { + return this.uniforms.subAuraIntensity; + } + + set subAuraIntensity(value) { + this.uniforms.subAuraIntensity = value; + } + + get threshold() { + return this.uniforms.threshold; + } + + set threshold(value) { + this.uniforms.threshold = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + PIXI.utils.hex2rgb(value, this.uniforms.color); + } + + get discard() { + return this.uniforms.holes; + } + + set discard(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.holes = value; + } + } + + get auraType() { + return this.uniforms.auraType; + } + + set auraType(value) { + this.uniforms.auraType = Math.floor(value); + } + + apply(filterManager, input, output, clear) { + this.uniforms.thickness[0] = (this.thickness * this.placeableImg.parent.worldTransform.a) / input._frame.width; + this.uniforms.thickness[1] = (this.thickness * this.placeableImg.parent.worldTransform.a) / input._frame.height; + filterManager.applyFilter(this, input, output, clear); + } +} + +FilterGleamingGlow.defaults = { + time: 0, + color: 0xFF8010, + thickness: 5, + scale: 1, + auraIntensity: 1, + subAuraIntensity: 1, + discard: false, + threshold: 0.5, + auraType: 1, +}; + + + + diff --git a/tokenmagic/fx/filters/FilterLiquid.js b/tokenmagic/fx/filters/FilterLiquid.js new file mode 100644 index 0000000..12b4684 --- /dev/null +++ b/tokenmagic/fx/filters/FilterLiquid.js @@ -0,0 +1,95 @@ +import { liquid } from '../glsl/fragmentshaders/liquid.js'; +import { customVertex2D } from '../glsl/vertexshaders/customvertex2D.js'; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterLiquid extends PIXI.Filter { + + constructor(params) { + let { + time, + color, + scale, + intensity, + blend, + spectral + } = Object.assign({}, FilterLiquid.defaults, params); + + // using specific vertex shader and fragment shader + super(customVertex2D, liquid); + + this.uniforms.color = new Float32Array([0.1, 0.45, 1.0]); + + Object.assign(this, { + time, color, scale, intensity, blend, spectral + }); + + this.animated = {}; + this.setTMParams(params); + this.anime = new Anime(this); + this.normalizeTMParams(); + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get scale() { + return this.uniforms.scale; + } + + set scale(value) { + this.uniforms.scale = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + PIXI.utils.hex2rgb(value, this.uniforms.color); + } + + get intensity() { + return this.uniforms.intensity; + } + + set intensity(value) { + this.uniforms.intensity = value; + } + + get blend() { + return this.uniforms.blend; + } + + set blend(value) { + this.uniforms.blend = Math.floor(value); + } + + get spectral() { + return this.uniforms.spectral; + } + + set spectral(value) { + if (!(value == null) && typeof value === "boolean") { + this.uniforms.spectral = value; + } + } +} + +FilterLiquid.defaults = { + time: 0.0, + color: 0x0595FF, + scale: 1, + intensity: 5, + blend: 4, + spectral: false, +}; + + + + diff --git a/tokenmagic/fx/filters/FilterXRays.js b/tokenmagic/fx/filters/FilterXRays.js new file mode 100644 index 0000000..e8a5fa5 --- /dev/null +++ b/tokenmagic/fx/filters/FilterXRays.js @@ -0,0 +1,125 @@ +import { xRay } from '../glsl/fragmentshaders/xray.js'; +import { customVertex2D } from '../glsl/vertexshaders/customvertex2D.js'; +import { Anime } from "../Anime.js"; +import "./proto/FilterProto.js"; + +export class FilterXRays extends PIXI.Filter { + + constructor(params) { + let { + time, + color, + divisor, + intensity, + blend, + anchorX, + anchorY, + dimX, + dimY + } = Object.assign({}, FilterXRays.defaults, params); + + // using specific vertex shader and fragment shader + super(customVertex2D, xRay); + + this.uniforms.color = new Float32Array([1.0, 0.4, 0.1]); + this.uniforms.anchor = new Float32Array([0.5, -1.0]); + this.uniforms.dimensions = new Float32Array([1.0, 1.0]); + + Object.assign(this, { + time, color, divisor, intensity, blend, anchorX, anchorY, dimX, dimY + }); + + this.animated = {}; + this.setTMParams(params); + this.anime = new Anime(this); + this.normalizeTMParams(); + } + + get time() { + return this.uniforms.time; + } + + set time(value) { + this.uniforms.time = value; + } + + get color() { + return PIXI.utils.rgb2hex(this.uniforms.color); + } + + set color(value) { + PIXI.utils.hex2rgb(value, this.uniforms.color); + } + + get divisor() { + return this.uniforms.divisor; + } + + set divisor(value) { + this.uniforms.divisor = value; + } + + get intensity() { + return this.uniforms.intensity; + } + + set intensity(value) { + this.uniforms.intensity = value; + } + + get blend() { + return this.uniforms.blend; + } + + set blend(value) { + this.uniforms.blend = Math.floor(value); + } + + get anchorX() { + return this.uniforms.anchor[0]; + } + + set anchorX(value) { + this.uniforms.anchor[0] = value; + } + + get anchorY() { + return this.uniforms.anchor[1]; + } + + set anchorY(value) { + this.uniforms.anchor[1] = value; + } + + get dimX() { + return this.uniforms.dimensions[0]; + } + + set dimX(value) { + this.uniforms.dimensions[0] = value; + } + + get dimY() { + return this.uniforms.dimensions[1]; + } + + set dimY(value) { + this.uniforms.dimensions[1] = value; + } +} + +FilterXRays.defaults = { + time: 0.0, + color: 0xFF8010, + divisor: 40, + intensity: 0.1, + blend: 8, + anchorX: 0.5, + anchorY: -1.0, + dimX: 1, + dimY: 1, +}; + + + + diff --git a/tokenmagic/fx/filters/proto/FilterProto.js b/tokenmagic/fx/filters/proto/FilterProto.js index a7143c1..42d5f87 100644 --- a/tokenmagic/fx/filters/proto/FilterProto.js +++ b/tokenmagic/fx/filters/proto/FilterProto.js @@ -1,4 +1,4 @@ -import { objectAssign, getPlaceableById } from "../../../module/tokenmagic.js"; +import { objectAssign, getPlaceableById, getMinPadding } from "../../../module/tokenmagic.js"; PIXI.Filter.prototype.setTMParams = function (params) { this.autoDisable = false; @@ -9,7 +9,7 @@ PIXI.Filter.prototype.setTMParams = function (params) { this.dummy = false; objectAssign(this, params); if (!this.dummy) { - this.originalPadding = this.padding; + this.originalPadding = Math.max(this.padding, getMinPadding()); this.assignPlaceable(); this.activateTransform(); } @@ -24,7 +24,6 @@ PIXI.Filter.prototype.getPlaceableType = function () { } PIXI.Filter.prototype.calculatePadding = function () { - if (this.gridPadding > 0) { var imgSize = Math.max(this.placeableImg.width, this.placeableImg.height); var toSize = (canvas.dimensions.size >= imgSize @@ -44,20 +43,6 @@ PIXI.Filter.prototype.calculatePadding = function () { } } -PIXI.Filter.prototype.verifyPadding = function () { - // TODO - //var paddings = PIXI.Filter._paddingObject; - //if (paddings.hasOwnProperty(this.placeableId)) { - // if (!(paddings[this.placeableId] == null) && this.currentPadding < paddings[this.placeableId]) { - // this.currentPadding = 0; - // } else { - // paddings[this.placeableId] = this.currentPadding; - // } - //} else { - // paddings[this.placeableId] = this.currentPadding; - //} -} - PIXI.Filter.prototype.assignPlaceable = function () { if (this.placeableType === "Token") { let parent = canvas.tokens.placeables.find(n => n.id === this.placeableId); @@ -84,7 +69,6 @@ PIXI.Filter.prototype.filterTransform = function () { this.placeableImg.parent.zIndex = this.zIndex; } - //this.verifyPadding(); this.padding = this.currentPadding; if ("handleTransform" in this) { @@ -94,7 +78,7 @@ PIXI.Filter.prototype.filterTransform = function () { PIXI.Filter.prototype.normalizeTMParams = function () { - if (this.hasOwnProperty("animated")) { + if (this.hasOwnProperty("animated") && !(this.animated == null) ) { // Normalize animations properties Object.keys(this.animated).forEach((effect) => { @@ -160,8 +144,8 @@ PIXI.Filter.prototype.normalizeTMParams = function () { if (!this.anime.hasInternals(effect)) { this.anime.initInternals(effect); } + + this.anime.animated = this.animated; }); } -} - -//PIXI.Filter._paddingObject = {}; \ No newline at end of file +} \ No newline at end of file diff --git a/tokenmagic/fx/glsl/fragmentshaders/forcefield.js b/tokenmagic/fx/glsl/fragmentshaders/forcefield.js index b339373..0b34634 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/forcefield.js +++ b/tokenmagic/fx/glsl/fragmentshaders/forcefield.js @@ -601,7 +601,7 @@ void main() } else if (shieldType == 11) { result = grid(uv*5.*scale); } else if (shieldType == 12) { - result = galaxy(uv*5.*scale)*2.; + result = galaxy(uv*5.*scale); } else if (shieldType != 1) { result = vec4(color,1.); } @@ -629,10 +629,6 @@ void main() vec4 final = clamp(ambientLight(clamp(colorized, 0., 1.)*intensity, uv, posLight-vec2(0.5,0.5)),0.,1.); - //if ( r <= 1. && pixel.a < 1. ) { - // pixel.rgb = vec3(1.); - //} - gl_FragColor = r > 1.0 ? pixel*(1.-a) diff --git a/tokenmagic/fx/glsl/fragmentshaders/liquid.js b/tokenmagic/fx/glsl/fragmentshaders/liquid.js new file mode 100644 index 0000000..2dc016c --- /dev/null +++ b/tokenmagic/fx/glsl/fragmentshaders/liquid.js @@ -0,0 +1,103 @@ +export const liquid = ` +precision mediump float; +precision mediump int; + +uniform sampler2D uSampler; +uniform float time; +uniform float intensity; +uniform float scale; +uniform int blend; +uniform bool spectral; +uniform vec3 color; + +varying vec2 vFilterCoord; +varying vec2 vTextureCoord; +varying vec4 vInputSize; +varying vec4 vOutputFrame; + +#define PI 3.14159265359 + +#define NUM_OCTAVES 3 + +float rand(vec2 n) { + return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453); +} + +float noise(vec2 p){ + vec2 ip = floor(p); + vec2 u = fract(p); + u = u*u*(3.0-2.0*u); + + float res = mix( + mix(rand(ip),rand(ip+vec2(1.0,0.0)),u.x), + mix(rand(ip+vec2(0.0,1.0)),rand(ip+vec2(1.0,1.0)),u.x),u.y); + return res*res; +} + +float fbm(vec2 x) { + float v = 0.0; + float a = 0.5; + vec2 shift = vec2(100); + mat2 rot = mat2(cos(0.5), sin(0.5), -sin(0.5), cos(0.50)); + for (int i = 0; i < NUM_OCTAVES; ++i) { + v += a * noise(x); + x = rot * x * 2.0 + shift; + a *= 0.5; + } + return v; +} + +vec4 blenderVec3(int blend, vec4 fColv4, vec3 sCol) +{ + vec3 fCol = vec3(fColv4); + 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 + 0.00001); } + else if (blend == 12) { fCol = 1.0 - (1.0 - fCol) / sCol + 0.00001; } + else if (blend == 13) { fCol = max(fCol,sCol)-(min(fCol,sCol)*0.5)+abs(fCol-sCol);} + else if (blend >= 14) { fCol = fCol + sCol; } + + return vec4(fCol,fColv4.a); +} + +void main() { + + float distortion1 = fbm( + vec2( fbm( vFilterCoord * 2.5 * scale + time/2.), + fbm( (-vFilterCoord - vec2(0.01)) * 5. * scale + time/3.) ) + ); + + float distortion2 = fbm( + vec2( fbm( -vFilterCoord * 5. * scale + time/2.), + fbm( (vFilterCoord + vec2(0.01)) * 2.5 * scale + time/3.) ) + ); + + 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 -= vec2(0.036,0.81); + + vec2 mappedCoord = (uv*vOutputFrame.zw) / vInputSize.xy; + + vec4 pixel = texture2D(uSampler, mappedCoord); + vec3 aColor = color; + aColor.rgb *= min(distortion1,distortion2); + pixel.rgb += aColor*intensity; + + float a = pixel.a; + + if (spectral) pixel.a = max(distortion1,distortion2)*3.75; + + gl_FragColor = blenderVec3(blend,pixel,color/3.) * 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 new file mode 100644 index 0000000..90aac4e --- /dev/null +++ b/tokenmagic/fx/glsl/fragmentshaders/magicglow.js @@ -0,0 +1,171 @@ +export const magicGlow = ` +precision mediump float; + +uniform sampler2D uSampler; +uniform float time; +uniform float scale; +uniform float auraIntensity; +uniform float subAuraIntensity; +uniform float threshold; +uniform int auraType; +uniform bool holes; +uniform vec2 thickness; +uniform vec4 color; +uniform vec4 filterArea; +uniform vec4 filterClamp; + +varying vec2 vTextureCoord; +varying vec2 vFilterCoord; + +const int NUM_OCTAVES = 4; +const float PI = 3.14159265358; +const float TWOPI = 6.28318530717; +const float MAX_TOTAL_ALPHA = 17.2787595915; + +float rand(vec2 uv) +{ + return fract(sin(dot(uv.xy ,vec2(12.9898,78.233))) * 43758.5453); +} + +float noise(vec2 p) +{ + vec2 ip = floor(p); + vec2 u = fract(p); + u = u*u*(3.0-2.0*u); + + float res = mix( + mix(rand(ip),rand(ip+vec2(1.0,0.0)),u.x), + mix(rand(ip+vec2(0.0,1.0)),rand(ip+vec2(1.0,1.0)),u.x),u.y); + return res*res; +} + +float fbm(vec2 x) +{ + float v = 0.0; + float a = 0.5; + vec2 shift = vec2(100); + mat2 rot = mat2(cos(0.5), sin(0.5), -sin(0.5), cos(0.50)); + for (int i = 0; i < NUM_OCTAVES; ++i) { + v += a * noise(x); + x = rot * x * 2.0 + shift; + a *= 0.5; + } + return v; +} + +vec4 outlining() +{ + vec4 ownColor = texture2D(uSampler, vTextureCoord); + vec4 curColor; + float maxAlpha = 0.; + vec2 displaced; + for (float angle = 0.; angle <= TWOPI; angle += 0.3141592653) { + displaced.x = vTextureCoord.x + thickness.x * cos(angle); + displaced.y = vTextureCoord.y + thickness.y * sin(angle); + curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw)); + maxAlpha = max(maxAlpha, curColor.a); + } + float resultAlpha = max(maxAlpha, ownColor.a); + return vec4((ownColor.rgb + color.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha); + +} + +vec4 glowing() +{ + vec2 px = vec2(1.0 / filterArea.x, 1.0 / filterArea.y); + + float totalAlpha = 0.0; + float outerStrength = 6.; + + vec2 direction; + vec2 displaced; + vec4 curColor; + + for (float angle = 0.0; angle < TWOPI; angle += 0.3141592653) { + direction = vec2(cos(angle), sin(angle)) * px; + + for (float curDistance = 0.0; curDistance < 10.; curDistance++) { + displaced = clamp(vTextureCoord + direction * + (curDistance + 1.0), filterClamp.xy, filterClamp.zw); + + curColor = texture2D(uSampler, displaced); + totalAlpha += (10. - curDistance) * curColor.a; + } + } + + curColor = texture2D(uSampler, vTextureCoord); + + float alphaRatio = (totalAlpha / MAX_TOTAL_ALPHA); + float outerGlowAlpha = alphaRatio * outerStrength * (1. - curColor.a); + float outerGlowStrength = min(1.0 - curColor.a, outerGlowAlpha); + + vec4 outerGlowColor = (outerGlowStrength * (color.rgba/10.) ); + + float resultAlpha = outerGlowAlpha; + return vec4(color.rgb * resultAlpha, resultAlpha); +} + +vec4 ripples(vec2 suv) +{ + suv.x += time/2.; + vec3 c1 = ( 0.0 ) * (color.rgb / 0.1); + vec3 c2 = vec3(c1); + vec3 c3 = vec3(c1); + vec3 c4 = vec3( color.r/0.2, color.g/0.3, color.b/0.5 ); + 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. ))); + //r.x += bornedCos(-0.3,-0.2); + //r.y += 200.*bornedSin(-1.9,1.9); + + vec3 c = color.rgb * ( + mix( c1, c2, fbm( p + r ) ) + mix( c3, c4, r.x ) - mix( c5, c6, r.y ) + ); + return vec4(c,1.); +} + +vec4 noisy(vec2 suv) +{ + vec4 noiseColor; + noiseColor.r = (color.r * noise(suv + fbm(suv) + time)); + noiseColor.g = (color.g * noise(suv + fbm(suv) + time)); + noiseColor.b = (color.b * noise(suv + fbm(suv) + time)); + noiseColor.a = 1.; + return clamp(noiseColor,0.,1.); +} + +void main(void) +{ + + vec4 pixel = texture2D(uSampler,vTextureCoord); + + if (pixel.a == 1.) { + gl_FragColor = pixel; + } else { + vec4 glowlevel = glowing(); + vec4 outlinelevel = outlining(); + vec4 aura; + + if (auraType <= 1) { + aura = ripples(vFilterCoord*20.*scale); + } else { + aura = noisy(vFilterCoord*20.*scale); + } + + vec4 effect; + effect = ((glowlevel*subAuraIntensity)/10.) + ((outlinelevel*auraIntensity)/1.25); + + 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.); + } + + gl_FragColor = pixel + effect * (1.-pixel.a); + } +} +`; \ No newline at end of file diff --git a/tokenmagic/fx/glsl/fragmentshaders/mirrorimages.js b/tokenmagic/fx/glsl/fragmentshaders/mirrorimages.js index 4c8d128..b8ba271 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/mirrorimages.js +++ b/tokenmagic/fx/glsl/fragmentshaders/mirrorimages.js @@ -29,6 +29,7 @@ vec4 blenderVec3(int blend, vec4 fColv4, vec4 sColv4) 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)); diff --git a/tokenmagic/fx/glsl/fragmentshaders/waves.js b/tokenmagic/fx/glsl/fragmentshaders/waves.js index e05f1ba..babb666 100644 --- a/tokenmagic/fx/glsl/fragmentshaders/waves.js +++ b/tokenmagic/fx/glsl/fragmentshaders/waves.js @@ -50,8 +50,4 @@ void main() { gl_FragColor = col * pixel.a; } -`; - - - - +`; \ No newline at end of file diff --git a/tokenmagic/fx/glsl/fragmentshaders/xray.js b/tokenmagic/fx/glsl/fragmentshaders/xray.js new file mode 100644 index 0000000..ab2fd02 --- /dev/null +++ b/tokenmagic/fx/glsl/fragmentshaders/xray.js @@ -0,0 +1,66 @@ +export const xRay = ` +precision mediump float; +precision mediump int; + +uniform sampler2D uSampler; +uniform float time; +uniform float intensity; +uniform float divisor; +uniform int blend; +uniform vec2 dimensions; +uniform vec2 anchor; +uniform vec3 color; + +varying vec2 vFilterCoord; +varying vec2 vTextureCoord; + +#define PI 3.14159265359 + +vec4 blender(int blend, vec4 fColv4, vec4 sColv4) +{ + 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 = max(fCol,sCol)-(min(fCol,sCol)*0.5)+abs(fCol-sCol);} + else if (blend >= 14) { fCol = fCol + sCol; } + + return vec4(fCol,fColv4.a); +} + +void main() { + + vec4 pixel = texture2D(uSampler, vTextureCoord); + if (pixel.a==0.) { + gl_FragColor = pixel; + return; + } + + 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.))); + + beam = 2.* cos(beam / (PI / 5.)); + beam *= floor(fract(angle * divisor + sin(time - (len * 1.2) * 0.2)) *256.) / 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 result = blender(blend, pixel, color1); + + gl_FragColor = result*pixel.a; +} +`; \ No newline at end of file diff --git a/tokenmagic/lang/en.json b/tokenmagic/lang/en.json index edbd622..6c4989a 100644 --- a/tokenmagic/lang/en.json +++ b/tokenmagic/lang/en.json @@ -1,3 +1,7 @@ { - "TOKENMAGIC.TokenMagic": "TokenMagic" + "TMFX.TokenMagic": "TokenMagic", + "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." } diff --git a/tokenmagic/lang/fr.json b/tokenmagic/lang/fr.json index edbd622..3fd3878 100644 --- a/tokenmagic/lang/fr.json +++ b/tokenmagic/lang/fr.json @@ -1,3 +1,7 @@ -{ - "TOKENMAGIC.TokenMagic": "TokenMagic" +{ + "TMFX.TokenMagic": "TokenMagic", + "TMFX.useMaxPadding.name": "Effets 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." } diff --git a/tokenmagic/module.json b/tokenmagic/module.json index 50e4e45..385f516 100644 --- a/tokenmagic/module.json +++ b/tokenmagic/module.json @@ -2,7 +2,7 @@ "name": "tokenmagic", "title": "Tokenmagic", "description": "

Add graphic filters and animations on your tokens and tiles.

", - "version": "0.1.3d", + "version": "0.2.0", "compatibleCoreVersion": "0.6.5", "minimumCoreVersion": "0.6.0", "author": "SecretFire", @@ -11,6 +11,7 @@ ], "esmodules": [ "module/tokenmagic.js", + "module/proto/PlaceableObjectProto.js", "fx/Anime.js", "fx/glsl/vertexshaders/customvertex2D.js", "fx/glsl/fragmentshaders/removeshadow.js", @@ -24,6 +25,8 @@ "fx/glsl/fragmentshaders/smoke.js", "fx/glsl/fragmentshaders/forcefield.js", "fx/glsl/fragmentshaders/mirrorimages.js", + "fx/glsl/fragmentshaders/xray.js", + "fx/glsl/fragmentshaders/magicglow.js", "fx/filters/FilterBevel.js", "fx/filters/FilterAdjustment.js", "fx/filters/FilterAdvancedBloom.js", @@ -48,6 +51,9 @@ "fx/filters/FilterSmoke.js", "fx/filters/FilterForceField.js", "fx/filters/FilterMirrorImages.js", + "fx/filters/FilterXRays.js", + "fx/filters/FilterLiquid.js", + "fx/filters/FilterGleamingGlow.js", "fx/filters/proto/FilterProto.js" ], diff --git a/tokenmagic/module/proto/PlaceableObjectProto.js b/tokenmagic/module/proto/PlaceableObjectProto.js new file mode 100644 index 0000000..012c5fb --- /dev/null +++ b/tokenmagic/module/proto/PlaceableObjectProto.js @@ -0,0 +1,24 @@ + +PlaceableObject.prototype.TMFXaddFilters = async function (paramsArray) { + await window.TokenMagic.addFilters(this, paramsArray); +} + +PlaceableObject.prototype.TMFXupdateFilters = async function (paramsArray) { + await window.TokenMagic.updateFiltersByPlaceable(this, paramsArray); +} + +PlaceableObject.prototype.TMFXaddUpdateFilters = async function (paramsArray) { + await window.TokenMagic.addUpdateFilters(this, paramsArray); +} + +PlaceableObject.prototype.TMFXdeleteFilters = async function (filterId = null) { + await window.TokenMagic.deleteFilters(this, filterId); +} + +PlaceableObject.prototype.TMFXhasFilterType = function (filterType) { + return window.TokenMagic.hasFilterType(this, filterType); +} + +PlaceableObject.prototype.TMFXhasFilterId = function (filterId) { + return window.TokenMagic.hasFilterId(this, filterId); +} \ No newline at end of file diff --git a/tokenmagic/module/tokenmagic.js b/tokenmagic/module/tokenmagic.js index 9add523..51dd12d 100644 --- a/tokenmagic/module/tokenmagic.js +++ b/tokenmagic/module/tokenmagic.js @@ -22,7 +22,11 @@ import { FilterFlood } from "../fx/filters/FilterFlood.js"; import { FilterSmoke } from "../fx/filters/FilterSmoke.js"; import { FilterForceField } from "../fx/filters/FilterForceField.js"; 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 { Anime } from "../fx/Anime.js"; +import "./proto/PlaceableObjectProto.js"; const moduleTM = "module.tokenmagic"; @@ -51,23 +55,53 @@ export const FilterType = { smoke: FilterSmoke, flood: FilterFlood, images: FilterMirrorImages, - field: FilterForceField + field: FilterForceField, + xray: FilterXRays, + liquid: FilterLiquid, + xglow: FilterGleamingGlow }; -const graphics = new PIXI.Graphics(); - -// The FilterForceField is a huge shader : when loaded for the first time, you can take a coffee break. -// This piece of code solve the problem, while waiting for a cleaner solution. -// There is a better solution, no doubt. -export async function loadHeavyFilters() { - let params = - { - filterType: "field", - enabled: true, - dummy: true - }; - var filter = new FilterForceField(params); - graphics.filters = [filter]; +function i18n(key) { + return game.i18n.localize(key); +} + +export function registerSettings() { + game.settings.register("tokenmagic", "useAdditivePadding", { + name: i18n("TMFX.useMaxPadding.name"), + hint: i18n("TMFX.useMaxPadding.hint"), + scope: "world", + config: true, + default: true, + type: Boolean + }); + + game.settings.register("tokenmagic", "minPadding", { + name: i18n("TMFX.minPadding.name"), + hint: i18n("TMFX.minPadding.hint"), + scope: "world", + config: true, + default: 0, + type: Number + }); +} + +const sleep = m => new Promise(r => setTimeout(r, m)); + +export function isActiveModule(moduleName) { + return game.modules.has(moduleName) + && game.modules.get(moduleName).active === true; +} + +export function getMinPadding() { + return game.settings.get("tokenmagic", "minPadding"); +} + +export function isAdditivePaddingConfig() { + return game.settings.get("tokenmagic", "useAdditivePadding"); +} + +export function autosetPaddingMode() { + canvas.app.renderer.filter.useMaxPadding = !isAdditivePaddingConfig(); } export function log(output) { @@ -230,6 +264,29 @@ export function TokenMagic() { await placeable.setFlag("tokenmagic", "filters", placeableFlag); }; + async function addUpdateFilters(placeable, paramsArray) { + if (paramsArray instanceof Array && paramsArray.length > 0) { + for (const params of paramsArray) { + await addUpdateFilter(placeable, params); + } + } + }; + + async function addUpdateFilter(placeable, params) { + if (placeable == null + || params == null + || !params.hasOwnProperty("filterType") + || !FilterType.hasOwnProperty(params.filterType)) { + return; + } + + if (params.hasOwnProperty("filterId") && placeable.TMFXhasFilterId(params.filterId)) { + await updateFilterByPlaceable(params, placeable); + } else { + await addFilter(placeable, params); + } + }; + async function addFilters(placeable, paramsArray) { if (paramsArray instanceof Array && paramsArray.length > 0) { for (const params of paramsArray) { @@ -301,6 +358,14 @@ export function TokenMagic() { } } + async function updateFiltersByPlaceable(placeable, paramsArray) { + if (paramsArray instanceof Array && paramsArray.length > 0) { + for (const params of paramsArray) { + await updateFilterByPlaceable(params, placeable); + } + } + } + async function updateFilterByPlaceable(params, placeable) { var flags = placeable.getFlag("tokenmagic", "filters"); if (flags == null || !flags instanceof Array || flags.length < 1) { return; } // nothing to update... @@ -350,11 +415,53 @@ export function TokenMagic() { if (filterId == null) { await placeable.unsetFlag("tokenmagic", "filters"); } else if (typeof filterId === "string") { - var params = {}; - params.filterId = filterId; - params.destroy = true; - await updateFilterByPlaceable(params, placeable); + + var flags = placeable.getFlag("tokenmagic", "filters"); + if (flags == null || !flags instanceof Array || flags.length < 1) { return; } // nothing to delete... + + var workingFlags = new Array(); + flags.forEach(flag => { + if (flag.tmFilters.tmFilterId != filterId) { + workingFlags.push(duplicate(flag)); + } + }); + + if (workingFlags.length > 0) { + await placeable.setFlag("tokenmagic", "filters", workingFlags); + } else { + await placeable.unsetFlag("tokenmagic", "filters"); + } + } + }; + + function hasFilterType(placeable, filterType) { + if (placeable == null + || filterType == null + || !(placeable instanceof PlaceableObject)) { return null; } + + var flags = placeable.getFlag("tokenmagic", "filters"); + if (flags == null || !flags instanceof Array || flags.length < 1) { return false; } + + const found = flags.find(flag => flag.tmFilters.tmFilterType === filterType); + if (found === undefined) { + return false; } + return true; + }; + + function hasFilterId(placeable, filterId) { + if (placeable == null + || filterId == null + || !(placeable instanceof PlaceableObject)) { return null; } + + var flags = placeable.getFlag("tokenmagic", "filters"); + if (flags == null || !flags instanceof Array || flags.length < 1) { return false; } + + const found = flags.find(flag => flag.tmFilters.tmFilterId === filterId); + if (found === undefined) { + return false; + } + return true; }; // TODO : to improve @@ -390,6 +497,7 @@ export function TokenMagic() { function _assignFilter(placeable, filterInfo) { if (filterInfo == null) { return; } var workingFilterInfo = duplicate(filterInfo); + workingFilterInfo.tmFilters.tmParams.placeableId = placeable.id; var filter = new FilterType[workingFilterInfo.tmFilters.tmFilterType](workingFilterInfo.tmFilters.tmParams); setFilter(placeable, filter, filterInfo.tmFilters.tmParams); } @@ -405,6 +513,13 @@ export function TokenMagic() { } }; + function _singleLoadFilters(placeable) { + var filters = placeable.getFlag("tokenmagic", "filters"); + if (!(filters == null)) { + _assignFilters(placeable, filters); + } + }; + function _fxPseudoEqual(flagObject, filterObject) { function isObject(object) { @@ -452,24 +567,39 @@ export function TokenMagic() { var filters = placeable.getFlag("tokenmagic", "filters"); if (filters == null) { return; } + // Handling deleted filters + for (let anime of Anime.getAnimeMap().values()) { + var foundFilter = false; + filters.forEach((filterFlag) => { + if (anime.puppet.filterId === filterFlag.tmFilters.tmFilterId + && anime.puppet.filterInternalId === filterFlag.tmFilters.tmFilterInternalId + && anime.puppet.placeableId === filterFlag.tmFilters.tmParams.placeableId) { + foundFilter = true; + } + }); + + if (!foundFilter) { + Anime.removeAnimationByFilterId(data._id, anime.puppet.filterId); + this._clearImgFiltersByPlaceable(placeable, anime.puppet.filterId); + } + } + filters.forEach((filterFlag) => { if (filterFlag.tmFilters.hasOwnProperty("tmParams")) { - if (filterFlag.tmFilters.tmParams.hasOwnProperty("destroy") && filterFlag.tmFilters.tmParams.destroy) { - Anime.removeAnimationByFilterId(data._id, filterFlag.tmFilters.tmFilterId); - this._clearImgFiltersByPlaceable(placeable, filterFlag.tmFilters.tmFilterId); - } else { - var puppets = Anime.getPuppetsByParams(filterFlag.tmFilters.tmParams); - if (puppets.length > 0) { - for (const puppet of puppets) { - if (!_fxPseudoEqual(filterFlag.tmFilters.tmParams, puppet)) { - puppet.setTMParams(duplicate(filterFlag.tmFilters.tmParams)); - puppet.normalizeTMParams(); - } + var puppets = Anime.getPuppetsByParams(filterFlag.tmFilters.tmParams); + if (puppets.length > 0) { + // Handling modified filters + for (const puppet of puppets) { + if (!_fxPseudoEqual(filterFlag.tmFilters.tmParams, puppet)) { + puppet.setTMParams(duplicate(filterFlag.tmFilters.tmParams)); + puppet.normalizeTMParams(); } - } else { - _assignFilter(placeable, filterFlag); } + } else { + // Handling new filters + _assignFilter(placeable, filterFlag); } + } }); }; @@ -506,6 +636,8 @@ export function TokenMagic() { addFilterOnSelected: addFilterOnSelected, addFiltersOnSelected: addFiltersOnSelected, addFiltersOnTargeted: addFiltersOnTargeted, + addUpdateFilters: addUpdateFilters, + addUpdateFilter: addUpdateFilter, deleteFilters: deleteFilters, deleteFiltersOnSelected: deleteFiltersOnSelected, deleteFiltersOnTargeted: deleteFiltersOnTargeted, @@ -513,26 +645,33 @@ export function TokenMagic() { updateFilters: updateFilters, updateFiltersOnSelected: updateFiltersOnSelected, updateFiltersOnTargeted: updateFiltersOnTargeted, + updateFiltersByPlaceable: updateFiltersByPlaceable, updateFilterByPlaceable: updateFilterByPlaceable, + hasFilterType: hasFilterType, + hasFilterId: hasFilterId, _assignFilters: _assignFilters, _loadFilters: _loadFilters, _clearImgFiltersByPlaceable: _clearImgFiltersByPlaceable, _getAnimeMap: Anime.getAnimeMap, _updateFilters: _updateFilters, + _singleLoadFilters: _singleLoadFilters, }; } export const Magic = TokenMagic(); +Hooks.once("init", () => { + registerSettings(); +}); + Hooks.on("ready", () => { log("Hook -> ready"); window.TokenMagic = Magic; - loadHeavyFilters(); - //initSocket(); }); Hooks.on("canvasInit", (canvas) => { log("Hook -> canvasInit"); + autosetPaddingMode(); Anime.desactivateAnimation(); Anime.resetAnimation(); }); @@ -569,9 +708,46 @@ Hooks.on("deleteToken", (parent, doc, options, userId) => { } }); +Hooks.on("createToken", (scene, data, options) => { + log("Hook -> createToken"); + + if (!(scene == null) + && scene.id === game.user.viewedScene + && data.hasOwnProperty("flags") + && data.flags.hasOwnProperty("tokenmagic") + && data.flags.tokenmagic.hasOwnProperty("filters")) { + + var placeable = getPlaceableById(data._id, "Token"); + + (async () => { + await sleep(100); + Magic._singleLoadFilters(placeable); + })(); + } +}); + Hooks.on("updateToken", (scene, data, options) => { log("Hook -> updateToken"); - Magic._updateFilters(data, options, "Token"); + + if (options.hasOwnProperty("img") || options.hasOwnProperty("tint") + || options.hasOwnProperty("height") || options.hasOwnProperty("width") ) { + + var placeable = getPlaceableById(data._id, "Token"); + + // removing animations on this placeable + Anime.removeAnimation(data._id); + + // clearing the filters (owned by tokenmagic) + Magic._clearImgFiltersByPlaceable(placeable); + + (async () => { + await sleep(100); + Magic._singleLoadFilters(placeable); + })(); + + } else { + Magic._updateFilters(data, options, "Token"); + } }); Hooks.on("deleteTile", (parent, doc, options, userId) => { @@ -583,5 +759,24 @@ Hooks.on("deleteTile", (parent, doc, options, userId) => { Hooks.on("updateTile", (scene, data, options) => { log("Hook -> updateTile"); - Magic._updateFilters(data, options, "Tile"); + + if (options.hasOwnProperty("img") || options.hasOwnProperty("tint")) { + + var placeable = getPlaceableById(data._id, "Tile"); + + // removing animations on this placeable + Anime.removeAnimation(data._id); + + (async () => { + await sleep(100); + Magic._singleLoadFilters(placeable); + })(); + + } else { + Magic._updateFilters(data, options, "Tile"); + } +}); + +Hooks.on("closeSettingsConfig", () => { + autosetPaddingMode(); }); diff --git a/tokenmagic/packs/token-magic-portfolio.db b/tokenmagic/packs/token-magic-portfolio.db index b6a81db..32f53e9 100644 --- a/tokenmagic/packs/token-magic-portfolio.db +++ b/tokenmagic/packs/token-magic-portfolio.db @@ -1,94 +1,46 @@ -{"_id":"2zRNjnw7Ps26h5xz","name":"22 - Smoke Filter","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":"37aHASDQzFvbqmJG","name":"15 - Cosmic Ray Filter","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":"07 - Distortion Filter","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":"AHoBr50LyDjnphDw"} -{"_id":"As1JrHLEm38Nm667","name":"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":"CdFhWPKBMb5wj7cM","name":"11 - Blur Filter","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":"DCRnfJDBd25fOQxc","name":"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 Filter","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 Filter","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 Filter","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 Filter","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":"GvYp56Thtf3n9RYy","name":"01 - Bevel Filter","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 Filter","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":[]} -{"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":"HjzhkTFUng8sxWkH"} -{"_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":"OWgJD9lvBlDzXALz","name":"09 - Twist Filter","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":"VWTz2fKfSb6WK7Mo","name":"02 - Adjustment Filter","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":"YJjeB7N0L1rGfZD2","name":"18 - Electric Filter","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":"b5Enw7tEwfjDNHuY","name":"04 - Outline Filter","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 Filter","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":"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 Filter","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":"g7O4u4dTaWcnajW7","name":"05 - Glow Filter","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 Filter","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 Filter","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 Filter","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":"t2MjFs4cVUCYsbMr","name":"12 - Zoom Blur Filter","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":"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":"zCCp4x0EResFji7O","name":"21 - Flood Filter","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":[]} -{"name":"23 - Mirror Images Filter","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":"s01RgeSRy4En1aKP"} -{"name":"24 - 01 - HexaShield Filter","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":"EQ8Xz4hZbbUsNB7m"} -{"name":"24 - 02 - Fire Shield Filter","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":"ci0e7KxLl8IpjPRc"} -{"$$deleted":true,"_id":"EQ8Xz4hZbbUsNB7m"} -{"name":"24 - 01 - Hexa-Field Filter","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":"MBFPf6M4VdUdbMwp"} -{"$$deleted":true,"_id":"MBFPf6M4VdUdbMwp"} -{"name":"24 - T1 - Hexa-Force Filter","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":"sbP8KX50YRYtxVyB"} -{"$$deleted":true,"_id":"ci0e7KxLl8IpjPRc"} -{"name":"24 - T2 - Fire Shield Filter","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 - T3 - Poisoned Smoke Filter","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":"SSY0fjib0PgJaKEK"} -{"name":"24 - T4 - Earth Carapace Filter","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":"359Mw23cvaEDevkP"} -{"_id":"359Mw23cvaEDevkP","name":"24 - T4 - Earth Shell Filter","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":"sbP8KX50YRYtxVyB","name":"24 - T1 - Hexa Force Filter","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":[]} -{"name":"24 - T5 - Mega Earth Carapace (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":"LrfXNjrImAWK5Hb2"} -{"_id":"LrfXNjrImAWK5Hb2","name":"24 - T5 - 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":[]} -{"name":"24 - T6 - Air Bubble Filter","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":"6Do4AOxfbtCG8R4j"} -{"_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":"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":"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":"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":"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":"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":[]} +{"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":"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":"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":"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":"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":"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":"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":"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":"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":[]} +{"_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":"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":"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":"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":"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":"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":"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":"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 - T1 - 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":"IA3ofbRDpi3Rjgcy","name":"24 - T2 - 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":"SSY0fjib0PgJaKEK","name":"24 - T3 - 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":"359Mw23cvaEDevkP","name":"24 - T4 - 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":"LrfXNjrImAWK5Hb2","name":"24 - T5 - 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":"6Do4AOxfbtCG8R4j","name":"24 - T6 - 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":[]} -{"name":"24 - T7 - 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":"6ZIpqLC3agLw2Vgx"} -{"name":"24 - T8 - 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":"f74nx1SMT5m8RRn8"} -{"name":"24 - T9 - Water Shell","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":"aoqr6qPxif62zWLo"} -{"_id":"aoqr6qPxif62zWLo","name":"24 - T9 - 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":[]} -{"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":[]} -{"name":"24 - T11 - Grid Defense","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":"VuMHH9LMD51MNJzZ"} +{"_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":[]} -{"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"} -{"name":"24 - T13 - Neutral 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":"GHbWoqQWjeUjcStr"} -{"_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":"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":"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":"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":"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":[]} diff --git a/tokenmagic/updates/UPDATE-0.2.0.md b/tokenmagic/updates/UPDATE-0.2.0.md new file mode 100644 index 0000000..cc8f897 --- /dev/null +++ b/tokenmagic/updates/UPDATE-0.2.0.md @@ -0,0 +1,96 @@ +# Token Magic FX - Update v0.2.0-alpha + +*Added :* +- A copy of a token also copies the FX +- FX are now stored on prototype tokens (if you update your prototype with a FXified Token) +- An option panel is now available : + - You can desactivate additive padding in favor of max padding + - You can set a minimum padding for all applied FX + +*New FX :* +- An advanced Ray filter (with better quality than cosmic ray filter) + - blending options +- Another liquid filter (complementary with the flood filter) + - blending options + - spectral property +- A gleaming glow filter + - two glow types + - adjustable FX scale + - adjustable thickness + - and lot more options to create magical glows. + +The new filters have been added to the TokenMagic macro compendium. + +*Fixed issues :* +- autoDestroy property did not work properly (the effect was restored when reloading the scene) +- Freezing when updating image, dimensions or tint of a token. +- Freezing when updating image of a tile. +- An effect without animated properties could not be updated normally. +- The global animated property could not be unset (can be unset now with `animated: null`) + +## Filters handling + +*Added new functions :* + +To verify if a placeable has a filter with the specified `filterType` : +```javascript +TokenMagic.hasFilterType(,) + +// Example +... +if (TokenMagic.hasFilterType(myToken,"glow")) { + console.log("myToken has a glow filter."); +} +... +``` +To verify if a placeable has a filter with the specified `filterId` : +```javascript +TokenMagic.hasFilterId(,) + +// Example +... +if (TokenMagic.hasFilterId(myToken,"mySuperShadow_01")) { + console.log("myToken has my customized super shadow 1 filter."); +} +... +``` +Add or update filter(s) on a placeable. If a filter applied on an object has a filterType and a filterId identical to those found in the parameters, the values are updated with the new ones. Otherwise a new filter is created. +```javascript +(async) TokenMagic.addUpdateFilters(, ) +``` + +## PlaceableObject TMFX prototypes + +*Added new prototype functions in class PlaceableObject (Token, Tile, etc.), to facilitate coding :* + +```javascript +(async) .TMFXaddFilters() +(async) .TMFXupdateFilters() +(async) .TMFXaddUpdateFilters() +(async) .TMFXdeleteFilters(optional ) +.TMFXhasFilterType() +.TMFXhasFilterId() + +// Example 1 +let glowFunc = async function() { + + const tokens = canvas.tokens.placeables; + + for (const token of tokens){ + if (token.TMFXhasFilterId("funnyAlternateGlow")) { + await token.TMFXdeleteFilters("funnyAlternateGlow"); + } else { + let params = + [{ + filterType: "glow", + filterId: "funnyAlternateGlow", + color: Math.floor(Math.random() * 16777215), + animated: null + }]; + await token.TMFXaddUpdateFilters(params); + } + } +}; + +glowFunc(); +``` \ No newline at end of file