Adding paint sop capabilities to a HDA

   8084   6   3
User Avatar
Member
14 posts
Joined: Jan. 2009
Offline
I am creating an hda (otl) that I would like to add paint sop capabilities to. Does anyone know how to do this?

In type properties I have set the Default State to paint. This works as far as it prompts me in the view port with painting instructions, but I am not getting a brush.
Edited by ylindqui - Nov. 18, 2016 22:27:24
User Avatar
Member
49 posts
Joined: Sept. 2013
Offline
In order to use the paint capabilities of the node, you need to enter the state of the node.

One way to do this is to select the node even though its inside the HDA. In order to do this, create a button name it “Paint”, in Type Properties>>Parameters>>CallbackScript for the button type in hou.pwd().hdaModule().node( “nameOfThePaintNode” ).setSelected( True ) and switch language from Hscript to Python and in Type Properties>>Node>>EditableNodes type in the nameOfThePaintNode

So now pressing the button should enter the state of the paint node and let you paint!

Attachments:
paint0.JPG (37.9 KB)
paint1.JPG (53.4 KB)

User Avatar
Member
8 posts
Joined: Nov. 2015
Offline
Hi MrReedSmith,

If you cant please explain,

Can you tell me when you use the term hdaModule()?

I am a beginner in Houdini.

I can see that you have written hou.pwd().hdaModule().node( “nameOfThePaintNode” ).setSelected( True ) but in the screenshot it is
hou.pwd().node( “paint1” ).setSelected( True )

Thank you
User Avatar
Member
55 posts
Joined: March 2016
Offline
I put this on my callback script (python)

hou.pwd().hdaModule().node(paint_zoneID).setSelected(True)
I got this error message

SyntaxError: ('invalid syntax', ('<stdin>', 1, 28, ‘hou.pwd().hdaModule().node(\xe2\x80\x9c./paint_zoneID\xe2\x80\x9d).setSelected(True)\n’))
Edited by Gerardo Castellanos - Oct. 18, 2019 09:08:18
Gerardo Castellanos
www.gerardocastellanos.com
User Avatar
Member
2 posts
Joined: Feb. 2018
Offline
I´ve used this way, it´s really cool, just need to make suro the params in your topNode follow houdini conventions

https://www.sidefx.com/docs/houdini/nodes/sop_state/stroke.html [www.sidefx.com]
User Avatar
Member
146 posts
Joined: Sept. 2011
Offline
Gerardo Castellanos
I put this on my callback script (python)

hou.pwd().hdaModule().node(paint_zoneID).setSelected(True)
I got this error message

SyntaxError: ('invalid syntax', ('<stdin>', 1, 28, ‘hou.pwd().hdaModule().node(\xe2\x80\x9c./paint_zoneID\xe2\x80\x9d).setSelected(True)\n’))

I just got this error too Turns out it's the forum's fault - if you look carefully you'll see the quote marks in the snippet you cut and pasted are “smart quotes” - 66 and 99 - rather than good ole' fashioned code quotes. Delete them and retype them.

But besides that, I also had to remove the hdaModule() bit.

Depending on what your HDA needs to do, you probably need to move the display flag to your Paint SOP too, so my callback ended up looking like this:

hou.pwd().node("geo1/attribpaint2").setSelected(True);hou.pwd().node("geo1/attribpaint2").setDisplayFlag(True)

… plus I had to add a similar button to “finish” painting and move the Display flag back to the end of my network again.
User Avatar
Member
4 posts
Joined: Dec. 2017
Offline
For those still struggling, check this attribute paint masterclass at 54:00 https://youtu.be/gAT8ueaKAvs?t=3243 [youtu.be]
  • Quick Links