Fade in/out and vice-versa render TOPs after a trigger

Hello and first of all sorry for any duplicate-I searched the forum but I did not find an answer.
I’m working on a project where I render different 3d models in the scene and I have to fade in/out them when a certain movement is done with the hand (tracking it with leapmotion. Since I have different properties for the objects, I’m using separate rendering paths, which means that I end with 2 render TOP and comp them.
My idea was to detect the hand movement and act on the alpha of the Level component attached after each render, so one has to go up and the other down. Of course, after another different movement, they have to switch their verse.
I spent a whole day trying to figure out how to make this system, using CHOPs and Python, but I can not end up with a suitable solution. Seems like I am overcomplicating things and lack of some basics. Any help would be appreciated. Thanks!

After messing around I sorted out a way to realise the fade between the two models through a network of chops and scripts which produces two values (fade in/out) once it receives a trigger signal. These values I applied to the transparency of my render Tops. I was using the LeapMotion controller for this project, so I set the system to be triggered once a right to left swipe movement is detected by a homebrewed “gesture recognition” system. Both axis and direction can be easily changed: the former through selecting the corresponding vector output from the Leapmotion Chop; the latter, by changing the sign of the threshold component.
I attach the toe file and here is a link demonstrating the functioning of the system: https://www.enricodorigatti.com/wp-content/uploads/2022/07/InstallationPrototype.mp4
Hope it can help!
Transition.toe (6.4 KB)

Hi @cimmi,

very nice logic you have figured out!

There might be a simpler way for you to do this. Taking inspiration from your network I’m using a Trigger CHOP when the threshold is met. The Trigger CHOP is then passed into a Logic CHOP with the “Channel Pre OP” parameter set to Toggle - this will convert the incoming channel into something similar as a Toggle Button: on the first input trigger, the channel will go from 0 to 1 while on the next trigger, the channel will go from 1 to 0.
This can now be passed into a Fan CHOP which will output a range of channels that evaluate to 1 depending on the input value. For example an input value of 1 will set the second channel of the Fan CHOP to 1, an input value of 0 will set the first channel to 1.
Now all of this can be passed into the Lag and Filter setup you have.

To avoid retriggering before a certain amount of time (to let the fade finish) set the Trigger CHOP’s “Re-Trigger Delay” to an appropriate time. I believe there to be a bug where that parameter is only available if there is an input to the Trigger - but that is fine as you can simulate the whole thing easily by adding a momentary button as a input.

Attached is a little build out network which hopefully gives some hints on features that ease production.

Best
Markus
leapFader.tox (13.9 KB)

Thank you very much @snaut, I really appreciated it!
I’m new to TD so I still have to discover and deeply understand many objects and functionalities. I will take some time to study your implementation and re-use it in future projects.
Thanks!

Best
Enrico

1 Like

Hi @cimmi ,

that’s great and i hope the file can help with that. Please feel free to ask for clarifications!

Best success!
Markus

1 Like