AndrewVK Posted October 5, 2007 Share Posted October 5, 2007 Lets suppose i have an polygon and i want to split it randomly into pieces. grid -> clip (keep both mode) -> clip (new parameters) -> clip (new parameters) e.t.c It can be done with help of hscript...but help for "ForEach SOP" says: For Each Number: Repeat the set of SOPs a set number of times, feeding the result of each iteration back to the start. Unfortunately i can not reproduce this functionality. If i turn off "merge result" - i have an polygon splitted in last iteration. If i turn on "merge result" - i have 10 splitted polygons But I have expected polygon splitted 10 times. Can it be done? Quote Link to comment Share on other sites More sharing options...
Darric Posted October 5, 2007 Share Posted October 5, 2007 (edited) Lets suppose i have an polygon and i want to split it randomly into pieces.grid -> clip (keep both mode) -> clip (new parameters) -> clip (new parameters) e.t.c It can be done with help of hscript...but help for "ForEach SOP" says: For Each Number: Repeat the set of SOPs a set number of times, feeding the result of each iteration back to the start. Unfortunately i can not reproduce this functionality. If i turn off "merge result" - i have an polygon splitted in last iteration. If i turn on "merge result" - i have 10 splitted polygons But I have expected polygon splitted 10 times. Can it be done? Forgive me if I'm completely wrong about this, but are you putting the sops you want to repeat inside the foreach node? It's not documented like that, and I actually have no idea if that's how it's supposed to be used, but that's the only way I've been able to get results I want with it. So for instance, if I wanted to subdivide geometry twice, jump inside the foreach, apppend the subdivide to the each node, put input geometry into input 1 of the ForEach, and turn "merge results" off. Of course, subdividing with depth 2 is easier, but I'm trying to make a point! Edited October 5, 2007 by Darric Quote Link to comment Share on other sites More sharing options...
AndrewVK Posted October 5, 2007 Author Share Posted October 5, 2007 Forgive me if I'm completely wrong about this, but are you putting the sops you want to repeat inside the foreach node? It's not documented like that, and I actually have no idea if that's how it's supposed to be used, but that's the only way I've been able to get results I want with it.So for instance, if I wanted to subdivide geometry twice, jump inside the foreach, apppend the subdivide to the each node, put input geometry into input 1 of the ForEach, and turn "merge results" off. Of course, subdividing with depth 2 is easier, but I'm trying to make a point! Here what i want and what i have foreachtest.hipnc Quote Link to comment Share on other sites More sharing options...
kubabuk Posted October 6, 2007 Share Posted October 6, 2007 (edited) Hey Andrew, Good you bring this topic again, I was struggling with similar problem some time ago, but just today found the way to fix that. The answer is pretty simple, just change the order of your each and clip SOPs and you will get the right result. cheers kuba foreachtest2.hipnc Edited October 6, 2007 by kubabuk Quote Link to comment Share on other sites More sharing options...
AndrewVK Posted October 8, 2007 Author Share Posted October 8, 2007 Hey Andrew,Good you bring this topic again, I was struggling with similar problem some time ago, but just today found the way to fix that. The answer is pretty simple, just change the order of your each and clip SOPs and you will get the right result. cheers kuba Thank You kuba! I think this strange fact should be noted in the documentation... Quote Link to comment Share on other sites More sharing options...
kubabuk Posted October 9, 2007 Share Posted October 9, 2007 Thank You kuba!I think this strange fact should be noted in the documentation... Yes, I agree it's weird and not very well documented. I still can't work out how this SOP works in the groups mode. kuba Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.