Attributes (Particle)

Introduced

4.0

Description

Returns all particle attributes in a ParticleAttributeCollection.

C# Syntax

    // get accessor
    ParticleAttributeCollection rtn = Particle.Attributes;

Examples

VBScript Example

    '
    '  Example that demonstrates how to create a user defined particle attribute on
    '  a ParticleType and access its value within a particle cloud
    '
    NewScene , false
    set ParTypeCol = CreateParticleType
    set oParticleType = ParTypeCol(0)

    oParticleType.AddAttribute "ZetaFactor", siPAVector3

    set oParticleCloud = ActiveSceneRoot.AddParticleCloud( oParticleType , "MyCloud" )

    set oParticleCloudPrim = oParticleCloud.ActivePrimitive

    oParticleCloudPrim.AddParticles 10, oParticleType

    set oParticleCollection = oParticleCloudPrim.Particles

    ' Vector object that we use to fill in the x,y,z positions
    set oPos = XSIMath.CreateVector3

    ' Setting the ParticleAttribute value
    for i = 0 to 9
              set oParticle = oParticleCollection(i)
              oPos.X = -5 + i
              oPos.Y = -3 + i
              oPos.Z = i
              oParticle.Attributes("ZetaFactor").Value = oPos
    next

    ' Retrieving the ParticleAttribute value and printing it
    for i = 0 to 9
       set oParticle = oParticleCollection(i)
       set oVector3 = oParticle.Attributes( "ZetaFactor" ).Value
       LogMessage oVector3.X & " " & oVector3.Y & " " & oVector3.Z
    next

Autodesk Softimage v7.5