XSICollection.FindObjectsByMarkingAndCapabilities
 
 
 

XSICollection.FindObjectsByMarkingAndCapabilities

Introduced

v5.0

Description

Returns the list of Parameter objects that match the input criteria (marked parameter list and/or capabilities).

C# Syntax

CXSICollection XSICollection.FindObjectsByMarkingAndCapabilities( Object in_marking, Int32 in_Caps );

Scripting Syntax

oReturn = XSICollection.FindObjectsByMarkingAndCapabilities( [Marking], [Caps] );

Return Value

XSICollection

Parameters

Parameter Type Description
Marking XSICollection, Array or marked parameters The list of marked parameters to find.

Default Value: matches all

Caps siCapabilities The parameter capabilities siCapabilities to match

Default Value: 0 (don't consider capabilities)

Examples

JScript Example

/*
This example demonstrates how to use the FindObjectsByMarkingAndCapabilities method
using several different matching criteria.
*/
NewScene( null, false );
GetPrim( "Null" );
// Collection object
var collection = XSIFactory.CreateActiveXObject( "XSI.Collection" );
// If you want to filter selection
collection.AddItems( Selection );
checkContents( "Selection", collection );
// Find all the keyable parameters (using no marking string)
// You can just omit the optional marking parameter
var subset = collection.FindObjectsByMarkingAndCapabilities( null, siKeyable );
checkContents( "Keyable (no marking)", subset );
// Find all the keyable parameters (using no marking string)
// Or you can use an empty marking string
subset = collection.FindObjectsByMarkingAndCapabilities( "", siKeyable );
checkContents( "Keyable (empty marking)", subset );
// Find all the 'keypanel' (siKeyable Or siNonKeyableVisible) parameters (using no marking string)
subset = collection.FindObjectsByMarkingAndCapabilities( null, (siKeyable || siNonKeyableVisible) );
checkContents( "Keypanel", subset );
// Find all the keyable kinematics local posx parameters
subset = collection.FindObjectsByMarkingAndCapabilities( "kine.posx", siKeyable );
checkContents( "Keyable Local PosX (kine.posx)", subset );
subset = collection.FindObjectsByMarkingAndCapabilities( "kine.local.pos.posx", siKeyable );
checkContents( "Keyable Local PosX (kine.local.pos.posx)", subset );
// Find all the marked keyable parameters
// Here we explicitly set the marking
SetMarking( "kine.local.pos" );
var markings = GetMarking().toArray();          // GetMarking returns a SAFEARRAY
subset = collection.FindObjectsByMarkingAndCapabilities( markings.join(), siKeyable );
checkContents( "Marked Keyable", subset );
// Find all the kinematics local posx parameters (using no capabilities)
subset = collection.FindObjectsByMarkingAndCapabilities( "kine.posx" );
checkContents( "Local PosX (no caps)", subset );
// Find all the animatable parameters (using no marking string)
subset = collection.FindObjectsByMarkingAndCapabilities( null, siAnimatable );
checkContents( "Animatable (no marking)", subset );
// Find all the readonly parameters (using no marking string)
subset = collection.FindObjectsByMarkingAndCapabilities( null, siReadOnly );
checkContents( "Read-Only (no marking)", subset );
// Convenience function to log information about the collection
function checkContents( in_name, in_coll )
{
if ( in_coll.Count > 0 ) {
LogMessage( in_name + " (" + in_coll.Count + ") = " + in_coll.GetAsText() );
} else {
LogMessage( in_name + " is empty" );
}
LogMessage( "--------------------------------------" );
}
//--------------------------------------------------
// Output of above script:
//INFO : Selection (1) = null
//INFO : --------------------------------------
//INFO : Keyable (no marking) (9) = null.kine.local.posx,null.kine.local.posy,null.kine.local.posz,null.kine.local.rotx,null.kine.local.roty,null.kine.local.rotz,null.kine.local.sclx,null.kine.local.scly,null.kine.local.sclz
//INFO : --------------------------------------
//INFO : Keyable (empty marking) (9) = null.kine.local.posx,null.kine.local.posy,null.kine.local.posz,null.kine.local.rotx,null.kine.local.roty,null.kine.local.rotz,null.kine.local.sclx,null.kine.local.scly,null.kine.local.sclz
//INFO : --------------------------------------
//INFO : Keypanel (9) = null.kine.local.posx,null.kine.local.posy,null.kine.local.posz,null.kine.local.rotx,null.kine.local.roty,null.kine.local.rotz,null.kine.local.sclx,null.kine.local.scly,null.kine.local.sclz
//INFO : --------------------------------------
//INFO : Keyable Local PosX (kine.posx) (1) = null.kine.local.posx
//INFO : --------------------------------------
//INFO : Keyable Local PosX (kine.local.pos.posx) (1) = null.kine.local.posx
//INFO : --------------------------------------
//INFO : Marked Keyable (3) = null.kine.local.posx,null.kine.local.posy,null.kine.local.posz
//INFO : --------------------------------------
//INFO : Local PosX (no caps) (1) = null.kine.local.posx
//INFO : --------------------------------------
//INFO : Animatable (no marking) (97) = null.null.size,null.null.primary_icon,null.null.shadow_icon,null.null.shadow_offsetX,null.null.shadow_offsetY,null.null.shadow_offsetZ,null.null.shadow_scaleX,null.null.shadow_scaleY,null.null.shadow_scaleZ,null.null.R,null.null.G,null.null.B,null.kine.global.posx,null.kine.global.posy,null.kine.global.posz,null.kine.global.rotx,null.kine.global.roty,null.kine.global.rotz,null.kine.global.sclx,null.kine.global.scly,null.kine.global.sclz,null.kine.global.sclorix,null.kine.global.scloriy,null.kine.global.scloriz,null.kine.local.blendweight,null.kine.local.active,null.kine.local.posx,null.kine.local.posy,null.kine.local.posz,null.kine.local.rotx,null.kine.local.roty,null.kine.local.rotz,null.kine.local.sclx,null.kine.local.scly,null.kine.local.sclz,null.kine.local.sclorix,null.kine.local.scloriy,null.kine.local.scloriz,null.kine.local.cnsscl,null.kine.local.cnsori,null.kine.local.cnspos,null.kine.local.rotorder,null.kine.local.pivotactive,null.kine.local.pposx,null.kine.local.pposy,null.kine.local.pposz,null.kine.local.protx,null.kine.local.proty,null.kine.local.protz,null.kine.local.psclx,null.kine.local.pscly,null.kine.local.psclz,null.kine.local.pivotcompactive,null.kine.local.pcposx,null.kine.local.pcposy,null.kine.local.pcposz,null.kine.local.pcrotx,null.kine.local.pcroty,null.kine.local.pcrotz,null.kine.local.pcsclx,null.kine.local.pcscly,null.kine.local.pcsclz,null.kine.local.nposx,null.kine.local.nposy,null.kine.local.nposz,null.kine.local.nrotx,null.kine.local.nroty,null.kine.local.nrotz,null.kine.local.nsclx,null.kine.local.nscly,null.kine.local.nsclz,null.kine.local.nsclorix,null.kine.local.nscloriy,null.kine.local.nscloriz,null.visibility.viewvis,null.visibility.rendvis,null.visibility.selectability,null.visibility.hidemaster,null.visibility.primray,null.visibility.scndray,null.visibility.shdwrecv,null.visibility.shdwcast,null.visibility.reflrecv,null.visibility.reflcast,null.visibility.refrrecv,null.visibility.refrcast,null.visibility.trnsrecv,null.visibility.trnscast,null.visibility.fgrecv,null.visibility.fgcast,null.visibility.fgvis,null.visibility.globrecv,null.visibility.globcast,null.visibility.globvis,null.visibility.causrecv,null.visibility.causcast,null.visibility.causvis
//INFO : --------------------------------------
//INFO : Read-Only (no marking) (7) = null.kine.global.velaccactive,null.kine.global.linaccx,null.kine.global.linaccy,null.kine.global.linaccz,null.kine.global.angaccx,null.kine.global.angaccy,null.kine.global.angaccz
//INFO : --------------------------------------