Jump to content

Import Attribute in VEX


JayT

Recommended Posts

Hi!

Im new to the forum and am currently learning Houdini. I have created an effect in VEX where a piece of geometry gets distorted by particles colliding into it. My VOP has two inputs, the first for the geometry (say a grid) and the second for the particles. Inside the VOP I have managed to create expressions to distort the geometry where the particle has hit the surface. Now I want to use the life/age of the particles to control how long the distortion lasts for. The problem comes in when I try to grab the particles life attribute. I create an 'import attribute' node, then in the parameters I set Signature to 'float attribute', type 'life' into Attribute and set OP Input Index to 1 (the second input of the VOP which should be the particles).

Theoretically this should give me the life of the particle which I can then use to reduce the distortion over time and eventually stop when the particle dies. However this doesn't seem to be the case and the imported attribute gives me random values. I have tried changing the attribute to 'age', copying the attribute and pasting the reference and even tried lower/upper case letters. But it doesn't give me anything useful I can use.

Can anyone help me with what I am doing wrong or give me other ideas on how to fade away my effect dependant on the particles?

Thanks

Link to comment
Share on other sites

  • 6 months later...

Just saw this question, I'm sure you've figured this out by now but for others searching on this I believe the answer lies in that fact that $LIFE is not the same as the attribute "life". When you pull up Details view on your particles you'll see life(0) and life(1) listed. life(0) is how many seconds the particle has been alive, life(1) is how many seconds the particle will live. $AGE is the variable that references life(0), but $LIFE actually references life(0)/life(1) giving you a 0 to 1 value. I've not been able to import life(0) or life(1) into a vop but before the VOP POP you can lay down an Attribute POP and use $LIFE as the value. This attribute can then be imported into your VOP.

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