Aaron Auty Posted April 24, 2021 Share Posted April 24, 2021 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? Quote Link to comment Share on other sites More sharing options...
symek Posted April 24, 2021 Share Posted April 24, 2021 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)); } Quote Link to comment Share on other sites More sharing options...
Aaron Auty Posted April 25, 2021 Author Share Posted April 25, 2021 This works, brilliant, thanks Symek! A lovely red cloud of a node Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.