I’ve been working on a script with some buttons in the UI, and I’ve found that for some reason after the first time clicking it, the button stops working if I’m using frame.current() anywhere in the function that’s getting executed.
I’ve created a simple version of the script to demonstrate the issue (ButtonUI.js). Note: it uses a ui file to lay out the gui (ButtonUI.ui).
Place both in your scripts directory, and execute.
A window will pop up with a button.
Click it once, and the current frame will output to the message log. Click a second time… nothing.
Replace frame.current() with “5” or something like that, and it works consistently.
Here are the files on github:
https://github.com/shhlife/harmony/blob/NC_Tween/ButtonUI.js
https://github.com/shhlife/harmony/blob/NC_Tween/ButtonUI.ui