Jump to content

retrieve points from my groupnode


supermac

Recommended Posts

hello all,

I learn again and again Python on Houdini...

i have a big problem..

i created "group node" and selected only some points..

i named my group "lineD"

Now, i want take points from "lineD".. and convert in edge..

in fact, i want retrieve my points from my group node, and change it:

"0-28" become "p0-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16...."

Because if i apply a bevel to my group "lineD", this is "point's bevel" and not "edge's bevel"...

Please, i'm beginner, can you explain me a simple solution? if there is... or put me on good "way"

And ... Sorry for my english.. tell me if it's not understandable

thank a lot

Best regard

i searched a solution with points(), but i don't know how use this... i get always an error

Link to comment
Share on other sites

here is very simple python script prototype

you can type it directly in the group parm of polybevel node connected to geometry containing your 'lineD' group

closePath = 1
grpName = 'lineD'
input = hou.pwd().inputs()[0]
group = input.geometry().findPointGroup(grpName)
points = [str(point.number()) for point in group.points()]
edgeString = 'p' + '-'.join(points)

if closePath:
    edgeString += '-' + points[0]

return edgeString

it will of course give an error if an input geometry does not contain 'lineD' group but for keeping it simple I didn't want to include more code

I did however added the ability to create edge between first and last points it may be handy for loops

you can modify it to automatically get group name from group parm of group SOP if you wish

you should check Create Ordered on your group sop so it will create edges in the same order as you picked the points, for procedurally generated point groups it can be a problem

edgeString_from_pointGroup.hip

Link to comment
Share on other sites

hello,

wow..

thank you very much for your help..

For me it's not a simple script...

it's perfect.. very very very thank you..

I have an other question:

I learned Python since 3 month..

now, i don't understand well python onto Houdini .. i can only write few line script..

can you tell me please if i must learn very well python and after it will easy to write code onto houdini?

Or if "Houdini Python" is enough different some "python" and i must learn a new language "Houdini-Python"?

this will help me to choose the best way, while now i'm a little lost.. i don't recognize python.. perhaps while i'm not enough experienced with python?!

again thank you.

See you

Best regard

Aurélien

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...