Creating geometry inside of a Viewer State

   713   1   1
User Avatar
Member
3 posts
Joined: Sept. 2018
Offline
Hello,

I am trying to create a single node with a custom viewer state that adds geometry when clicking, similar to Houdini's native curve editor.

Using the following code sample, I am able to click in the scene and append points to a multi-parameter:
https://www.sidefx.com/docs/houdini/hom/state_node.html [www.sidefx.com]
Image Not Found


However, as soon as I attempt to modify geometry on the node (rather than just changing parameters), I get the following error:
GeometryPermissionError: Geometry is read-only.

Here is the code I added to the viewer state's onMouseEvent:
node = self._node = kwargs["node"]
geo = node.geometry()
geo.createPoint()

How can I get the node's modifiable geometry inside of the viewer state?

Thank you

Attachments:
CustomCurveTool.hipnc (48.4 KB)

User Avatar
Staff
396 posts
Joined: Feb. 2018
Offline
You can't modify input node geometries from a state, the HOM geometry API always return a read-only object. Editing a geometry needs to take place in the node network instead.
  • Quick Links