The master system is the main TP engine class. There can only be one master system per document. You can get it with BaseDocument.GetParticleSystem().
Allocates a particle.
Return type: | int |
---|---|
Returns: | The particle ID of the allocated particle, or NOTOK if the allocation failed. |
Allocates num particles and stores their particles IDs.
Note
The count of allocated particles might be unequal to num due to the limit in the settings Max Particles. Change it to increase the count of allocatable particles.
Parameters: | num (int) – The number of particles to allocate. |
---|---|
Return type: | list of int |
Returns: | The list with the allocated particle IDs. |
Allocates num particles and stores their particles IDs.
Note
Normally this should not be used. Instead you should use SetLife() with a negative time, so that the particle in question dies immediately.
Parameters: | pid (int) – Particle ID of the particle to free. Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Frees all particles.
Note
Normally this should not be used. Instead you should use SetLife() with a negative time, so that the particle in question dies immediately.
Allocates a new particle group. Must be freed with FreeParticleGroup(), or inserted into the list with SetPGroupHierarchy().
Return type: | TP_PGroup |
---|---|
Returns: | The new particle group. |
Frees a particle group, removing it from the list.
Parameters: | group (TP_PGroup) – The group to free. |
---|
Performs a hierarchy action on a particle group.
Parameters: |
|
---|
Returns the root group.
Return type: | TP_PGroup |
---|---|
Returns: | The root group. |
Returns the particle groups in ingroup, specified by mode.
Parameters: |
|
||||||
---|---|---|---|---|---|---|---|
Return type: |
list of TP_PGroup |
||||||
Returns: |
The root group. |
Calculates the number of particles in the ingroup group.
Parameters: |
|
---|---|
Return type: |
int |
Returns: |
The number of particles. |
Creates the virtual object hierarchy for a particle group, i.e. an object group containing all particles. Used by the ParticleGeometry object.
Parameters: |
|
---|---|
Return type: | |
Returns: |
Virtual object or None if there was an error. |
Retrieves the group information for a group.
Parameters: | group (TP_PGroup) – Group to get the information for. |
---|---|
Return type: | BaseContainer |
Returns: | The group information for the group. |
Retrieves a group from the information in info.
Parameters: | info (BaseContainer) – The information to search for. |
---|---|
Return type: | TP_PGroup |
Returns: | The retrieved group or None if no group matched. |
Retrieves the number of allocated particles. All particles IDs are less than this value.
Return type: | int |
---|---|
Returns: | Number of particles. |
Retrieves the alive bit of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | bool |
Returns: | True if the particle is alive, otherwise False. |
Retrieves the is-born bit of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | bool |
Returns: | True if the particle was just born, otherwise False. |
Retrieves the is-die bit of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | bool |
Returns: | True if the particle just died, otherwise False. |
Retrieves the enters-group bit of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | bool |
Returns: | True if the particle just entered a group, otherwise False. |
Retrieves the group of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | bool |
Returns: | The group that the particle currently is in, otherwise None. |
Retrieves the position of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | Vector |
Returns: | Particle position. |
Retrieves the velocity of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | Vector |
Returns: | Particle velocity. |
Retrieves the mass of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | float |
Returns: | Particle mass. |
Retrieves the spin of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | float |
Returns: | Particle spin. |
Retrieves the size of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | float |
Returns: | Particle size. |
Retrieves the scale of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | Vector |
Returns: | Particle scale. |
Retrieves the age of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | BaseTime |
Returns: | Particle age. |
Retrieves the lifetime of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | BaseTime |
Returns: | Particle lifetime. |
Retrieves the alignment matrix of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | Matrix |
Returns: | Particle alignment matrix. |
Retrieves the random seed of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | Matrix |
Returns: | Particle random seed. |
Retrieves the transformation matrix of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | Matrix |
Returns: | Particle transformation matrix. |
Retrieves the transformation matrix of a particle.
Note
These are private. Use the functions like Alive() instead.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | Matrix |
Returns: | Particle flags. |
Retrieves the delta time factor of a particle.
Parameters: | pid (int) – Particle ID. ( 0 <= pid < NumParticles() ) |
---|---|
Raises IndexError: | |
Raise if pid is out of range. | |
Return type: | float |
Returns: | Particle flags. |
Retrieves the delta time factor of a particle.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Sets the velocity for a particle.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Sets the mass for a particle.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Sets the spin for a particle.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Sets the age for a particle.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Sets the age for a particle.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Inserts a particle into another group.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Sets the size for a particle.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Sets the size for a particle.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Sets the alignment matrix for a particle.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Sets the alignment matrix for a particle.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Sets the collision handling information for a particle.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Sets the delta time factor for a particle.
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
Sets the data channel value for a particle:
pid = 1
chan = 0
ms.SetPData(pid, chan, "Hello World!")
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
|
Return type: |
bool |
Returns: |
True on success, otherwise False. |
Sets the data channel value for a particle:
pid = 1
chan = 0
value = ms.GetPData(pid, chan, "Hello World!")
Parameters: |
|
---|---|
Raises IndexError: | |
Raise if pid is out of range. |
|
Return type: |
any |
Returns: |
Depends on the type of the channel. |
Adds a new data channel.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if succesful, otherwise False. |
Removes a data channel.
Parameters: | chan (int) – Channel index. ( 0 <= chan < NumDataChannels() ) |
---|---|
Raises IndexError: | |
Raise if chan is out of range. | |
Return type: | bool |
Returns: | True if successful, otherwise False. |
Retrieves the data channel count.
Return type: | int |
---|---|
Returns: | Number of data. |
Retrieves the data type of a data channel.
Parameters: | chan (int) – Channel index. ( 0 <= chan < NumDataChannels() ) |
---|---|
Raises IndexError: | |
Raise if chan is out of range. | |
Return type: | int |
Returns: | Data type of channel chan. |
Retrieves the name of a data channel.
Parameters: | chan (int) – Channel index. ( 0 <= chan < NumDataChannels() ) |
---|---|
Raises IndexError: | |
Raise if chan is out of range. | |
Return type: | str |
Returns: | Number of data. |
Retrieves a unique ID for a data channel that’s independent of its index.
Parameters: | chan (int) – Channel index. ( 0 <= chan < NumDataChannels() ) |
---|---|
Raises IndexError: | |
Raise if chan is out of range. | |
Return type: | int |
Returns: | Unique ID of channel chan. |
Retrieves the index of a data channel from its unique ID.
Parameters: | unique_id (int) – Channel ID. |
---|---|
Return type: | int |
Returns: | Data channel index. |
Retrieves an ID for op
Parameters: | unique_id – A node. |
---|---|
Return type: | int |
Returns: | ID for op. |
A dirty counter for the master system. This can be used to see if anything has changed. Use SetDirty() to increment the counter.
Return type: | long |
---|---|
Returns: | Dirty counter. Is incremented when something changes in the system. |
Increments the dirty counter, i.e. tells anyone using GetDirty() that something has changed.
Note
This has to be used whenever an operator affects particle shapes, like the ObjectShape operator does.