Jump to content

VEX attribute not updating?


MAYA_

Recommended Posts

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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