Jump to content

Custom viewport manipulators/handles for custom SOPs

Recommended Posts

I haven't been able to find any examples of custom SOP's that include custom handles or manipulators in the 3D viewport, but there are some build in SOPs that use custom manipulators. For example, PolyExtrude has a line that, when clicked and dragged, changes the depth value. Other examples are Edit, Paint, Spay Paint nodes. I'm interested in making a cumulative node that would manipulate/alter the geometry by a custom viewport handle.

Can someone point me in the right direction? Is this even possible to do with HDK or python API?

Edited by millag
Link to comment
Share on other sites

I found these on GitHub; the author is using MSS_ReusableSelector:

These aren't quite like the PolyExtrude manipulator, but maybe they'll be helpful in figuring it out. Good luck!

Link to comment
Share on other sites

  • 2 months later...

A bit late, but there's a few choices for custom handles, though I'm not sure how to create custom manipulators that would work the same as the built in ones (meaning they would show up in the handles section for the HDAs). 

The MSS_CustomBrushState sample shows how to create a paint node.

The ways Houdini implements handles, is with 'states'(BM/BM_State is a good place to look to learn a bit more).   States are event handlers, tied to specific nodes, all nodes have them but most only have a generic implementation.  If you register a state(MSS_SingleOpState is the best choice for a SOP, though BM_SingleOpState will work for OBJs and SOPs but is a bit more effort to work with) , and specify the name of the node, the state automatically associates with it (just select the node and hit enter in the viewport), you can create states for custom HDA's and even override states for built in nodes.

States can also handle rendering, so by creating a state, rendering a custom handle and defining the interactions and plugging the resulting values into parms you can create a completely customized handle for any type of node.  This is basically how Houdini handles are implemented but I think there are a few missing pieces preventing the creation of a proper handle though.

You could also create a DM_MouseHook and DM_SceneHook to create and render anything you wanted without it being tied to any particular node type.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...