Python API Reference

The full API reference is shown below, but please note that it does change and this manual may not show the most up-to-date version. The most recent API can be seen in the console and this is shown on the main XP Python page.

API Reference

Help on module xparticles:

NAME
xparticles - xparticles

FILE
(built-in)

CLASSES
__builtin__.object
Collider
ColliderConstraint
Constraint
Emitter
Neighbor
Particle
Ray

class Collider(__builtin__.object)
| xparticles.Collider
|
| Methods defined here:
|
| AddObject(...)
| [object] : Add the polygon object to the collider
|
| Collide(...)
| [pos, vel, rad] : Collide particle with objects in the collider, use GetCollision__
|
| Flush(...)
| Free the particle to polygon collider data
|
| GetClosest(...)
| [pos, rad] : Calculate the closest position to the particle within the radius, returns dist (-1 if nothing found), use GetClosest__
|
| GetClosestNormal(...)
| Returns the closest positions normal, use GetCloset first
|
| GetClosestObject(...)
| Returns the closest collider object, use GetCloset first
|
| GetClosestPoint(...)
| Returns the closest position on the closet collider object, use GetCloset first
|
| GetClosestPolygon(...)
| Returns the closest positions polygon, use GetCloset first
|
| GetCollisionDelta(...)
| Returns the hit time delta (0.0 - 1.0 of the velocity) (use Collide first)
|
| GetCollisionNormal(...)
| Returns the hit position normal (use Collide first)
|
| GetCollisionObject(...)
| Returns the object hit (use Collide first)
|
| GetCollisionPoint(...)
| Returns the hit position (use Collide first)
|
| GetCollisionPolygon(...)
| Returns the polygon hit (use Collide first)
|
| GetCollisionRS(...)
| Returns the hit positions (r,s), see Mix/GetRS (use Collide first)
|
| Init(...)
| Init the particle to polygon collider (objects must be added before calling)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T

class ColliderConstraint(__builtin__.object)
| xparticles.ColliderConstraint
|
| Methods defined here:
|
| GetColliderID(...)
| Returns the constraints collider ID
|
| GetFlags(...)
| Returns the constraints flags
|
| GetID(...)
| Returns the constraints ID
|
| GetIndex(...)
| Returns the constraint index
|
| GetLastPosition(...)
| Returns the constraints last position
|
| GetLength(...)
| Returns the constraints length
|
| GetPositionRS(...)
| Returns the constraints collider position (r,s) within the polygon ; see GetRS/MixRS
|
| SetColliderID(...)
| [id] : Sets the constraints collider ID
|
| SetFlags(...)
| [flags] : Sets the constraints flags
|
| SetID(...)
| [id] : Sets the constraints ID
|
| SetIndex(...)
| [index] : Sets the constraints index
|
| SetLastPosition(...)
| [pos] : Sets the constraints last position
|
| SetLength(...)
| [len] : Sets the constraints length
|
| SetPositionRS(...)
| [pos] : Sets the constraints position (r, s) within the polygon ; see GetRS/MixRS
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T

class Constraint(__builtin__.object)
| xparticles.Constraint
|
| Methods defined here:
|
| GetFlags(...)
| Returns the constraints flags
|
| GetID(...)
| Returns the constraints particle ID
|
| GetIndex(...)
| Returns the constraint particle index
|
| GetLength(...)
| Returns the constraints length
|
| SetFlags(...)
| [flags] : Sets the constraints flags
|
| SetID(...)
| [id] : Sets the constraints particle ID
|
| SetIndex(...)
| [index] : Sets the constraints particle index
|
| SetLength(...)
| [len] : Sets the constraints length
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T

class Emitter(__builtin__.object)
| xparticles.Emitter
|
| Methods defined here:
|
| CreateParticle(...)
| Create a new live particle
|
| GetAliveCount(...)
| Returns the total number of live particles
|
| GetFirstAlive(...)
| Return the first live particle
|
| GetFlags(...)
| Return the flags for this emitter
|
| GetLastAlive(...)
| Return the last live particle
|
| GetMaxCount(...)
| Returns the maximum number of particles
|
| GetObject(...)
| Returns the BaseObject
|
| GetParticle(...)
| [index] : Return the x-particle at the passed index
|
| GetParticleCount(...)
| Returns the total number of particles
|
| SetFlags(...)
| Set the emitters flags
|
| SetMaxCount(...)
| [count] : Set the maximum number of particles
|
| SetParticleCount(...)
| [count] : Set the number of live particles
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T

class Neighbor(__builtin__.object)
| xparticles.Neighbor
|
| Methods defined here:
|
| AddEmitter(...)
| [emitter] : Add the emitters particles into the neighborhood data
|
| AddGroup(...)
| [group, emitter] : Add all particles in a group (can be from multiple emitters or pass an emitter to restrict it) into the neighborhood data
|
| AddParticle(...)
| [pos, index, data] : Add a particle (or position) into the neighborhood data, optionally give it an index and data (GeData)
|
| FindClosest(...)
| [pos, radius] : Find all particles with the radius from the passed position, use GetClosest to get the particles, returns the count found
|
| Flush(...)
| Free the neighborhood search
|
| GetClosestIndex(...)
| [index] : Returns the particle index of [index] within the found closest particles, use FindClosest before calling this and the index with GetParticle__
|
| GetClosestPosition(...)
| [index] : Returns the particles position of [index] within the found closest particles, use FindClosest before calling this
|
| GetParticle(...)
| [index] : Returns the particle (if from an emitter) at [index]
|
| GetParticleCount(...)
| [index] : Returns the number of particles in the neighborhood
|
| GetParticleCustomIndex(...)
| [index] : Returns the particles index (if from AddParticle) of the neighborhood particle at [index]
|
| GetParticleEmitter(...)
| [index] : Returns the particles emitter (if from AddEmitter/AddGroup) of the neighborhood particle at [index]
|
| GetParticleIndex(...)
| [index] : Returns the particles index of the neighborhood particle at [index]
|
| GetParticlePosition(...)
| [index] : Returns the particles position of the neighborhood particle at [index]
|
| Init(...)
| [radius] : Init the neighborhood search, must be done after adding particles. If using a fixed search radius enter it here (to speed up the search), otherwise 0.0
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T

class Particle(__builtin__.object)
| xparticles.Particle
|
| Methods defined here:
|
| AddBirthConstraint(...)
| Returns a birth constraint
|
| AddColliderConstraint(...)
| Returns a collider constraint
|
| AddCustomData(...)
| [id, name, data] : Add custom data (GeData) to the particle, returns the index
|
| AddDistanceConstraint(...)
| Returns a distance constraint
|
| AddParticleConstraint(...)
| Returns a particle-particle constraint
|
| FindCustomData(...)
| [id, name] : Finds a custom data with id/name (optional), returns the index
|
| GetBirthConstraint(...)
| [index] : Returns the birth constraint
|
| GetBirthConstraintsCount(...)
| Returns the number of birth constraints
|
| GetColliderConstraint(...)
| [index] : Returns the collider constraint
|
| GetColliderConstraintsCount(...)
| Returns the number of collider constraints
|
| GetColor(...)
| Returns the particles color
|
| GetCustomData(...)
| [index] : Get the particles custom data at index
|
| GetCustomDataCount(...)
| Returns the number of custom data items
|
| GetDensity(...)
| Returns the particles density
|
| GetDisplay(...)
| Returns the particles display type
|
| GetDistanceConstraint(...)
| [index] : Returns the distance constraint
|
| GetDistanceConstraintsCount(...)
| Returns the number of distance constraints
|
| GetDistanceTravelled(...)
| Returns how far the particle has moved since birth
|
| GetExpansion(...)
| Returns the particles fluid expansion [for xpDomain]
|
| GetFire(...)
| Returns the particles fire
|
| GetFlags(...)
| Returns the particles flags [XPARTICLE_FLAGS_]
|
| GetFuel(...)
| Returns the particles fuel
|
| GetGroupID(...)
| Returns the particles group ID
|
| GetID(...)
| Returns the particles ID
|
| GetIndex(...)
| Returns the particles index
|
| GetLife(...)
| Returns the particles life (time until death)
|
| GetMass(...)
| Returns the particles mass
|
| GetMatrix(...)
| Returns the particles rotation as a matrix
|
| GetNext(...)
| Returns the next alive particle
|
| GetParticleConstraint(...)
| [index] : Returns the particle-particle constraint
|
| GetParticleConstraintsCount(...)
| Returns the number of particle-particle constraints
|
| GetPosition(...)
| Returns the particles position
|
| GetRadius(...)
| Returns the particles radius
|
| GetRotation(...)
| Returns the particles rotation
|
| GetSmoke(...)
| Returns the particles smoke
|
| GetSpeed(...)
| Returns the particles speed
|
| GetSpin(...)
| Returns the particle spin
|
| GetTemperature(...)
| Returns the particles temperature
|
| GetTime(...)
| Returns the particles time since birth
|
| GetUVW(...)
| Returns the particles UVW
|
| GetVelocity(...)
| Returns the particles velocity
|
| IsSpinEnabled(...)
| Returns if the particles spin is enabled
|
| RemoveBirthConstraint(...)
| [index] : Removes a birth constraints
|
| RemoveColliderConstraint(...)
| [index] : Removes a collider constraints
|
| RemoveCustomData(...)
| [index] : Removes a custom data from the particle
|
| RemoveDistanceConstraint(...)
| [index] : Removes a distance constraints
|
| RemoveParticleConstraint(...)
| [index] : Removes a particle-particle constraints
|
| SetBits(...)
| [bits] : Sets the particles internal bit flags [XPARTICLE_BITS_], use with caution
|
| SetColor(...)
| [color] : Sets the particles color
|
| SetCustomData(...)
| [index, data] : Sets the particles custom data at index
|
| SetDensity(...)
| [density] : Sets the particles density
|
| SetDisplay(...)
| [display] : Sets the particles display type
|
| SetDistanceTravelled(...)
| [dist] : Sets how far a particle has moved since birth
|
| SetExpansion(...)
| [expand] : Set the particles fluid expansion [for xpDomain]
|
| SetFire(...)
| [fire] : Set the particles fire
|
| SetFlags(...)
| [flags] : Sets the particles flags [XPARTICLE_FLAGS_]
|
| SetFuel(...)
| [fuel] : Set the particles fuel
|
| SetGroupID(...)
| [group] : Sets the particles group ID
|
| SetID(...)
| [id] : Sets the particles ID
|
| SetLife(...)
| [life] : Sets the particles life (until death)
|
| SetMass(...)
| [mass] : Sets the particles mass
|
| SetMatrix(...)
| [matrix] : Sets the particles rotation from a matrix
|
| SetPosition(...)
| [position] : Sets the particles position
|
| SetRadius(...)
| [radius] : Sets the particles radius
|
| SetRotation(...)
| [rot] : Sets the particles rotation
|
| SetSmoke(...)
| [smoke] : Set the particles smoke
|
| SetSpeed(...)
| [speed] : Sets the particles speed
|
| SetSpin(...)
| [spin] : Set the particles spin
|
| SetSpinEnabled(...)
| [enable] : Set if the particle should spin
|
| SetTemperature(...)
| [temp] : Set the particles temperature
|
| SetTime(...)
| [time] : Sets the particles time since birth
|
| SetUVW(...)
| [uvw] : Set the particles UVW
|
| SetVelocity(...)
| [velocity] : Sets the particles velocity
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T

class Ray(__builtin__.object)
| xparticles.Ray
|
| Methods defined here:
|
| AddEmitter(...)
| [emitter] : Add the emitters particles into the ray cast data
|
| AddGroup(...)
| [group, emitter] : Add all particles in a group (can be from multiple emitters or pass an emitter to restrict it) into the ray cast data
|
| AddObject(...)
| [object] : Add a polygon object into the ray cast data
|
| Flush(...)
| Free the ray cast data
|
| GetHitCount(...)
| Returns the hits from a TraceRay
|
| GetHitIndex(...)
| [index] : Returns the hit index (particle or polygon) from a TraceRay
|
| GetHitObject(...)
| [index] : Returns the hit object/emitter
|
| GetHitPosition(...)
| [index] : Returns the hit position (world coordinates)
|
| Init(...)
| Init the ray cast data, all objects/emitter must be added first
|
| TraceRay(...)
| [pos, dirn, maxdist] : Trace a ray from pos in the direction given (doesn't need to be normalized), get the hits with the GetHit__ functions, return True if hit
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T

FUNCTIONS
CreateEmitter(...)
Create an emitter object

GetRS(...)
[p, va, vb, vc, vd, quad] : Returns the (r, s) as a Vector of the position 'p' within the quad/triangle va-vd, quad True if a quadrangle (False for triangle)

MixFloatRS(...)
[rs, ra, rb, rc, rd, quad] : Returns Float (float) from (r,s) position within the reals ra-rd, quad True if all four used (False for a triangle)

MixVectorRS(...)
[rs, va, vb, vc, vd, quad] : Returns Vector from (r,s) position within the vectors va-vd, quad True if all four used (False for a triangle)

ToEmitter(...)
[object] : Get emitter class from object

DATA
MXPmaterial = 1027417
OXPEmitter = 1027133
OXPGenerator = 1027654
OXPSkinner = 1029227
VXPrender = 1030488
XPARTICLE_FLAGS_ALIVE = 32768
XPARTICLE_FLAGS_BORN = 65536
XPARTICLE_FLAGS_COLLIDED = 32
XPARTICLE_FLAGS_DIE = 131072
XPARTICLE_FLAGS_FREEZE = 4
XPARTICLE_FLAGS_FREEZE_SCALE = 1024
XPARTICLE_FLAGS_FREEZE_SPIN = 512
XPARTICLE_FLAGS_GROUP_CHANGED = 262144
XPARTICLE_FLAGS_INVISIBLE = 2097152
XPARTICLE_FLAGS_ISSTUCK = 16
XPARTICLE_FLAGS_NEW = 524288
XPARTICLE_FLAGS_ROTATED = 4096
XPARTICLE_FLAGS_SCALED = 128
XPARTICLE_FLAGS_STICK = 8
XPARTICLE_FLAGS_STICKSOURCE = 64