Elements (Envelope)

Description

Returns a ClusterElementCollection which provides access to the mapping between the indices of the Envelope and the associated vertex indices. This is important for Envelopes applied on partial clusters. This is equivalent to calling Cluster.Elements on the Cluster that the Envelope is attached to.

C# Syntax

// get accessor
ClusterElementCollection Envelope.get_Elements( Object );

Parameters

Parameter

Type

Description

Time

Double

Time (in frames) at which to get property

Default Value: Current time in frames

Examples

VBScript Example

'vbscript example that demonstrates how Envelope indices are mapped
'to indices of the points on the Geometry via the Envelope.Elements property

newscene ,false

set oSphere = ActiveSceneRoot.AddGeometry( "Sphere", "MeshSurface" )

'Create a cluster that only contains some of the points.
'These are the only points that will be inflenced by the skeleton
set oCluster = oSphere.ActivePrimitive.Geometry.AddCluster( _
              siVertexCluster, "MyFrontPoints", Array( 5,10,12 ) ) 

'Create the skeleton
set oChainRoot = ActiveSceneRoot.Add3DChain
set oEnvelope = oCluster.ApplyEnvelope( oChainRoot, siBranch )

aWeights = oEnvelope.Weights.Array

for iElement=lbound(aWeights,2) to ubound(aWeights,2)

   'Calculate the index of the point that corresponds to this
   'index in the cluster
   iVertex = oEnvelope.Elements.Item( iElement ) 

   logmessage "Envelope Weight " & iElement & _ 
            " refers to point " & iVertex & " on the Geometry"
next

'Output of this script is:
'INFO : "Envelope Weight 0 refers to point 5 on the Geometry"
'INFO : "Envelope Weight 1 refers to point 10 on the Geometry"
'INFO : "Envelope Weight 2 refers to point 12 on the Geometry"


SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index