I'm experimenting with the new python custom states. I tried to implement the “Select Geometry” method (http://www.sidefx.com/docs/houdini/hom/hou/SceneViewer.html#selectGeometry) in the OnEnter() part of my custom state. When I enter my HDA's custom state, it asks for the correct geometry selection, and then crashes when the geometry selection is complete.
I'm curious as to whether I am approaching this in the correct manner. I would like to have a sequence of selections (much like what is done in Tool Scripts). Here's my code, and I have attached the HIP file as well.
Htinney I'm experimenting with the new python custom states. I tried to implement the “Select Geometry” method (http://www.sidefx.com/docs/houdini/hom/hou/SceneViewer.html#selectGeometry) in the OnEnter() part of my custom state. When I enter my HDA's custom state, it asks for the correct geometry selection, and then crashes when the geometry selection is complete.
I'm curious as to whether I am approaching this in the correct manner. I would like to have a sequence of selections (much like what is done in Tool Scripts). Here's my code, and I have attached the HIP file as well.
Thanks for the suggestion, and the HIP file! Seeing the code certainly helps When I run the HIP file on my instance of Houdini, I have trouble with the operator when it runs OnInstall:
Traceback (most recent call last):
File "opdef:/Sop/test_selecting?OnInstall", line 5, in <module>
File "/opt/hfs17.0.352/houdini/python2.7libs/stateutils.py", line 600, in wrapper
return func(*args,**kwargs)
File "opdef:/Sop/test_selecting?PythonModule", line 59, in createViewerStateTemplate
File "/opt/hfs17.0.352/houdini/python2.7libs/stateutils.py", line 782, in debug
trace= hotkey(state_typename, 'trace', '6', 'Trace callbacks', 'Enable trace for callbacks', state_cat)
File "/opt/hfs17.0.352/houdini/python2.7libs/stateutils.py", line 751, in hotkey
hotkey_context= context(state_cat)
File "/opt/hfs17.0.352/houdini/python2.7libs/stateutils.py", line 749, in context
raise hou.TypeError('Unsupported hotkey type: %r' % (state_cat))
TypeError: Invalid type.
Unsupported hotkey type: <hou.NodeTypeCategory for Sop>
Based on the error message, it seems like there something I need to do to support the hotkey?