Jump to content
millag

Custom viewport manipulators/handles for custom SOPs

Recommended Posts

millag    1

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

Share this post


Link to post
Share on other sites
Stalkerx777    75

Haven't looked at it awhile, maybe it became possible to code your own handles nowadays, but I highly doubt about that.

Share this post


Link to post
Share on other sites
millag    1

:( that's disappointing. How about the build in brush handle can I attach to it and handle input by myself?

Share this post


Link to post
Share on other sites
goldleaf    57

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!

Share this post


Link to post
Share on other sites

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 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×