Mouse position in python state drag_and_drop

   1469   1   0
User Avatar
Member
2 posts
Joined: Oct. 2018
Offline
Hello guys
I was trying to get the prim where my mouse is on in the scene viewer in python drag and drop mode. Any hou api?

I was also trying to use the locateScenegraphPrim to find the prim, but cannot get the mouse position in drag and drop. There is no ui_event in kwargs for drag and drop, so how to get the mouse position?Seems the onMouseEvent can not be run in drag and drop mode.

Thank you!
User Avatar
Staff
450 posts
Joined: Feb. 2018
Offline
There is no mouse position in the DnD callbacks kwargs but you can use Qt to get it like this:

import PySide2.QtGui as QtGui
pos = QtGui.QCursor.pos()
  • Quick Links