Scripting: Is there a way to use PolyExtrude as a nodeVerb?

   1867   7   1
User Avatar
Member
27 posts
Joined: 3月 2020
Offline
Using Python. Is there a way to use PolyExtrude as a nodeVerb? hou.sopNodeTypeCategory().nodeVerb('polyextrude::2.0')return None.

I know I can use createNode() or createOutputNode() but I don't want an actual node on the graph. I would prefer to use nodeVerb because I have a set of actions I want to execute on a list of objects (created via nodeVerb) so creating nodes is not ideal. My set of actions will be in a function. I intend to loop through the objects, passing in the object geometry into my function.

Something like:
node = hou.pwd()
parentGeo = node.geometry()
parentGeo.clear()

geo = hou.Geometry()
verb = hou.sopNodeTypeCategory().nodeVerb('box')
verb.execute(geo, [])

# PolyExtrude goes here...

parentGeo.merge(geo)

Or is there another way that doesn't require creating nodes?
User Avatar
Member
7771 posts
Joined: 9月 2011
Offline
dude.
User Avatar
Member
8555 posts
Joined: 7月 2007
Offline
you can use verbs only with compilable nodes, and polyextrude is not compilable yet
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
27 posts
Joined: 3月 2020
Offline
Sigh. I was hoping there was a way.
User Avatar
Member
159 posts
Joined: 2月 2018
Offline
You can use HDK to write a verb to include GU_PolyExtrude2.h and then write function exactly like the Poly Extrude node. The verb version is compilable and can be used in Python as nodeVerb.

If you need the node, I can upload the .dll file then, also you can write some HDK and it's easy to do with the examples shipped with the Houdini installer.
Edited by EricSheng - 2020年8月27日 19:46:30

Attachments:
simpleextrude.png (278.0 KB)

User Avatar
Member
27 posts
Joined: 3月 2020
Offline
@EricSheng When you say upload the .dll, do you mean an HDK written to just act like the PolyExtrude? If you can upload the .C/.H files, that may be better for me to learn from. For practice, I compiled one of the example projects (SOP_Flatten) and it does not appear to be compilable (has the Non-compilable SOP badge) when I add it to the graph. I don't know what to do to make it compilable and therefore, accessible as a verb.
Edited by goingbananas - 2020年8月28日 12:31:24
User Avatar
Member
159 posts
Joined: 2月 2018
Offline
goingbananas
@EricSheng When you say upload the .dll, do you mean an HDK written to just act like the PolyExtrude? If you can upload the .C/.H files, that may be better for me to learn from. For practice, I compiled one of the example projects (SOP_Flatten) and it does not appear to be compilable (has the Non-compilable SOP badge) when I add it to the graph. I don't know what to do to make it compilable and therefore, accessible as a verb.
You can check out the example SOP_Star, there's a special way to write Verb SOP. Also, I've attached the source files you can free to modify and compile.
Image Not Found

Attachments:
SOP_SimpleExtrude.zip (31.7 KB)

User Avatar
Member
27 posts
Joined: 3月 2020
Offline
Thanks!
  • Quick Links