If you set the interval on a Trigger Component sufficiently small enough (<= 10ms) and connect it to a simple C# script that is meant for incrementing a number every time it is updated by the Trigger component, it becomes hard or impossible to stop the Trigger component the normal way. I have to start mashing the escape key rapidly to have any hope of stopping the Trigger Component. I have done this type of thing before, when the Trigger component was called the Timer component, and definitely did not have this issue.
Steps to reproduce:
- Make a new Grasshopper file.
- Place a Trigger Component down on the canvas, set interval to 10ms or less (1ms if you really want to experience this bug)
- Place a C# script component down on the canvas.
- In the C# script, create a double with a value of 0 outside of the RunScript function. In the RunScript function, simply add a value to the double, and output it from the script component.
- Exit the C# script component, hit run on the Trigger component.
- Try to pause or stop the Trigger component. Observe how difficult it is, you have to time it between re-triggers. If you picked 1ms as your interval, good luck timing that. The only way to get it to stop, for me, has been to repeatedly mash the ESC key as fast as I can, then I can actually hit the pause button on the Trigger component.
Please check the attached file to see this happen. I can reliably reproduce this. IDK what is going on, but it seems like the Timer component used to “listen” for the user clicking pause at all times, whereas the Trigger component only has a brief moment between triggers to “listen” for that, or something like that.
Trigger Bug.gh (10.5 KB)