Jump to content

Question on loop through attribute in vops.


Recommended Posts

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. 

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 1 month later...

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