MAXScript Extensions > MAXScript Extensions for Particle Flow > Particle Flow Interfaces > Interfaces >

# Interface: MaxscriptParticleContainer

The MaxscriptParticleContainer Interface is exposed by Particle Containers and is available in Particle Script handlers.

Properties:

### The following properties can be used in the ChannelsUsed handler:

    <particeContainer>.useTime : bool : Read|Write

When set to true, the Time channel will be available for scripting access.

    <particeContainer>.useAge : bool : Read|Write

When set to true, the Age channel will be available for scripting access.

    <particeContainer>.useLifespan : bool : Read|Write

When set to true, the Lifespan channel will be available for scripting access.

    <particeContainer>.useEventTime : bool : Read|Write

When set to true, the EventTime channel will be available for scripting access.

    <particeContainer>.usePosition : bool : Read|Write

When set to true, the Position channel will be available for scripting access.

    <particeContainer>.useSpeed : bool : Read|Write

When set to true, the Speed channel will be available for scripting access.

    <particeContainer>.useAcceleration : bool : Read|Write

When set to true, the Acceleration channel will be available for scripting access.

    <particeContainer>.useOrientation : bool : Read|Write

When set to true, the Oritnation channel will be available for scripting access.

    <particeContainer>.useSpin : bool : Read|Write

When set to true, the Spin channel will be available for scripting access.

    <particeContainer>.useScale : bool : Read|Write

When set to true, the Scale channel will be available for scripting access.

    <particeContainer>.useTM : bool : Read|Write

When set to true, the TM (Transformation Matrix) channel will be available for scripting access.

    <particeContainer>.useSelected : bool : Read|Write

When set to true, the Selected channel will be available for scripting access.

    <particeContainer>.useShape : bool : Read|Write

When set to true, the Shape channel will be available for scripting access.

    <particeContainer>.useMtlIndex : bool: Read|Write

When set to true, the Material Index channel will be available for scripting access.

    <particeContainer>.useMapping : bool: Read|Write

When set to true, the Mapping channel will be available for scripting access.

    <particeContainer>.useInteger : bool : Read|Write

When set to true, the Integer channel will be available for scripting access.

    <particeContainer>.useFloat : bool : Read|Write

When set to true, the Float channel will be available for scripting access.

    <particeContainer>.useVector : bool : Read|Write

When set to true, the Vector channel will be available for scripting access.

    <particeContainer>.useMatrix : bool : Read|Write

When set to true, the Matrix channel will be available for scripting access.

### The following properties can be used in the Proceed handler:

    <particeContainer>.particleIndex : index : Read|Write|Validated by Range: 1 to 100000000

Get/Set current particle index

    <particeContainer>.particleID : index : Read|Write|Validated by Range: 1 to 100000000

Get/Set current particle ID

    <particeContainer>.particleNew : bool : Read

Check if particle just arrived into the event

    <particeContainer>.particleTime : time : Read|Write

Get/Set the Time of the current particle

    <particeContainer>.particleAge : time : Read|Write|Validated by Range: 0f to 9e+006f

Get/Set the Age of the current particle

    <particeContainer>.particleLifespan : time : Read|Write|Validated by Range: 0f to 9e+006f

Get/Set the Lifespan of the current particle

    <particeContainer>.particleEventTime : time : Read|Write|Validated by Range: 0f to 9e+006f

Get/Set for how long the particle is present in the current event

    <particeContainer>.particlePosition : point3 : Read|Write

Get/Set the current particle Position

    <particeContainer>.particleSpeed : point3 : Read|Write

Get/Set the current particle Speed

    <particeContainer>.particleAcceleration : point3 : Read|Write

Get/Set the current particle Acceleration

    <particeContainer>.particleOrientation : point3 : Read|Write

Get/Set the current particle Orientation

    <particeContainer>.particleSpin : angleAxis : Read|Write

Get/Set the current particle Spin

    <particeContainer>.particleScale : float : Read|Write

Get/Set the current particle’s Size

    <particeContainer>.particleScaleXYZ : point3 : Read|Write

Get/Set the current particle’s Scale

    <particeContainer>.particleTM : matrix3 : Read|Write

Get/Set the current particle transformation matrix

    <particeContainer>.particleSelected : bool : Read|Write

Get/Set whether the particle is selected.

    <particeContainer>.particleShape : mesh : Read|Write

Get/Set the particle mesh

    <particeContainer>.particleInteger : integer : Read|Write

Store/Retrieve custom integer data per particle.

    <particeContainer>.particleTestStatus : bool : Read|Write

Get/set the particle's test status.

    <particeContainer>.particleTestTime : time : Read|Write|Validated by Range: 0f to 9e+006f

Get/set the particle's test time.

    <particeContainer>.particleFloat : float : Read|Write

Store/Retrieve custom float data per particle.

    <particeContainer>.particleVector : point3 : Read|Write

Store/Retrieve custom vector data per particle.

    <particeContainer>.particleMatrix : matrix3 : Read|Write

Store/Retrieve custom matrix data per particle.

Note

The particleMatrix channel could be used to store either a matrix3 value or a set of 4 Point3 values, or 12 Float values. This makes it very versatile when a large number of values have to be stored. As noted in the matrix3 chapter, you cannot directly assign values to sub-elements of a matrix3 value. To write a Point3 or Float value to the particleMatrix channel, first store the particleMatrix value in a user variable, assign the Point3 to the respective row of the matrix or the Float value to the.x,.y or.z element of the Point3 and then assign the variable back to the particleMatrix channel.

Methods:

### To use in Init, Release and Proceed handler:

    <IObject>getParticleContainer()

Get particle container

### To use in Init and Proceed handler:

    <object>getParticleSystem()

Get the particle system object

    <node>getParticleSystemNode()

Get the particle system node

### To use in Init handler:

    <object array>getInitActions()

Get list of all action objects in the action list

    <node array>getInitActionNodes()

Get list of all action nodes in the action list

### To use in Proceed handler:

    <time>getTimeStart()

Get the start time of the proceed interval

    <time>getTimeEnd()

Get the end time of the proceed interval

    <void>setTimeEnd <time>time

If it is not possible to proceed all particles to the given timeEnd then set the closest possible time of the proceed interval

    <void>setTimeEndPrecise <time>time <float>fraction

Set the end time with higher precision by supplying time and fraction

    <node>getActionNode()

Get action node

    <Interface>getIntegrator()

Get the interface of the procedure that integrates particle motion in time. See Interface: integrator

    <integer>randSign()

Get random sign (-1 or +1)

    <float>rand01()

Get random number from interval [0, 1]

    <float>rand11()

Get random number from interval [-1, 1]

    <float>rand55()

Get random number from interval [-0.5, 0.5]

    <integer>rand0X<integer>maxNumber

Get random integer number from interval [0..maxNumber]

    <point3>randSpherePoint()

Get random 3D point from surface of sphere with radius 1

    <point3>randDivergeVector <point3>vectorToDiverge <angle>maxAngle

Get random vector that diverges from the given vector by no more than the specified maxAngle angle

    <integer>numParticles()

Number of particles in the current event/actionList

    <bool>addParticle()

Add a single particle.

Use .particleTime to define when particle is added. Use .particleAge=0 to set particle age to zero. Use other methods to define particle position, speed, orientation etc.

    <bool>addParticles <integer>amount

Add 'amount' particles

    <bool>deleteParticle <index>index

Delete a single particle with the given index

    <bool>deleteParticles <index>startIndex <integer>amount

Delete 'amount' particles starting from startIndex

    <index>getParticleID <index>particleIndex

Get the ID of the particle with the given index

    <bool>hasParticleID <index>particleID <&index>particleIndex

particleIndex is In and Out parameter

Verify if the event has a particle with the given ID

If the particle is present then particleIndex is the index of the particle

    <bool>isParticleNew <index>particleIndex

Check if a particle just arrived into the event

    <bool>isParticleNewByID <index>particleID

Check if a particle with the given ID just arrived into the event

    <time>getParticleTime <index>particleIndex

Get time of the current status of the particle

    <time>getParticleTimeByID <index>particleID

Get the time of the the particle with the specified ID

    <void>setParticleTime <index>particleIndex <time>time

Change time of the current status of the particle

    <void>setParticleTimePrecise <index>particleIndex <time>time <float>fraction

Set the time of the indexed particle with sub-frame precision using the frame time and a fraction value.

    <void>setParticleTimeByID <index>particleID <time>time

Set the time of the particle with the specified ID

    <void>setParticleTimePreciseByID <index>particleID <time>time <float>fraction

Set the time of the particle with the specified ID with sub-frame precision by supplying a frame and a fraction value.

    <time>getParticleAge <index>particleIndex

Returns the age of the indexed particle.

    <time>getParticleAgeByID <index>particleID

Returns the age of the particle with the specified ID.

    <void>setParticleAge <index>particleIndex <time>age

Sets the age of the indexed particle.

    <void>setParticleAgeByID <index>particleID <time>age

Sets the age of the particle with the specified ID.

    <time>getParticleLifespan <index>particleIndex

Returns the lifespan of the indexed particle.

    <time>getParticleLifespanByID <index>particleID

Returns the lifespan of the particle with the specified ID.

    <void>setParticleLifespan <index>particleIndex <time>lifespan

Sets the lifespan of the indexed particle to the supplied time value.

    <void>setParticleLifespanByID <index>particleID <time>lifespan

Sets the lifespan of the particle with the specified ID to the supplied time value.

    <time>getParticleEventTime <index>particleIndex

Returns the Event time of the indexed particle.

    <time>getParticleEventTimeByID <index>particleID

Returns the Event time of the particle with the specified ID.

    <void>setParticleEventTime <index>particleIndex <time>eventTime

Sets the Event time of the indexed particle.

    <void>setParticleEventTimeByID <index>particleID <time>eventTime

Sets the Event time of the particle with the specified ID.

    <point3>getParticlePosition <index>particleIndex

Returns the Position of the indexed particle.

    <point3>getParticlePositionByID <index>particleID

Returns the Position of the particle with the specified ID.

    <void>setParticlePosition <index>particleIndex <point3>position

Sets the Position of the indexed particle.

    <void>setParticlePositionByID <index>particleID <point3>position

Sets the Position of the particle with the specified ID.

    <point3>getParticleSpeed <index>particleIndex

Returns the Speed of the indexed particle.

    <point3>getParticleSpeedByID <index>particleID

Returns the Speed of the particle with the specified ID.

    <void>setParticleSpeed <index>particleIndex <point3>speed

Sets the Speed of the indexed particle.

    <void>setParticleSpeedByID <index>particleID <point3>speed

Sets the Speed of the particle with the specified ID.

    <point3>getParticleAcceleration <index>particleIndex

Returns the Acceleration of the indexed particle.

    <point3>getParticleAccelerationByID<index>particleID

Returns the Acceleration of the particle with the specified ID.

    <void>setParticleAcceleration <index>particleIndex <point3>acceleration

Sets the Acceleration of the indexed particle.

    <void>setParticleAccelerationByID <index>particleID <point3>acceleration

Sets the Acceleration of the particle with the specified ID.

    <point3>getParticleOrientation <index>particleIndex

Returns the Orientation of the indexed particle.

    <point3>getParticleOrientationByID <index>particleID

Returns the Orientation of the particle with the specified ID.

    <void>setParticleOrientation <index>particleIndex <point3>orientation

Sets the Orientation of the indexed particle.

    <void>setParticleOrientationByID <index>particleID <point3>orientation

Sets the Orientation of the particle with the specified ID.

    <angleAxis>getParticleSpin <index>particleIndex

Returns the Spin of the indexed particle.

    <angleAxis>getParticleSpinByID <index>particleID

Returns the Spin of the particle with the specified ID.

    <void>setParticleSpin <index>particleIndex <angleAxis>spin

Sets the Spin of the indexed particle.

    <void>setParticleSpinByID <index>particleID <angleAxis>spin

Sets the Spin of the particle with the specified ID.

    <float>getParticleScale <index>particleIndex

Returns the Scale of the indexed particle.

    <float>getParticleScaleByID <index>particleID

Returns the Scale of the particle with the specified ID.

    <void>setParticleScale <index>particleIndex <float>scale

Sets the Scale of the indexed particle.

    <void>setParticleScaleByID <index>particleID <float>scale

Sets the Size of the particle with the specified ID.

    <point3>getParticleScaleXYZ <index>particleIndex

Returns the Scale of the indexed particle.

    <point3>getParticleScaleXYZByID <index>particleID

Returns the Scale of the particle with the specified ID.

    <void>setParticleScaleXYZ <index>particleIndex <point3>scale

Sets the Scale of the indexed particle.

    <void>setParticleScaleXYZByID <index>particleID <point3>scale

Sets the Scale of the particle with the specified ID.

    <matrix3>getParticleTM <index>particleIndex

Returns the Transformation Matrix of the indexed particle.

    <matrix3> getParticleTMByID <index>particleID

Returns the Transformation Matrix of the particle with the specified ID.

    <void>setParticleTM <index>particleIndex <matrix3>transformationMatrix

Sets the Transformation Matrix of the indexed particle.

    <void>setParticleTMByID <index>particleID <matrix3>transformationMatrix

Sets the Transformation Matrix of the particle with the specified ID.

    <bool>getParticleSelected <index>particleIndex

Returns the Selected state of the indexed particle.

    <bool>getParticleSelectedByID <index>particleID

Returns the Selected state of the particle with the specified ID.

    <void>setParticleSelected <index>particleIndex <bool>selected

Sets the Selected state of the indexed particle.

    <void>setParticleSelectedByID <index>particleID <bool>selected

Sets the Selected state of the particle with the specified ID.

    <mesh>getParticleShape <index>particleIndex

Returns the shape of the indexed particle as mesh.

    <mesh>getParticleShapeByID <index>particleID

Returns the shape of the particle with the specified ID as mesh.

    <void>setParticleShape <index>particleIndex <mesh>shape

Sets the shape of the indexed particle to the supplied mesh.

    <void>setParticleShapeByID <index>particleID <mesh>shape

Sets the shape of the particle with the specified ID to the supplied mesh.

    <void>setShapeForAllParticles <mesh>shape

Sets the shape of all particles to the supplied mesh.

    <void>setParticleMtlIndex <index>particleIndex <index>materialIndex

Sets the Material Index of the indexed particle.

    <void>setParticleMtlIndexByID <index>particleID <index>materialIndex

Sets the Material Index of the particle with the specified ID

    <void>setMtlIndexForAllParticles <index>materialIndex

Sets the Material Index of all particles to the specified index value.

    <void>setParticleMapping <index>particleIndex <int>mapChannel <point3>mapValue

Sets the Mapping of the indexed particle to the specified Point3 value.

    <void>setParticleMappingByID <index>particleID <int>mapChannel <point3>mapValue

Sets the Mapping of the particle with the specified ID to the specified Point3 value.

    <void>setMappingForAllParticles <int>mapChannel <point3>mapValue

Sets the Mapping of all particles to the specified Point3 value.

    <integer>getParticleInteger <index>particleIndex

Returns the integer channel value of the indexed particle

    <integer>getParticleIntegerByID <index>particleID

Returns the integer channel value of the particle with the specified ID

    <void>setParticleInteger <index>particleIndex <integer>integerValue

Sets the integer channel value of the indexed particle to the supplied integer value.

    <void>setParticleIntegerByID <index>particleID <integer>integerValue

Sets the integer channel value of the particle with the specified ID to the supplied integer value.

    <float>getParticleFloat <index>particleIndex

Returns the float channel value of the indexed particle

    <float>getParticleFloatByID <index>particleID

Returns the float channel value of the particle with the specified ID

    <void>setParticleFloat <index>particleIndex <float>floatValue

Sets the float channel value of the indexed particle

    <void>setParticleFloatByID <index>particleID <float>floatValue

Sets the float channel value of the particle with the specified ID

    <point3>getParticleVector <index>particleIndex

Returns the vector channel value of the indexed particle

    <point3>getParticleVectorByID <index>particleID

Returns the vector channel value of the particle with the specified ID

    <void>setParticleVector <index>particleIndex <point3>vectorValue

Sets the vector channel value of the indexed particle

    <void>setParticleVectorByID <index>particleID <point3>vectorValue

Sets the vector channel value of the particle with the specified ID

    <matrix3> getParticleMatrix <index>particleIndex

Returns the matrix channel value of the indexed particle

    <matrix3> getParticleMatrixByID <index>particleID

Returns the matrix channel value of the particle with the specified ID

    <void>setParticleMatrix <index>particleIndex <matrix3>matrixValue

Sets the matrix channel value of the indexed particle

    <void>setParticleMatrixByID <index>particleID <matrix3>matrixValue

Sets the matrix channel value of the particle with the specified ID

    <void>setParticleTestStatus <index>particleIndex <bool>satisfy?

Sets the Test Status of the indexed particle to the supplied boolean value.

    <void>setParticleTestStatusByID <index>particleID <bool>satisfy?

Sets the Test Status of the particle with the specified ID to the supplied boolean value.

    <void>setGlobalTestStatus <bool>satisfy?

Sets the Test Status of all particles to the supplied boolean value.

    <void>setParticleTestTime <index>particleIndex <time>time

Sets the Test Time of the indexed particle to the supplied time value.

    <void>setParticleTestTimePrecise <index>particleIndex <time>time <float>fraction

Sets the sub-frame Test Time of the indexed particle to the supplied time and fraction value.

    <void>setParticleTestTimeByID <index>particleID <time>time

Sets the Test Time of the particle with the specified ID to the supplied time value.

    <void>setParticleTestTimePreciseByID <index>particleID <time>time <float>fraction

Sets the sub-frame Test Time of the particle with the specified ID to the supplied time and fraction value.

    <void>setGlobalTestTime <time>time

Sets the Test Time of all particles to the supplied time value.

    <void>setGlobalTestTimePrecise <time>time <float>fraction

Sets the sub-frame Test Time of all particles to the supplied time and fraction value.

#### See Also

- Particle Flow Interfaces

- Using MAXScript in Script Actions

- Particle Flow Sample Scripts