Detect when user click on a button from a digital asset

   1510   1   0
User Avatar
Member
94 posts
Joined: April 2011
Offline
Hi everyone,
I have an issue with a tool I have to made. I need to detect when a user click on a specific digital asset. As I am not the owner of this asset, I can't modify the pythonModule to add the functionnality I want (which is updating a database when a particular button is pressed). So what I thought of doing is to first register a selectionCallback to know when the user selects this asset. Then, inside this callback, I tried to create a hou.ui.waitUntil() callback. It's kind of working, as soon as the user click on the button wich create a ROPNet with some nodes inside, my callback returns True.
The issue is that the wait callback is blocking the event, so the user can't deselect anything.
Here is a simple scene showing what I mean. All the code is inside the python source module.
Thanks for the help

Attachments:
Selection_Event.hiplc (85.3 KB)

User Avatar
Member
94 posts
Joined: April 2011
Offline
Hey everyone,
So I found a way to go around the wait until callback. So what I did was create a global event. As my HDA is creating a specific set of node, as soon as I select it, the previously made nodes are deleted. The, when the user presses the button, the nodes are created and the gloabal callback which is listening to their creation is detecting it as I want it
  • Quick Links