Related Scripting Object: ParticleType | Supported Parameter List: ParType
Represents a particle type. A particle type serves as a definition of the particles on the initial state of a particle simulation. More...
#include <xsi_particletype.h>
Inheritance diagram for ParticleType:

Public Member Functions |
|
| ParticleType () | |
| ~ParticleType () | |
| ParticleType (const CRef &in_ref) | |
| ParticleType (const ParticleType &in_obj) | |
| bool | IsA (siClassID in_ClassID) const |
| siClassID | GetClassID () const |
| ParticleType & | operator= (const ParticleType &in_obj) |
| ParticleType & | operator= (const CRef &in_ref) |
| LONG | GetID () const |
| CStatus | AddAttribute (const CString &in_name, XSI::siParticleAttributeType in_type) const |
| CStatus | RemoveAttribute (const CString &in_name) const |
| CStringArray | GetAttributeNames () const |
| XSI::siParticleAttributeType | GetAttributeType (const CString &in_name) const |
A particle cloud contains one or more particle type(s). All particle types in a scene can be found under Scene.Particles container.
using namespace XSI; Application app ; CValueArray args(2) ; CValue outArg; args[0] = (LONG) siSphereType ; app.ExecuteCommand( L"CreateParticleType", args, outArg ) ; ParticleType myParType = args[1] ; myParType.PutName( CString(L"CustomParType") ) ; myParType.AddAttribute(L"myVector3Attr", siPAVector3); CRefArray particleTypeArray ; particleTypeArray.Add( myParType ) ; // Create a particle cloud. This has no emittor, and no particle operator // so the cloud state is completely the responsibility of the plug-in // and will not change even if the current frame is changed ParticleCloud myParticleCloud ; app.GetActiveSceneRoot().AddParticleCloud( particleTypeArray, L"MyCloud", myParticleCloud ) ; ParticleCloudPrimitive myParticlePrim = myParticleCloud.GetActivePrimitive() ; // Our "CustomParType" will automatically be used because // we specified it in the call to AddParticleCloud myParticlePrim.AddParticles( 10, CRef() ) ; // Setting the user defined particle attribute for ( LONG i = 0 ; i < 10 ; i++ ) { Particle oParticle = myParticlePrim.GetParticle(i) ; CRefArray attributes = oParticle.GetAttributes() ; ParticleAttribute myPA(attributes.GetItem(L"myVector3Attr")); myPA.PutValue( MATH::CVector3(1.0,1.0, 1.0)) ; }
| ParticleType | ( | ) |
Default constructor.
| ~ParticleType | ( | ) |
Default destructor.
| ParticleType | ( | const CRef & | in_ref | ) |
Constructor.
| in_ref | constant reference object. |
| ParticleType | ( | const ParticleType & | in_obj | ) |
Copy constructor.
| in_obj | constant class object. |
| bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
| in_ClassID | class type. |
Reimplemented from Property.
| siClassID GetClassID | ( | ) | const [virtual] |
Returns the type of the API class.
Reimplemented from Property.
| ParticleType& operator= | ( | const ParticleType & | in_obj | ) |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
| in_obj | constant class object. |
| ParticleType& operator= | ( | const CRef & | in_ref | ) |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
| in_ref | constant class object. |
Reimplemented from Property.
| LONG GetID | ( | ) | const |
Returns the scene index for this particle type, which corresponds to the index of this particle type under the Scene.Particles container.
| CStatus AddAttribute | ( | const CString & | in_name, | |
| XSI::siParticleAttributeType | in_type | |||
| ) | const |
Adds a new user-defined attribute to this particle type. You must specify a type (ParticleAttribute.GetAttributeType) and a unique name for the new attribute. This function fails if another user-defined attribute with the same name exists.
| in_name | name of the defined attribute | |
| in_type | type of the defined attribute |
CStatus::Fail other failure
CStatus::InvalidArgument if in_type is siPAUndefined
Removes a user-defined attribute from this particle type by specifying the name.
| in_name | name of the attribute to remove. |
CStatus::Fail other failure
CStatus::False the attribute of name in_name was not found on the ParticleType.
| CStringArray GetAttributeNames | ( | ) | const |
Returns an array containing the names of all user-defined attributes for this particle type.
| XSI::siParticleAttributeType GetAttributeType | ( | const CString & | in_name | ) | const |
Returns the data type of the specified attribute. If no attribute matches the specified name, it returns siPAUndefined.
| in_name | name of the attribute to remove. |
siPAUndefined if no match is found