Jump to content

FOR and WHILE cycles


PhasmaCeritus

Recommended Posts

Hi,

I am totally new in Houdini, hscript and python.

My basic question is how do I run a FOR or WHILE cycle in Houdini?

For example we have a geometry on witch I want to apply a brake SOP for 10 times, each time feeding my brake SOP with a different seed...

Please let me know how could I do that.

Thanks

Link to comment
Share on other sites

ForEach sop?

Also, the Shatter sop already does what you want to do.

Hi,

thanks for response.

I am familiar with ForEach and Shatter, however I couldn't figure how to brake a geometry like I have in my example01.hip

left branch is what shatter does, and right one is what I need. So once again the only way I see of how that could be done is not with ForEach sop but with FOR or WHILE loop.

Maybe that is not the best example to illustrate FOR an WHILE loops but I can't imagine scripting without programing basics...

Thanks again

example01.hip

Link to comment
Share on other sites

To do the sort of 2d straight type thing you are trying to do the Break/Shatter probably aren't what you want then. I'd suggest just using a Clip SOP that is randomized inside a ForEach using Each Number to get the number of cuts you want. This gives you the for loop type effect. Unfortunately there really isn't a while type effect you can get in SOPs.

clip_break.hipnc

Link to comment
Share on other sites

To do the sort of 2d straight type thing you are trying to do the Break/Shatter probably aren't what you want then. I'd suggest just using a Clip SOP that is randomized inside a ForEach using Each Number to get the number of cuts you want. This gives you the for loop type effect. Unfortunately there really isn't a while type effect you can get in SOPs.

thanks

that helps a lot

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...