Particle System Common Properties, Operators, and Methods

Five <node> functions work with the legacy particle system objects in 3ds Max to allow you to get or set individual particle information. These functions return or set information about particles at the time set by the current 'at time'context clause, or the current time slider if there is not time context active.

Note:

The Particle Flow system in 3ds Max 6 and higher provides extensive MAXScript access.

For Particle Flow-relared MAXScript methods, see Particle Flow and MAXScript

A quick note about how the legacy particle systems in 3ds Max work will help you use these functions.

The particle system keeps an array of particles big enough to hold all those alive at any one time.

Each particle is identified by an index in this array. When one dies, it may be 'born' again sometime later and appear to be a different particle.

Over the course of an animation, the same 'particle' may live and die many times as its indexed slot in the array gets re-used.

Some of the functions described below use this index to identify particles, so you can have a situation where the 'same' particle (by index) becomes a new particle in the animation as its slot gets re-used.

The way you can check this is by looking at the 'age' of the particle - if it cycles around to zero (or a lower number depending on time resolution), you know it has become a 'new' particle.

If a particle is actually not alive at a given time, for example at the beginning of an animation or when you set up an 'explosive' emission, the functions below that get position, velocity and age return undefined .

This tells you that the particle is not currently alive.

These arethe particle system functions:

particleCount <particlesys_node>      

Returns the number of current particle slots in the system as an integer. This value is the number of particles that are to be drawn to the viewports unless the scene is currently being rendered. If the scene is being rendered, the number returned can be either the render count or the viewport count, depending on whether the particle system has been evaluated for rendering or not.

particleSize <particlesys_node>   

Returns the size of the particles in the system as float. This is set in the particle system parameter rollout - there is one size for all particles in a particle system. If you are using these functions to attach objects to particles, you can of course, make the individual objects any size you want.

particlePos <particlesys_node> <particle_index_integer> 

Returns the position coordinate of the indexed particle at the current time as a point3. Indexes are 1-based. The coordinate returned is in the current working coordinate system. Returns undefined if the particle is not alive at the current time.

particleVelocity <particlesys_node> <particle_index_integer> 

Returns the current velocity vector for the indexed particle as a point3. The vector returned is rotated into the current working coordinate system. Returns undefined if the particle is not alive at the current time.

particleAge <particlesys_node> <particle_index_integer> 

Returns the current age of the indexed particle as a time value, relative to when it was last born. Remember, particles get recycled and you can detect this by looking at the age value cycling round. Returns undefined if the particle is not alive at the current time.

particleLife <particlesys_node> <particle_index_integer> 

Returns the life of the particle -- the length of time the particle will be 'alive'. Returns undefined if the particle is not alive at the current time.

Available in 3ds Max 2008 and higher. Previously available in the Avguard Extensions .

particleCenter <particlesys_node> <particle_index_integer> 

Returns a value indicating where the particle geometry (mesh) lies in relation to the particle position. Returns undefined if the particle is not alive at the current time.

This is used by Particle Motion Blur for example. It gets the point in world space of the point it is shading, the size of the particle from ParticleSize(), and the position of the mesh from ParticleCenter(). Given this information, it can know where the point is, and it makes the head and the tail more transparent.

Return Values:

PARTCENTER_HEAD - The particle geometry lies behind the particle position.

PARTCENTER_CENTER - The particle geometry is centered around particle position.

PARTCENTER_TAIL - The particle geometry lies in front of the particle position.

Available in 3ds Max 2008 and higher. Previously available in the Avguard Extensions .

particleSize2 <particlesys_node> <particle_index_integer> 

Returns the world space size of the specified particle. Returns undefined if the particle is not alive at the current time.

Available in 3ds Max 2008 and higher. Previously available in the Avguard Extensions .