ID (ParticleType)

Description

Returns the scene index for this particle type as a Long. The 'ID' corresponds to the index of this particle type under the Scene Particles container.

C# Syntax

    // get accessor
    Int32 rtn = ParticleType.ID;

Examples

VBScript Example

    '
       ' This example demonstrates how to use the ParticleType.ID property to help find
    '  which ParticleClouds are using the current ParticleType.
    '
       NewScene, false
    set oPType = CreateParticleType()(0)
    Application.LogMessage "CurrentParticleTypeID " & oPType.ID
    set oParticleCloud = ActiveSceneRoot.AddParticleCloud( oPType, "MyCloud" )

    set oPType = CreateParticleType()(0)
    Application.LogMessage "CurrentParticleTypeID " & oPType.ID
    set oParticleCloud = ActiveSceneRoot.AddParticleCloud( oPType , "MyCloud1" )

    set oPType = CreateParticleType()(0)
    Application.LogMessage "CurrentParticleTypeID " & oPType.ID
    set oParticleCloud = ActiveSceneRoot.AddParticleCloud( oPType , "MyCloud2" )
    set oParticleCloud = ActiveSceneRoot.AddParticleCloud( oPType , "MyCloud3" )

    ListCloudUsingCurrentParticleType

    ' --------------------------------------------------------------------------
    '
    ' Current ParticleType is directly under ParTypes node right
    ' after the list of types:
    '
    '  ParTypes (Scene)
    '      - List
    '         + PType
    '         + PType1
    '         + PType2
    '      - PType2
    '         + Renderer
    '
    '
    ' Therefore, the current type is the 2nd Nested Object under the
    ' Scene.ParTypes container.
    '
    ' NB: "Scene.ParTypes" is the FullName; "ParTypes" is the name used
    '     to access the container from the SIObjectCollection returned
    '     by SIObject.NestedObjects.
    '
    sub ListCloudUsingCurrentParticleType()
       ' Get the current particle type
       set oParticleTypeContainer = ActiveProject.ActiveScene.NestedObjects.Item("ParTypes")
       set oCurrentParticleType = oParticleTypeContainer.NestedObjects(1) ' 2nd nested object

       ' Find the Scene_Root particle cloud children
       set oClouds = ActiveSceneRoot.FindChildren( , , siParticleFamily)
       for each oCloud in oClouds
           set oTypes = oCloud.ActivePrimitive.ParticleTypes
           containsID = false
           for each oType in oTypes
              if oType.ID = oCurrentParticleType.ID then
                  containsID = true
                  exit for
              end if
           next
           if containsID then
              Application.LogMessage "The particle cloud " & oCloud &  " uses the current particle type."
           end if

       next

    end sub

    'INFO : CurrentParticleTypeID 0
    'INFO : CurrentParticleTypeID 1
    'INFO : CurrentParticleTypeID 2
    'INFO : The particle cloud MyCloud2 uses the current particle type.
    'INFO : The particle cloud MyCloud3 uses the current particle type.

Autodesk Softimage v7.5