Jump to content

Iterate pcfilter with a for loop ?


dpap

Recommended Posts

Hi  everybody and happy new year !!!

 

My first problem in Houdini this year has to do with for loops.

 

How can I repeat/iterate the smoothing from pcfilter on an attribute ?

 

The obvious is the FOREACH sop but can't I just use a for loop in the point wrange or in vops?

 

I thought that the last solution would be much faster so I tried to put the pcfilter function in a loop but I guess I am doing somehting wrong?

 

Can anyone shed some light?

iterate pcfilter with a for loop 1.hip

Edited by dpap
Link to comment
Share on other sites

I guess you can't

since pcopen is always opening geometry from @OpInput1 it will always filter points from that geo and not points from previous iteration

so no matter how many times your for loop will run it will always look the same

so you probably have to use foreach SOP

 

and that implicit cast error is just because you are using ch("numopoi") in pcopen and houdini doesn't know exactly which type of ch() to use (even though you would guess it should use int since numopoi parm is integer)

so you need to explicitly cast it to int by using int(ch("numopoi"))

  • Like 1
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...