Scripting question

I ended up creating a small black animated gif that turns on and off. Is there some way to offset when the gif animation plays so that when I duplicated this 50x, they dont all play in sync with each other? Trying to avoid creating multiple gifs.

This is just a guess, but you could hide all but one of them, then show them at staggered times, but I am unsure as to whether or not that would change their individual start times.

I would create a button offscreen named Hide_Lights and add a trigger to it, then inside that trigger add all of your hide actions. You can duplicate one action with Ctrl+D until you reach your total number, then run down the line of actions pointing to a different gif as you go. Having your gifs uniquely named will help here. F2 will let you quickly rename buttons in your Scene Structure.

You can add a trigger to the Scene to tap that button when the scene has been entered.

From there, copy that button and name it Show_Lights, then edit the actions in that buttons to Show instead of Hide, and add your time offsets going down the line.

You can add another trigger to the Scene to tap that second button when the scene has been entered, but delay it’s start by a fraction of a second.

You will have to play around with it a bit to get it working, and I’d suggest trying a really small sample to see if the gifs’ cycles are changed by staggering the times on your Show actions. I really hope this helps. Let me know how this works out.

That sounds insanely complicated. It doesnt look like the GIF is going to work anyway. No matter what I do, the animations all load when the scene loads, regardless if the image itself is turned off or not. Ive wasted all day on this so Im probably just going to give up on it and tell the client we cant do it. If this wasnt on a huge media wall thats 8k wide, id do it as a video but thats would be ridiculous at this size.

Fair enough. Best of luck!

Hi @trenken311,

I’m jumping in the thread after reading it quite in diagonal, but if I understood your scenario, you need to

  • show an asset (rectangle) for n seconds (ex: 3secs) with no animation
  • hide the asset for p seconds (ex: 2secs) with no animation
  • start again

If this is correct, it means each cycle lasts n + p seconds (ex: 5 secs).

You can create the following trigger that repeats indefinitely every 5 seconds

that calls

  • Show action, at 0s, no animation
  • Hide action, at 3s, no animation

The initial animation would start after 5 seconds, in this case.

Would this work for you or did I miss something?

Seb

2 Likes

I tried this and the rectangle starts with it being on, holds, turns off, then doesnt turn back on again. I have the settings exactly as you show above, unless something is different on one of the actions that you didnt screenshot. I was confused why there is both an elapsed and inactive timers. I don’t really get what this is doing.

Hi @trenken311,

You’ll find the full explanation in this article, but long story short:

The main difference between the two timers is the Simple Timer can only be stopped when its associated scene, asset or collection becomes hidden while the the Inactivity Timer can be stopped either when it’s associated item becomes hidden or if any interaction event (e.g. touch or gesture) occurs.

On the trigger side, did you check “Repeat indefinitely” after selecting the “Timer has elapsed”?

Seb

2 Likes

Ok so I actually have it working now. I didnt realize the inactive timer needs to go on the scene layer, not on the rectangle.

So why do we need 2 timers, one on the rectangle and one on the scene?

I was hoping whatever scripting I do to turn this rectangle on and off could only be on the rectangle, because I need to duplicate this rectangle about 100x.

Can you explain why you have to do that and give some details?
Usually, there’s always a better way to implement or structure data to avoid repeated copy/pasting for a layout, through Data Feeds on Collection for instance.

Are you planning to simulate 100ish window squares lighting on/off randomly?! :worried:

1 Like

Yes I have a city scene which is up on a huge media wall, 8 hdtv’s, and need to animate the lights turning on and off just to add some life to the scene. I dont have to go too crazy with it, just some random lights turning on and off here and there so it’s not like its even close to most of the lights, but ill still need to do a lot just because of the size of the city.

I dont know how data feeds work. I was originally just handling creating all the design assets, and someone else built it, but he is leaving the firm so now Im having to learn the software.

Maybe Intuiface isn’t the best tool to do that if you have 100+ instances to deal with.
A transparent gif with all windows animations, cycling, and inserted inside you scene in an Image Asset could be easier to implement.

1 Like

I actually tried that already and even doing show/hide with the gifs, they all seemed to start playing when the scene is loaded, so they were all synchronized with each other. I couldnt find a way to offset the gif animations without creating a bunch of different gifs which I was trying to avoid.

I mean one single large gif containing all the small animated “windows lights” that you put over your city background with all the buildings. It won’t be random, but with a gif sequence long enough, it shouldn’t catch the eye.

2 Likes

Ahhh one gif. I see what youre saying.

Well the large single gif wont work. Because this is for a huge media wall, Im getting a warning saying intuiface doesnt support animated gifs with more than 2 million pixels.

I agree with @Alex here, building the animation in Intuiface might not be the best option. I’d consider building it in After Effects (or equivalent) and export it as a video background.

Building it in Intuiface, I’d probably think about hiding/moving/showing ~10 rectangles instead of just hiding/showing 100, to optimize the number of elements loaded in the scene. Using an Excel data feed could help to automate the process, but that’s not the best designer-friendly approach.

1 Like

Sounds like that might actually be the only way to do this. I tried making one large GIF of the entire animation, and when I try to import, IF tells me it’s limited to 2 million pixels. Guess it doesnt like that Im trying to do a GIF this large for an 8k wall.

Oof! That sounds painfully big. Can you import your cityscape (no windows) as a .png, and then import just the windows turning on/off by themselves as a .gif? That might help bring down the size. Then you can layer the .gif over the .png

Edit: I just thought! You could even break down the animated windows down into regions of the screen, then import say 8 .gifs that when placed side by side cover the wall, instead of one large .gif. Hope this helps!