|On this page|
Making your own stroke node
If you want your Geometry node asset to have this interaction (that is, allow the user to create strokes in the 3D view and then do something with the stroke geometry), do the following:
In your asset’s type properties, click the Node tab, then set the Default state to
strokestate sets the values of several
stroke_*parameters on your HDA as you draw strokes. Your node should have those parameters so the state can set them. The usual, and most convenient, way of doing this is to creating a Draw Curve geometry node inside your asset and promoting all of its
stroke_*parameters onto your asset.
In the geometry network inside your asset, use the curves output from the Draw Curve node to drive the node’s operation. The curves have useful primitive and point attributes, such as pressure and angle information if the user drew the stroke with a tablet.
The stroke state will look for spare parameters (usually hidden) on your node with the following names, and if they exist, use their values to customize the operation:
Should contain an integer specifying which input to use as the geometry to draw on (stating at
Should contain a string which the state will display to the user to in the viewer. For example,
Draw on the surface to style the fur.
The stroke state will look for spare parameters (usually hidden action button parameters) on your node with the following names, and if they exist, run the parameter’s callback script in response to certain events. See parameter callback scripts for more information.
Runs before Houdini fills in the stroke parameters after the user completes a stroke.
Runs after Houdini fills in the stroke parameters after the user completes a stroke.
poststroke are enough to get the operation you want. However, if you need more finely-grained events as the user draws, you can create this parameter. Houdini will run its callback script with an extra
event key in the
kwargs dictionary indicating what event happened.
Currently the stroke state has