

intersectPlane ( cplane_origin, cplane_normal, ray_origin, ray_dir ) # Grab a reference to a scene viewer's construction plane. transposed () # Use convenience function in hmath to find intersection return hou.

Vector3 ( 0, 0, 0 ) * xform # type: hou.Vector3 cplane_normal = hou. We can multiply the current transform matrix by # those vectors to get the current origin and normal. transform () # type: hou.Matrix4 # The "rest" position for the construction plane has origin=0, 0, 0 # and normal=0, 0, 1. constructionPlane () # Get the construction plane's transform matrix xform = cplane. Returns a hou.Vector3 representing the point in world space, # or raises an exception if the ray does not hit the plane # Grab a reference to the construction plane cplane = scene_viewer. # In stateutils def cplaneIntersection ( scene_viewer, ray_origin, ray_dir ): # Find the intersection between the pointing ray and the construction # plane. For information on capturing hotkeys, see Python state menu hotkeys The UI device object has useful methods for detecting modifier keys and arrow keys. To set up a right-click context menu for your custom state, see Python state menu. You can intersect this pointing ray with the geometry to know what is under the mouse pointer at that moment. While your state is active, in your mouse event handler you can get a ray (a directional line) from the mouse “into” the screen. You can implement the onMouseEvent callback to handle low-level events. However, sometimes you want the ability to interpret lower-level user input such as mouse moves, button presses, mouse wheel clicks, tablet tilt and pressure, and so on. Handles can be very powerful on their own, letting you specify a ready-made user interface for a wide variety of parameter setups. The standard way to allow user interaction with a node is to bind handles to node parameters in a node’s state.
PROCESSING PYTHON MOUSEX HOW TO
(See Python states for the basics of how to implement a custom viewer state.)
