Using a particle network's $LIFE attribute

   13997   9   1
User Avatar
Member
23 posts
Joined: Nov. 2007
Offline
How do I access one of the components of the $LIFE attribute from a particle network? According to the spreadsheet view, the $LIFE attribute is in fact two floats, so how do I access one of them in an expression? I've tried $LIFE and variations on this, but it doesn't seem to work. I intend to use one of the $LIFE attributes in a Copy SOP that is appended to my POP network, but I can't access it.

Thanks,

YBM
User Avatar
Member
1631 posts
Joined: July 2005
Offline
Hi,

If you use $LIFE, you get the first component by default and usually, it's what you want.

I just called $LIFE in a Copy SOP for stamping & it works.

Cheers!
steven
User Avatar
Member
23 posts
Joined: Nov. 2007
Offline
Thanks, steven.

Do you know how I'd access the second component of $LIFE (which looks as though it is the total lifespan of the particle), as I'd like to calculate the life of the particle with respect to its total lifespan.

Thanks,

YBM
User Avatar
Member
1631 posts
Joined: July 2005
Offline
There are two ways to do this. One is with an AttribCreate SOP so you create local variables which can be called in the Copy SOP and the other is to use the point() function.

I've attached a hip file showing both methods. Hope it will help.

Cheers!
steven

Attachments:
life_copy.zip (18.2 KB)

User Avatar
Member
23 posts
Joined: Nov. 2007
Offline
Okay, actually managed to answer my own question. The $LIFE attribute is actually only a single float that does indeed represent the relative life of the particle (from 0 to 1), which is what I wanted in the first place. This is apparently different from the Life attribute of the particles themselves.

However, it does still beg the question of: how would I access the point attributes Life and Life in expressions? Or, more generally, what is the method to access point attributes in the Copy SOP's parameter expressions?

YBM
User Avatar
Member
164 posts
Joined: April 2008
Offline
It confuses me to, for what ever reason on the details tab there seem to be more attributes than, according to the help, there are variables.
Nick Nimble

VFX blog - http://www.nicknimble.com [nicknimble.com]
Facebook - http://www.facebook.com/nicknimble [facebook.com]
Twitter - https://twitter.com/Nick_Nimble [twitter.com]
User Avatar
Member
8594 posts
Joined: July 2007
Offline
YoBeardMaestro

However, it does still beg the question of: how would I access the point attributes Life and Life in expressions?
YBM

Here are the local variables you are after

$AGE (life)
$LIFESPAN (life)
$LIFE (life / life)
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
164 posts
Joined: April 2008
Offline
Is there a overview for what variable holds which attribute from the details view?
Nick Nimble

VFX blog - http://www.nicknimble.com [nicknimble.com]
Facebook - http://www.facebook.com/nicknimble [facebook.com]
Twitter - https://twitter.com/Nick_Nimble [twitter.com]
User Avatar
Member
8594 posts
Joined: July 2007
Offline
I am not aware of that
but you have list of Local variables in help to each node which uses some hardcoded variables. For example Point SOP, Transform SOP, most POPs etc.

They are not necessarily linked to some existing attribute (like $BBX, $NPT. etc.).

However your custom attributes which are represented by variables can be seen by middle clicking on the node. There is Custom Variable Mappings section where you can see the corresponding pairs
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
23 posts
Joined: Nov. 2007
Offline
Thanks, tamte.

YBM
  • Quick Links