Learning Houdini need help with clearing my head around wrangles

   1480   5   0
User Avatar
Member
97 posts
Joined: May 2015
Offline
So been going through Express functions library and reading on VEX and wanted to use attribute wrangle. But i still feel so confused, what im trying to do is simple i think so. So what im trying to do is i have 2 line nodes, 1 for length and the other for another length but what im trying to do is i want line 2(second line) to be on line 1 last number point no matter how many points i add to line 1. how can i go in about doing that with wrangle?
Image Not Found

Image Not Found
User Avatar
Member
14 posts
Joined: Sept. 2018
Offline
1. Drop in a ‘Line’ node with, say, 7 points.
2. Drop in a ‘Group by Range’ node and link it up with the ‘Line’ node.
3. Change its Group Type to “Points”.
4. Drag the “End” slider to “1” (or manually type it in).
5. Tick the “Invert Range” checkbox.
6. Set the display flag on the “grouprange1” node.

Now you can change the number of points to whatever you want from the “line1” node and you'll always have the last point selected.

You can even use a “Copy to Points” node to copy a sphere there (or another line), but make sure you change the “Target Points” (from the “Copy to Points” node) to say “group1” to only affect that group, because that's the name that's coming from the “grouprange1” node.
User Avatar
Member
477 posts
Joined: July 2005
Offline
Hi,

in addition here is a wrangle solution.

Attachments:
move_to_last_point.hipnc (72.9 KB)

User Avatar
Member
97 posts
Joined: May 2015
Offline
DSpider
1. Drop in a ‘Line’ node with, say, 7 points.
2. Drop in a ‘Group by Range’ node and link it up with the ‘Line’ node.
3. Change its Group Type to “Points”.
4. Drag the “End” slider to “1” (or manually type it in).
5. Tick the “Invert Range” checkbox.
6. Set the display flag on the “grouprange1” node.

Now you can change the number of points to whatever you want from the “line1” node and you'll always have the last point selected.

You can even use a “Copy to Points” node to copy a sphere there (or another line), but make sure you change the “Target Points” (from the “Copy to Points” node) to say “group1” to only affect that group, because that's the name that's coming from the “grouprange1” node.

Just what i was looking for but i also want to learn on how to do it with wrangles. Thank you tho
User Avatar
Member
97 posts
Joined: May 2015
Offline
Aizatulin
Hi,

in addition here is a wrangle solution.

Went through it thank you for the comments and just what i was looking for.

Also why does the second input line disappear?
Edited by Shadowjonny - March 10, 2019 04:44:18
User Avatar
Member
477 posts
Joined: July 2005
Offline
Shadowjonny
Went through it thank you for the comments and just what i was looking for.

Also why does the second input line disappear?

Sure man

The wrangle let only pass the geometry of the first input. The other ones are auxiliary inputs. If you want the second input be part of the result use can use the merge node (for example) with the result of the wrangle and the geometry which is connected to the second input.
  • Quick Links