How to retrieve the position of point from snappingRay()

   798   0   0
User Avatar
Member
13 posts
Joined: May 2014
Offline
Referring to the below example, I can figure out the point index that the mouse cursor is currently snapping to, but does anyone know how to retrieve its position using the dictionary returned from `UIEvents.snappingRay()`?

https://www.sidefx.com/docs/houdini/hom/state_events.html#snap [www.sidefx.com]

def onMouseEvent(self, kwargs):
    ui_event = kwargs["ui_event"]
    snap_dict = ui_event.snappingRay()

    if snap_dict["snapped"] and snap_dict["geo_type"] == hou.snappingPriority.GeoPoint:
        self.log("You snapped to a point:")
        self.log(snap_dict["point_index"])
        # How to retrieve the position by using snap_dict?
  • Quick Links