Atom Posted March 9, 2016 Share Posted March 9, 2016 Hello All, I can't seem to find the syntax for fetching the life values from a particle system. For some reason they are stored as life[0] and life[1] in the geometry spreadsheet instead of simple floats. When I try to fetch the life value I get VEX errors. float current_particle_life = f@life[0]; if I try to fetch it as vector I no longer get an error but the value returned is always zero. float current_particle_life = v@life[0]; If I fetch the attribute directly I do get a value but it does not match the values in the spreadsheet? float current_particle_life = f@life; I also want to fetch life[1] which is the death time of the particle. Does anyone know the correct syntax for fetching both parts of the life attribute into individual floats? Quote Link to comment Share on other sites More sharing options...
Skybar Posted March 9, 2016 Share Posted March 9, 2016 http://www.sidefx.com/docs/houdini15.0/vex/snippets Quote Link to comment Share on other sites More sharing options...
Atom Posted March 9, 2016 Author Share Posted March 9, 2016 Ah, thank you. It looks like I needed the short character 'u' to access that type of variable. float current_particle_life = u@life[0]; float current_particle_death = u@life[1]; Quote Link to comment Share on other sites More sharing options...
fsimerey Posted March 9, 2016 Share Posted March 9, 2016 Did you try this ? float current_particle_life = v@life.x; float current_particle_death = v@life.y; Quote Link to comment Share on other sites More sharing options...
Atom Posted March 9, 2016 Author Share Posted March 9, 2016 Thanks Francois, I did not try that, it is nice to know the alternate method as well. Quote Link to comment Share on other sites More sharing options...
fsimerey Posted March 10, 2016 Share Posted March 10, 2016 You're welcome. Thanks too to Skybar, i didn't know the u@ and p@ datatypes. vector2 (2 floats) u@name vector (3 floats) v@name vector4 (4 floats) p@name 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.