Bind Effects

I want to bind the blur effect on an image to a timer. For example, timer starts at 15 seconds

If remaining seconds > 10, set blur to 0.30
Else if remaining seconds > 5, set blur to 0.60
Else if remaining seconds = 0, set blur to 1.00

Is there away to have ELSE IFs in custom script? If not, how do I achieve that?
Not sure how to bind just the blur effect with a custom script because it’s grouped with the other effects.

Thanks

Hi @abijaudi,

You can use conditional triggers on the Countdown trigger “Seconds changed”.

Set multiple trigger/actions like:

  • WHEN (“Seconds changed” AND Seconds>10) THEN set blur to 0.3
  • WHEN (“Seconds changed” AND Seconds<5 AND Seconds>0) THEN set blur to 0.6
  • WHEN (“Seconds changed” AND Seconds=0) THEN set blur to 1.00

Kind regards,

Alex.

2 Likes

Hi @abijaudi,

Another option using only bindings and a custom script converter could be a script like below. Bind the Effects property on your timer seconds value, and this script converter (I changed your values to better see the effect)

var blur = 0;
if (INPUT >= 10)
blur = 0.5
else if (INPUT >= 5 && INPUT < 10)
blur = 2
else if (INPUT > 0 && INPUT < 5)
blur = 3
else if (INPUT == 0)
blur = 4

"<EffectsCollection><Blur Radius=\""+blur+"\" /></EffectsCollection>" 

Tested only on Player for Windows.

1 Like

I’d like to bind the blur effect of an object to an Excel cell. Is there a specific syntax I should use to store the blur value in Excel? I’m a bit confused since one binding seems to serve multiple effects. Thanks

1 Like

Hey @tosolini,

I once asked this question but thanks to @Mihai for his response below many moons ago:

Effects cannot be bound individually. In other words, you can only bind effects (as a whole) to other asset’s “effects”, while they allow this binding type in Composer, it will not work as you cannot bind each effect in particular.

It should work if your excel cell has contains the entire effects information such as below:

<EffectsCollection>
<Blur Radius="1" />
<Grayscale Factor="1" />
<Sepia Factor="2" />
<HueRotate Angle="2" />
<Brightness Factor="99" />
</EffectsCollection>

It seems to be a limitation with the effects side of things.

2 Likes

@Promultis Thanks much for the speedy answer! I’ll give it a try

1 Like

You should be able to enter only your Blur effect inyour Excel sheet, based on the converter I wrote above in this thread.
Something like

<EffectsCollection><Blur Radius="10" /></EffectsCollection>

I didn’t test that, so let me know if that works for you.

3 Likes

@Seb I can confirm that just adding the individual effect in an excel sheet (as you wrote) works well. Thanks all!

3 Likes