Is there an easy way to modify the values of other Points within an attrib wrangle? Fetching Point information is straight forward, but i didn't see any example for modifying neighboring point data. At the same time, i know that what vex makes fast is, when it's locally independent.
Anyhow would be nice to see if its possible.
Attrib Wrangle: Modify another Points Position
6249 9 1- schiho
- Member
- 101 posts
- Joined: Dec. 2012
- Offline
- bonsak
- Member
- 459 posts
- Joined: Oct. 2011
- Offline
Hi
I'm not sure what you want to do exactly but it sounds like pcopen is your freind: http://www.sidefx.com/docs/houdini15.0/vex/functions/pcopen [sidefx.com]
-b
I'm not sure what you want to do exactly but it sounds like pcopen is your freind: http://www.sidefx.com/docs/houdini15.0/vex/functions/pcopen [sidefx.com]
-b
- jlait
- Staff
- 6205 posts
- Joined: July 2005
- Offline
I'd recommend setpointattrib
http://www.sidefx.com/docs/houdini15.0/vex/functions/setpointattrib [sidefx.com]
Note that your edits only take effect *after* VEX has been applied to all points. This is to try and keep things fast despite setpointatrib() no longer being a local modification.
http://www.sidefx.com/docs/houdini15.0/vex/functions/setpointattrib [sidefx.com]
Note that your edits only take effect *after* VEX has been applied to all points. This is to try and keep things fast despite setpointatrib() no longer being a local modification.
- schiho
- Member
- 101 posts
- Joined: Dec. 2012
- Offline
- schiho
- Member
- 101 posts
- Joined: Dec. 2012
- Offline
- jlait
- Staff
- 6205 posts
- Joined: July 2005
- Offline
Probably a lot faster to just put a Attrib VOP/Wrangle into “Detail Mode” and put the for loop inside of there. You can build an array to store all the intermediate values, and write them all out with setpointattrib() when done.
This does lose a huge amount of the benefit of VEX, however. The best is if you can somehow re-think your algorithm to use parallel applications. Often a slower algorithm may end up faster due to the ability to parallelize & get cache coherence.
This does lose a huge amount of the benefit of VEX, however. The best is if you can somehow re-think your algorithm to use parallel applications. Often a slower algorithm may end up faster due to the ability to parallelize & get cache coherence.
- schiho
- Member
- 101 posts
- Joined: Dec. 2012
- Offline
- jlait
- Staff
- 6205 posts
- Joined: July 2005
- Offline
- TheCrisis
- Member
- 36 posts
- Joined: May 2016
- Offline
- tamte
- Member
- 8554 posts
- Joined: July 2007
- Offline
TheCrisisyes, you have to pass new attribute value, so if it's a vector then full vector
…We have to pass vector to the function?
What to do when we want change only one axis?
for (int ptnum = 0; ptnum < @numpt; ptnum++) { vector P = point(0, 'P', ptnum); P.x = ptnum; setpointattrib(0, 'P', ptnum, P); }
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
-
- Quick Links