Dim oColl ' object pointer for collection
Dim oExpColl ' object pointer for expanded collection
' Create the new collection & populate it
Set oColl = CreateObject( "XSI.Collection" )
oColl.Add ActiveSceneRoot
checkContents "oColl", oColl
' Expand the collection and save it as a new collection
LogMessage "----------------"
Set oRoot = oColl.Item(0)
oRoot.BranchFlag = siBranch
Set oExpColl = oColl.Expand
checkContents "oExpColl", oExpColl
' Now start again but this time don't set the branch flag
LogMessage "----------------"
oExpColl.RemoveAll
oRoot.BranchFlag = siNode
Set oExpColl = oColl.Expand
checkContents "oExpColl", oExpColl
'--------------------------------------------------
function checkContents( in_name, in_coll )
If in_coll.Count > 0 Then
LogMessage in_name & " collection now contains " & in_coll.GetAsText
Else
LogMessage in_name & " collection is empty."
End If
end function
'--------------------------------------------------
' Output of above script:
'INFO : "oColl collection now contains Scene_Root"
'INFO : "----------------"
'INFO : "oExpColl collection now contains Scene_Root,Camera_Root,Camera,Camera_Interest,light"
'INFO : "----------------"
'INFO : "oExpColl collection now contains Scene_Root" |