Hi !
Is there a way to make a custom popup menu (like the one on the “tab” key) to put my own script/command/asset and don't “polute” the factory one ?
Like this in Sofimage : http://rray.de/xsi/xpop/ [rray.de]
Thanks.
Custom Popup Menu
9151 5 3- julca
- Member
- 219 posts
- Joined: Oct. 2015
- Online
- Guillaume
- Staff
- 478 posts
- Joined: April 2014
- Offline
It is certainly possible.
Look at the following thread where a user created a really impressive modeling toolbox.
https://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=41478&start=50&postdays=0&postorder=asc&highlight= [sidefx.com]
Houdini ships with PySide built-in, so you can install a global Qt event filter and react to mouse clicks from Python.
https://srinikom.github.io/pyside-docs/PySide/QtCore/QObject.html#PySide.QtCore.PySide.QtCore.QObject.installEventFilter [srinikom.github.io]
You would need to do something like:
class KeyPressEater(QObject):
def eventFilter(self, obj, event):
if event.type() == QEvent.KeyPress:
print “Ate key press”, event.key()
return True
else:
# standard event processing
return QObject.eventFilter(self, obj, event)
keyPressEater = KeyPressEater(self)
hou.ui.mainQtWindow().installEventFilter(keyPressEater)
This code is untested and if it works, it will capture all the keyPress event leaving Houdini in a zombie state. Once you have the filter up and running and can hook any PySide code you want to it.
Look at the following thread where a user created a really impressive modeling toolbox.
https://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=41478&start=50&postdays=0&postorder=asc&highlight= [sidefx.com]
Houdini ships with PySide built-in, so you can install a global Qt event filter and react to mouse clicks from Python.
https://srinikom.github.io/pyside-docs/PySide/QtCore/QObject.html#PySide.QtCore.PySide.QtCore.QObject.installEventFilter [srinikom.github.io]
You would need to do something like:
class KeyPressEater(QObject):
def eventFilter(self, obj, event):
if event.type() == QEvent.KeyPress:
print “Ate key press”, event.key()
return True
else:
# standard event processing
return QObject.eventFilter(self, obj, event)
keyPressEater = KeyPressEater(self)
hou.ui.mainQtWindow().installEventFilter(keyPressEater)
This code is untested and if it works, it will capture all the keyPress event leaving Houdini in a zombie state. Once you have the filter up and running and can hook any PySide code you want to it.
- julca
- Member
- 219 posts
- Joined: Oct. 2015
- Online
- Anonymous
- Member
- 678 posts
- Joined: July 2005
- Offline
- julca
- Member
- 219 posts
- Joined: Oct. 2015
- Online
- Control_Vertex
- Member
- 161 posts
- Joined: May 2015
- Offline
-
- Quick Links