mrcoolmen Posted December 3, 2015 Share Posted December 3, 2015 Hey Guys, Just wondering how to do the operation like foreach(attribute) in Vops? thanks for your help in advance Cheers Kevin Quote Link to comment Share on other sites More sharing options...
msyugo Posted December 7, 2015 Share Posted December 7, 2015 Loops do confuse and intrigue me! Waiting for some info on these.... Quote Link to comment Share on other sites More sharing options...
animatrix Posted December 7, 2015 Share Posted December 7, 2015 You can do this but to get/set attribute values generically you will have to write a ton of code or nodes in VOPs. Quote Link to comment Share on other sites More sharing options...
sekow Posted December 7, 2015 Share Posted December 7, 2015 masterclass loops Quote Link to comment Share on other sites More sharing options...
tjeeds Posted December 7, 2015 Share Posted December 7, 2015 You can use the Find Attribute Value Count Vop, this will return the number of unique values contained within a String or Integer. You can use this to run a For Loop and inside you'll hook up i to Find Attribute Value by Index node to pull the current value. Just be aware, running this is in a Attrib VOP set to run on Detail (Only Once) will be analogous to the old ForEach sop. If you run it on points you'll be iterating numpts^numattribs (an assload) times, so if you have a high point count you should avoid doing that. Quote Link to comment Share on other sites More sharing options...
mrcoolmen Posted December 8, 2015 Author Share Posted December 8, 2015 Hey Guys, Thanks so much for your help, this is a really awesome houdini community. Just wondering if your guys can help a give a v quick example file? i did try myself but did not really get it to work. Really appricate ur all help. Quote Link to comment Share on other sites More sharing options...
tjeeds Posted December 8, 2015 Share Posted December 8, 2015 What exactly are you trying to do? There's a lot of alternate ways to accomplish this sort of thing. Quote Link to comment Share on other sites More sharing options...
mrcoolmen Posted December 21, 2015 Author Share Posted December 21, 2015 What exactly are you trying to do? There's a lot of alternate ways to accomplish this sort of thing. Hey Jesse, I know there are a lot of alternate ways to accomplish same thing, im jt curious and wish to gain some knowledge about the for loop & for each node. This is the example i will wish your guys can help me out. It is jt use a unique attribute to connect 2 points more points, i know "add" can achieve same effect but like i said, im super curious about it. Thank you guys in advance for helping me learning this software exmaple.hip Quote Link to comment Share on other sites More sharing options...
mestela Posted December 21, 2015 Share Posted December 21, 2015 Loops in vops/sops hurt my brain, but I figure its good practice. Had to write them out in vex first, then use that as a guide to do the vop versions. Something not right about them (they generate twice as many prims as required), but it should get you going. vop_loops.hipnc 1 Quote Link to comment Share on other sites More sharing options...
mrcoolmen Posted December 21, 2015 Author Share Posted December 21, 2015 hey matt, thank u so much, its awesome,really learn a lot from ur example file. Quote Link to comment Share on other sites More sharing options...
tjeeds Posted December 21, 2015 Share Posted December 21, 2015 Just gonna pod onto Matt's file here with a Find Attribute Value by Index example. This uses an If statement to acheive the same results as running through a loop, but you can use the Find Attribute Value Count vop to set up a loop that will do something similar. @Matt, the reason for the difference in prim numbers can be seen if you look at the primitive numbers before the fuse. The first method creates one legitimate edge and one degenerate zero-length edge. The second method creates two legitimate primitives so the Fuse doesn't remove anything. vop_loops.hipnc Quote Link to comment Share on other sites More sharing options...
mestela Posted December 22, 2015 Share Posted December 22, 2015 Boss, thanks Jesse! 1 Quote Link to comment Share on other sites More sharing options...
tjeeds Posted December 22, 2015 Share Posted December 22, 2015 High-five! Quote Link to comment Share on other sites More sharing options...
elecstorm Posted February 8, 2016 Share Posted February 8, 2016 That's unreal. Naming in, naming out, naming in, naming out... 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.