Jump to content
Aaron Auty

New Operator - Default Colour and Shape

Recommended Posts

I am trying to set the default colour and shape of a new operator.

 

I have tried overriding this virtual function in OP_Operator for the color;

virtual UT_Color getDefaultColor() const;

 And this in OP_Operator for the shape;

virtual const UT_StringHolder &getDefaultShape() const;

For the return I tried some of the shapes as listed when you print them out using HOM, "bone", "light" etc

https://www.sidefx.com/docs/houdini/hom/hou/NetworkEditor.html#nodeShapes

 

I am creating a sop driver, so would like to mimic the defaults as seen on these kinds of nodes.

Any ideas on setting these?

Share this post


Link to post
Share on other sites
1 hour ago, Aaron Auty said:

I am trying to set the default colour and shape of a new operator.

(...)

Any ideas on setting these?

Doesn't it mirror HOM/Python? This should work:

SOP_MyNode::SOP_MyNode(OP_Network *net, const char *name, OP_Operator *op)
    : SOP_Node(net, name, op) {
    setUserData("nodeshape", "cloud", 1);
    setColor(UT_Color(UT_RGB, 1, 0, 0));
}

 

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

×