Search the Community
Showing results for tags 'event handling'.
-
Hello there, I'm pretty new in Houdini and want to script a measuring tool that I can use from the tool shelf or via a keyboard shortcut. So, I want to have the following behavior: Click shelf button ("ruler") Select first Point or Edge in Scene View (with edge/point snapping) Set marker on selected Point/Edge and draw a line with measured text in the scene. The line is the connection between the selected Point and the mouse. After selecting the second Point, the line, the measure text and markers should be visible for a short time and then vanish. So my main problem is that I don't know how I get the mouse or keyboard events into my tool script. I only know that I can check for a few key commands (Ctrl, etc). But I want to draw a line and update a distance text field depending on my current mouse position. So how do I get this live interaction? I already checked the tutorials about writing custom viewer states but they are all based on nodes in the network and need to be registered/unregistered at the install/uninstall event. I tried to move the logic of the simple state viewer tutorials into my tool script but was unsuccessful and never managed to receive any custom mouse or key events. The second thing is more of a workflow issue. How am I supposed to generate the geometry (markers, line, text field) and remove it afterward? Will these new nodes always be added to my network editor or is there a kind of temporary node network for it? A lot of questions but I hope someone can help me P.S. The link shows a measuring tool in use. It's more or less what I'm after https://www.youtube.com/watch?v=MIcUW9QFMLE&feature=youtu.be&t=299
- 2 replies
-
- shelf
- event handling
-
(and 1 more)
Tagged with: