foreach SOP issue
3908 7 1- rafaels
- Member
- 696 posts
- Joined: March 2009
- Offline
It;s a bit hard to explain, but I have two curves that I run through a foreach SOP using the each number option. Inside I alternate between the curves and generate an attribute that correspond to the current iteration of the foreach SOP.
It escapes me though that the attribute doesn't reflect the actual iteration of the foreach SOP, but instead it's either 0 or 2, while if I bypass the delete SOP that alternates between the curves, I get the right attribute values, but for an incorrect amount of curves in the output.
It might sound a bit confusing, but if anybody would be willing to look into the file and suggest an approach or ask a question, Id' be happy!
Cheers
It escapes me though that the attribute doesn't reflect the actual iteration of the foreach SOP, but instead it's either 0 or 2, while if I bypass the delete SOP that alternates between the curves, I get the right attribute values, but for an incorrect amount of curves in the output.
It might sound a bit confusing, but if anybody would be willing to look into the file and suggest an approach or ask a question, Id' be happy!
Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
- derrick
- Staff
- 329 posts
- Joined: July 2005
- Offline
- michaelwang
- Member
- 9 posts
- Joined: Feb. 2008
- Offline
- rafaels
- Member
- 696 posts
- Joined: March 2009
- Offline
Hey, Michael
It's close, but not quite. I made a small change in the file that should make my issue a bit more evident. If you increase the number of iterations you'll see that we get a number of curves in the output that is equal to a multiple of the number of iterations and the number of primitives that entered the foreach in the first place.
In my understanding, I should be able to get sequential values (0, 1, 2, 3…) for the crv_idx attribute I created inside the foreach, but instead I get pairs of even numbers (0, 0, 2, 2, 4, 4…) as I increase the number of iterations.
Now I'm not sure what is the problem in my logic here…
Thanks a lot!
It's close, but not quite. I made a small change in the file that should make my issue a bit more evident. If you increase the number of iterations you'll see that we get a number of curves in the output that is equal to a multiple of the number of iterations and the number of primitives that entered the foreach in the first place.
In my understanding, I should be able to get sequential values (0, 1, 2, 3…) for the crv_idx attribute I created inside the foreach, but instead I get pairs of even numbers (0, 0, 2, 2, 4, 4…) as I increase the number of iterations.
Now I'm not sure what is the problem in my logic here…
Thanks a lot!
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
- rafaels
- Member
- 696 posts
- Joined: March 2009
- Offline
derrick
I think there is some confusion about the behaviour of parameters on the Delete SOP. The “Filter Expression” parameter is evaluated once per element. Items will be deleted if the parameter evaluates to a non-zero value. Consider using the “Group” or “Pattern” parameters.
You got it, Derrick! I just used the same expression in the pattern parameter and it worked. I guess I should have made my expression evaluate based on primitive number in the filter expression for it to work, right?
I'll give it a try, but for now it works prefectly.
Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
- michaelwang
- Member
- 9 posts
- Joined: Feb. 2008
- Offline
- rafaels
- Member
- 696 posts
- Joined: March 2009
- Offline
michaelwangexactly!
Is this what you want?
Thanks again, man.
Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
- michaelwang
- Member
- 9 posts
- Joined: Feb. 2008
- Offline
-
- Quick Links