class MFnParticleSystem

Jump to documentation

: public MFnDagNode Class for obtaining information about a particle system. (OpenMayaFX) (OpenMayaFX.py)

Inheritance:

MFnParticleSystem < MFnDagNode < MFnDependencyNode < MFnBase

public members:

MFnParticleSystem ( const MObject & object, MStatus * ReturnStatus = NULL )
enum RenderType
kCloud
kTube
kBlobby
kMultiPoint
kMultiStreak
kNumeric
kPoints
kSpheres
kSprites
kStreak
MObject create ( MStatus * status = NULL )
MObject create ( MObject parent, MStatus * status = NULL )
MStatus emit ( const MPoint & position )
MStatus emit ( const MPointArray & positionArray )
MStatus emit ( const MPoint & position, const MVector & velocity )
MStatus emit ( const MPointArray & positionArray, const MVectorArray & velocityArray )
MStatus saveInitialState () const
void evaluateDynamics ( MTime &to, bool runupFromStart )
bool isValid () const
MString particleName () const
unsigned int count () const
RenderType renderType () const
void position ( MVectorArray & ) const
void velocity ( MVectorArray & ) const
void acceleration ( MVectorArray & ) const
void position0 ( MVectorArray & ) const
void position1 ( MVectorArray & ) const
void radius ( MDoubleArray & ) const
void radius0 ( MDoubleArray & ) const
void radius1 ( MDoubleArray & ) const
double surfaceShading () const
double threshold () const
bool betterIllum () const
bool disableCloudAxis () const
double tailSize () const
void particleIds ( MIntArray & ) const
void age ( MDoubleArray & ) const
void lifespan ( MDoubleArray & ) const
void rgb ( MVectorArray & ) const
void opacity ( MDoubleArray & ) const
void mass ( MDoubleArray & ) const
void emission ( MVectorArray & ) const
bool hasLifespan () const
bool hasRgb () const
bool hasOpacity () const
bool hasEmission () const
bool primaryVisibility () const
bool visibleInReflections () const
bool visibleInRefractions () const
bool castsShadows () const
bool receiveShadows () const
unsigned int getPerParticleAttribute ( const MString &attrName, MIntArray &, MStatus * status = NULL ) const
unsigned int getPerParticleAttribute ( const MString &attrName, MVectorArray &, MStatus * status = NULL ) const
unsigned int getPerParticleAttribute ( const MString &attrName, MDoubleArray &, MStatus * status = NULL ) const
void setPerParticleAttribute ( const MString &attrName, MVectorArray &, MStatus * status = NULL ) const
void setPerParticleAttribute ( const MString &attrName, MDoubleArray &, MStatus * status = NULL ) const
bool isPerParticleIntAttribute ( const MString &attrName, MStatus * status = NULL ) const
bool isPerParticleDoubleAttribute ( const MString &attrName, MStatus * status = NULL ) const
bool isPerParticleVectorAttribute ( const MString &attrName, MStatus * status = NULL ) const
bool isDeformedParticleShape ( MStatus * status = NULL ) const
MObject deformedParticleShape ( MStatus * status = NULL ) const
MObject originalParticleShape ( MStatus * status = NULL ) const

Inherited from MFnDagNode:

public members:

kNextPos
MObject create ( const MTypeId &typeId, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId &typeId, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
unsigned int parentCount ( MStatus * ReturnStatus = NULL ) const
MObject parent ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MStatus addChild ( MObject & child , unsigned int index = kNextPos , bool keepExistingParents = false )
MStatus removeChild ( MObject & child )
MStatus removeChildAt ( unsigned int index )
unsigned int childCount ( MStatus * ReturnStatus = NULL ) const
MObject child ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MObject dagRoot ( MStatus * ReturnStatus = NULL )
bool hasParent ( const MObject & node, MStatus * ReturnStatus = NULL ) const
bool hasChild (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isChildOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isParentOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool inUnderWorld ( MStatus * ReturnStatus = NULL ) const
bool inModel ( MStatus * ReturnStatus = NULL ) const
bool isInstanceable ( MStatus * ReturnStatus=NULL ) const
MStatus setInstanceable ( const bool how )
bool isInstanced ( bool indirect = true, MStatus * ReturnStatus = NULL ) const
bool isInstancedAttribute ( const MObject & attr, MStatus * ReturnStatus = NULL ) const
unsigned int instanceCount ( bool total, MStatus * ReturnStatus = NULL ) const
MObject duplicate ( bool instance = false, bool instanceLeaf = false, MStatus * ReturnStatus = NULL ) const
MStatus getPath ( MDagPath & path )
MStatus getAllPaths ( MDagPathArray & paths )
MString fullPathName ( MStatus *ReturnStatus = NULL)
MString partialPathName ( MStatus *ReturnStatus = NULL)
MMatrix transformationMatrix ( MStatus * ReturnStatus = NULL ) const
bool isIntermediateObject ( MStatus * ReturnStatus = NULL ) const
MStatus setIntermediateObject ( bool isIntermediate )
int objectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setObjectColor ( int color )
bool usingObjectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setUseObjectColor ( bool useObjectColor )
MBoundingBox boundingBox ( MStatus * ReturnStatus = NULL ) const
MDagPath dagPath ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MDagPath & path )
virtual MStatus setObject ( MObject & object )
MObject model ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MObject & object )

Inherited from MFnDependencyNode:

public members:

virtual MFn::Type type () const
enum MAttrClass
kGlobalDynamicAttr
kLocalDynamicAttr
MObject create ( const MTypeId & typeId , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId & typeId , const MString & name , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , const MString & name , MStatus * ReturnStatus = NULL )
MTypeId typeId ( MStatus * ReturnStatus = NULL ) const
MString typeName ( MStatus * ReturnStatus = NULL ) const
MString name ( MStatus * ReturnStatus = NULL ) const
MString setName ( const MString & name , MStatus * ReturnStatus = NULL )
MStatus getConnections ( MPlugArray & array ) const
unsigned int attributeCount ( MStatus * ReturnStatus=NULL) const
MObject attribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject reorderedAttribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject attribute ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MAttrClass attributeClass ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MStatus getAffectedAttributes ( const MObject & attr, MObjectArray & affectedAttributes ) const
MStatus getAffectedByAttributes ( const MObject & attr, MObjectArray & affectedByAttributes ) const
MPlug findPlug ( const MObject & attr, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MStatus addAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MStatus removeAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MPxNode * userNode ( MStatus * ReturnStatus=NULL ) const
bool isFromReferencedFile ( MStatus * ReturnStatus=NULL) const
bool isShared ( MStatus * ReturnStatus=NULL) const
bool hasUniqueName ( MStatus * ReturnStatus=NULL) const
MString parentNamespace ( MStatus * ReturnStatus=NULL) const
bool isLocked ( MStatus * ReturnStatus=NULL) const
MStatus setLocked ( bool locked )
static MString classification ( const MString & nodeTypeName )
bool isNewAttribute ( const MObject & attr, MStatus * ReturnStatus=NULL) const
static unsigned int allocateFlag ( const MString pluginName, MStatus * ReturnStatus=NULL )
static MStatus deallocateFlag (const MString pluginName, unsigned int flag)
static MStatus deallocateAllFlags (const MString pluginName)
MStatus setFlag (unsigned int flag, bool state)
bool isFlagSet (unsigned int flag, MStatus * ReturnStatus=NULL) const
bool isDefaultNode ( MStatus * ReturnStatus=NULL) const
MStatus setDoNotWrite ( bool flag )
bool canBeWritten ( MStatus * ReturnStatus=NULL) const
bool hasAttribute (const MString & name , MStatus * ReturnStatus=NULL) const
MObject getAliasAttr (bool force, MStatus * ReturnStatus=NULL)
bool setAlias (const MString & alias,const MString & name , const MPlug & plug, bool add=true, MStatus * ReturnStatus=NULL)
bool findAlias (const MString & alias, MObject & attrObj, MStatus * ReturnStatus=NULL) const
bool getAliasList ( MStringArray & strArray, MStatus * ReturnStatus=NULL)
MString plugsAlias (const MPlug & plug, MStatus * ReturnStatus=NULL)
public
bool getPlugsAlias (const MPlug & plug, MString & aliasName, MStatus * ReturnStatus=NULL)

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

Class for obtaining information about a particle system. (OpenMayaFX) (OpenMayaFX.py)
Description

Particle object access class.

Use this chart to determine which methods to call based on the render type of the particle object:

Functions

MFnParticleSystem:: MFnParticleSystem ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnParticleSystem:: MFnParticleSystem ( MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given MObject.

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnParticleSystem:: MFnParticleSystem ( const MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MObject.

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnParticleSystem:: MFnParticleSystem ( const MDagPath & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MDagPath object.

Arguments

  • object the const MDagPath to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFn::Type MFnParticleSystem:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kParticle

MFnParticleSystem:: ~MFnParticleSystem ()

Description

Class destructor.

MObject MFnParticleSystem:: create ( MStatus * ReturnStatus)

Description

To create a new particleShape with a transform.

Arguments

  • ReturnStatus Status code

Return Value

  • The newly created particleShape

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MObject MFnParticleSystem:: create ( MObject parentMObj, MStatus *ReturnStatus)

Description

To create a new particleShape. If the parent is not specified, a new transform will be created as the parent.

Arguments

  • parent The parent as an MObject
  • ReturnStatus Status code

Return Value

  • The newly created particleShape

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

void MFnParticleSystem:: evaluateDynamics ( MTime &to, bool runupFromStart )

Description

Run up the particle system to a certain frame, from either the current frame, or from the start of the simulation.

bool MFnParticleSystem:: isValid () const

Description

Returns false if the particle array is NULL.

Returns true otherwise.

MString MFnParticleSystem:: particleName () const

Description

Returns the name of this particle system.

unsigned int MFnParticleSystem:: count () const

Description

Returns the particle count at the current frame.

MFnParticleSystem::RenderType MFnParticleSystem:: renderType () const

Description

Return the render type used by the particle object.

void MFnParticleSystem:: particleIds ( MIntArray & ids ) const

Description

Return an array of particle identifiers at the start of the time step. The array of particle id's is correlated with the other per-particle arrays returned by this class, so ids[i] will be the id for the particle with position position[i], velocity[i], etc., as long as all these arrays were retrieved for the same time step.

The particle id is a constant identifier for an individual particle that does not change between time steps. The particle id can be used to follow the path of a single particle between frames. Only living particle identifiers are returned by this method.

Arguments

  • ids Array of particle identifiers. The contents of the array are overwritten with the current list of particle identifiers.

void MFnParticleSystem:: position ( MVectorArray & positions ) const

Description

Compute each particle's position at the start of the time step. This is done by taking the particle's current position and velocity, and extrapolation backwards in time.

NOTE: For an MFnParticleSystem of renderType kTube, use position0() and position1() instead.

void MFnParticleSystem:: position0 ( MVectorArray & positions ) const

Description

Only for use with an MFnParticleSystem of renderType kTube.

Calculates particle start positions.

void MFnParticleSystem:: position1 ( MVectorArray & positions ) const

Description

Only for use with an MFnParticleSystem of renderType kTube.

Calculates particle end positions.

void MFnParticleSystem:: radius ( MDoubleArray & radii ) const

Description

Calculates particle radii.

NOTE: For an MFnParticleSystem of renderType kTube, use position0() and position1() instead.

void MFnParticleSystem:: radius0 ( MDoubleArray & radii ) const

Description

Only for use with an MFnParticleSystem of renderType kTube.

Calculates the particles' start radii.

void MFnParticleSystem:: radius1 ( MDoubleArray & radii ) const

Description

Only for use with an MFnParticleSystem of renderType kTube.

Calculates the particles' end radii.

double MFnParticleSystem:: surfaceShading () const

Description

Only for use with an MFnParticleSystem of renderType kCloud.

Returns the object surface shading value.

double MFnParticleSystem:: threshold () const

Description

Only for use with an MFnParticleSystem of renderType kCloud or kBlobby.

Returns the object threshold.

bool MFnParticleSystem:: betterIllum () const

Description

Only for use with an MFnParticleSystem of renderType kCloud.

Returns a boolean indicating whether or not thick cloud sampling is already enabled.

bool MFnParticleSystem:: disableCloudAxis () const

Only for use with an MFnParticleSystem of renderType kCloud.

Internal use for better illum.

NOTE: Internal use only. Do not call.

double MFnParticleSystem:: tailSize () const

Description

Only for use with an MFnParticleSystem of renderType kTube.

Returns the length scale factor.

void MFnParticleSystem:: age ( MDoubleArray & ages ) const

Description

Populates the given array with the age values of the particles in this system.

void MFnParticleSystem:: lifespan ( MDoubleArray & lifespans ) const

Description

Populates the given array with the lifespan values of the particles in this system, if the particles have this attribute. See hasLifespan().

void MFnParticleSystem:: rgb ( MVectorArray & colors ) const

Description

Populates the given array with the color values of the particles in this system, if the particles have this attribute. See hasRgb().

For each particle, processes the internal representation into RGB color values, which are mapped to a vector.

void MFnParticleSystem:: opacity ( MDoubleArray & opacities ) const

Description

Populates the given array with the opacity values of the particles in this system, if the particles have this attribute. See hasOpacity().

void MFnParticleSystem:: emission ( MVectorArray & emissions ) const

Description

Populates the given array with the incandescence values of the particles in this system, if the particles have this attribute. See hasEmission().

bool MFnParticleSystem:: hasLifespan () const

Description

Returns whether or not the particles in this system have a lifespan attribute. See lifespan().

bool MFnParticleSystem:: hasRgb () const

Description

Returns whether or not the particles in this system have an rgb attribute. See rgb().

bool MFnParticleSystem:: hasOpacity () const

Description

Returns whether or not the particles in this system have an opacity attribute. See opacity().

bool MFnParticleSystem:: hasEmission () const

Description

Returns whether or not the particles in this system have an emission attribute. See emission().

bool MFnParticleSystem:: primaryVisibility () const

Description

Returns whether or not the rendering attribute for primary visibility in reflections has been enabled.

bool MFnParticleSystem:: visibleInReflections () const

Description

Returns whether or not the rendering attribute for particle visibility in reflections has been enabled.

bool MFnParticleSystem:: visibleInRefractions () const

Description

Returns whether or not the rendering attribute for particle visibility in refractions has been enabled.

bool MFnParticleSystem:: castsShadows () const

Description

Returns whether or not the rendering attribute for particles casting shadows has been enabled.

bool MFnParticleSystem:: receiveShadows () const

Description

Returns whether or not the rendering attribute for particles receiving shadows has been enabled.

MStatus MFnParticleSystem:: emit (const MPoint &v)

Description

To add a new particle at the given position.

Arguments

  • position The particle's position

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation fail

MStatus MFnParticleSystem:: emit (const MPoint &p, const MVector &v)

Description

To add a new particle at the position with its velocity.

Arguments

  • position The particle's position
  • velocity The particle's velocity

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation fail

MStatus MFnParticleSystem:: emit (const MPointArray &pArray)

Description

To add an array of new particles at the given positions.

Arguments

  • positionArray The particle's position array

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation fail

MStatus MFnParticleSystem:: emit (const MPointArray &pArray, const MVectorArray &vArray)

Description

To add an array of new particles at the given positions with their velocity values.

Arguments

  • positionArray The particle's position array
  • velocityArray The particle's velocity array

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation fail

MStatus MFnParticleSystem:: saveInitialState () const

Description

To reset the particle's current state as the initial state.

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation fail

void MFnParticleSystem:: velocity ( MVectorArray &array) const

Description

To return velocity array for all particles.

Arguments

  • array The resulting velocity array

void MFnParticleSystem:: acceleration ( MVectorArray &array) const

Description

To return acceleration array for all particles.

Arguments

  • array The resulting acceleration array

void MFnParticleSystem:: mass ( MDoubleArray &array) const

Description

To return mass array for all particles.

Arguments

  • mass The resulting mass array

bool MFnParticleSystem:: isPerParticleIntAttribute (const MString &attrName, MStatus * ReturnStatus ) const

Description

To check if the input attribute is a per particle integer attribute.

Arguments

  • attrName The input attribute name
  • status The return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation fail

bool MFnParticleSystem:: isPerParticleDoubleAttribute ( const MString &attrName, MStatus * ReturnStatus ) const

Description

To check if the input attribute is a per particle double attribute.

Arguments

  • attrName The input attribute name
  • status The return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation fail

bool MFnParticleSystem:: isPerParticleVectorAttribute ( const MString &attrName, MStatus * ReturnStatus ) const

Description

To check if the input attribute is a per particle vector attribute.

Arguments

  • attrName The input attribute name
  • status The return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation fail

unsigned int MFnParticleSystem:: getPerParticleAttribute ( const MString &attrName, MVectorArray & array, MStatus * ReturnStatus ) const

Description

To get the per particle vector attribute of the given name.

Arguments

  • attrName The input attribute name
  • array The returned vector array

Return Value

  • The size of the returned vector array

unsigned int MFnParticleSystem:: getPerParticleAttribute ( const MString &attrName, MDoubleArray & array, MStatus * ReturnStatus ) const

Description

To get the per particle double attribute of the given name

Arguments

  • attrName The input attribute name
  • array The returned double array
  • status The return status

Return Value

  • The size of the returned double array

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation fail

unsigned int MFnParticleSystem:: getPerParticleAttribute ( const MString &attrName, MIntArray & array, MStatus * ReturnStatus ) const

Description

To get per particle integer attribute with its attribute name.

Arguments

  • attrName The input attribute name
  • array The returned integer array
  • status The return status

Return Value

  • The size of the returned integer array

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation fail

void MFnParticleSystem:: setPerParticleAttribute ( const MString &attrName, MVectorArray & array, MStatus * ReturnStatus ) const

Description

To set the per particle vector attribute of the given name with the given values.

Arguments

  • attrName The input attribute name
  • array The input vector array
  • status The return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation fail

void MFnParticleSystem:: setPerParticleAttribute ( const MString &attrName, MDoubleArray & array, MStatus * ReturnStatus ) const

Description

To set the per particle double attribute of the given name with the given values.

Arguments

  • attrName The input attribute name
  • array The input double array
  • status The return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation fail

bool MFnParticleSystem:: isDeformedParticleShape ( MStatus * ReturnStatus ) const

Description

To return if this particle shape is deformed.

Arguments

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

Return Value

  • true particle shape is deformed
  • false particle shape is original

MObject MFnParticleSystem:: deformedParticleShape ( MStatus * ReturnStatus ) const

Description

To get the deformed particleShape.

Arguments

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

Return Value

  • The particle shape connecting to the output of the deformer(s)

MObject MFnParticleSystem:: originalParticleShape ( MStatus * ReturnStatus ) const

Description

To get the original particleShape.

Arguments

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

Return Value

  • The particle shape connecting to the input of the deformer(s)

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright