Hunter Tinney
Htinney
About Me
Connect
LOCATION
Not Specified
WEBSITE
Houdini Skills
Availability
Not Specified
Recent Forum Posts
Python Custom States - SceneViewer.selectGeometry() crashes Nov. 12, 2018, 11:41 p.m.
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:
Based on the error message, it seems like there something I need to do to support the hotkey?
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?
Access HDA embedded within HDA Nov. 12, 2018, 12:29 p.m.
Could you try hou.hda.installFile()? http://www.sidefx.com/docs/houdini/hom/hou/hda.html#installFile. [www.sidefx.com] I'm guessing it'll accept a filePath that points inside an HDA's sections. Just an idea.
Python Custom States - SceneViewer.selectGeometry() crashes Nov. 10, 2018, 9:20 p.m.
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.
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.
from __future__ import print_function import stateutils import parmutils import hou import traceback class DrawPoints(object): def __init__(self, state_name, scene_viewer): self.state_name = state_name self.scene_viewer = scene_viewer self._node = None self._pressed = False self._index = 0 def onEnter(self, kwargs): try: selection = self.scene_viewer.selectGeometry( prompt="Select curve", sel_index=0, allow_drag=False, quick_select=False, use_existing_selection=False, initial_selection=None, initial_selection_type=None, ordered=False, geometry_types=[hou.geometryType.Primitives,], primitive_types=[hou.primType.Polygon,], allow_obj_sel=False, allow_other_sops=False, consume_selections=True ) except Exception as error: print(traceback.print_exc()) template = hou.ViewerStateTemplate( "selectGeometryCrashes.pystate", "Draw Points", hou.sopNodeTypeCategory() ) template.bindFactory(DrawPoints)