MAYA_ Posted January 13, 2018 Share Posted January 13, 2018 Hello, I am writing some code and I noticed something weird. I am using a detail wrangle and some loops. Inside one loop, I use setpointattrib() to update a point attribute and then, I read the updated value back using getattrib() to use it for a condition further down the line. I noticed that, even after updating my attribute in one iteration of the loop, it will still read in the default value it was set to before, not the new value, I set it to. Can anyone explain to me why this is? Am I doing something wrong? Thank you Quote Link to comment Share on other sites More sharing options...
f1480187 Posted January 13, 2018 Share Posted January 13, 2018 It's just not working that way in Houdini 16.5. First argument of all geometry functions is an input geometry, not the current one. By setting attributes you only pending value changes after the VEX code is executed, as far as I know. Common way is to use a pipeline of small wrangles. Other way is to use an array to store intermediate values, then add a small loop at the end of the code where you finally set values for geometry entities. Quote Link to comment Share on other sites More sharing options...
MAYA_ Posted January 13, 2018 Author Share Posted January 13, 2018 39 minutes ago, f1480187 said: It's just not working that way in Houdini 16.5. First argument of all geometry functions is an input geometry, not the current one. By setting attributes you only pending value changes after the VEX code is executed, as far as I know. Common way is to use a pipeline of small wrangles. Other way is to use an array to store intermediate values, then add a small loop at the end of the code where you finally set values for geometry entities. Hey thank you so much! I used an array and then just updated them in the end and it works fine now. Thank you again! 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.