ParameterCollection
 
 
 

ParameterCollection

Related C++ Class: CParameterRefArray

Introduced

v1.5

Description

A collection of objects that implement the Parameter interface. In other words, each member of this collection is either of class Parameter or of any descendent class (ShaderParameter, ShaderArrayParameter, KinematicState, etc.). For a list of interfaces that implement the Parameter interface, see its object hierarchy.

Methods

Filter Find GetAsText  
       

Properties

Count operator Item operator    
       

Examples

1. JScript Example

/*
        This example demonstrates how to access a shader's parameter collection 
*/
NewScene(null, false);
// Set up a cylinder with a Color Ramp shader 
CreatePrim("Cylinder", "MeshSurface");
var sh = CreateShaderFromProgID("MetaSL.Generator_color_ramp.1.0", "Sources.Materials.DefaultLib.Scene_Material");
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.Color_Ramp.result", 
        "Sources.Materials.DefaultLib.Scene_Material.Phong.ambient", false);
// Check the class of each parameter in the collection
for (var i=0; i<sh.Parameters.Count; i++) {
        var param = sh.Parameters.Item(i);
        Application.LogMessage( param.ScriptName + " is a(n) " + Application.ClassName(param) );
}
// Expected output:
// INFO : Name is a(n) Parameter
// INFO : location is a(n) ShaderParameter
// INFO : inputs is a(n) ShaderArrayParameter
// INFO : interpolation_style is a(n) ShaderParameter
// INFO : result is a(n) ShaderParameter

2. VBScript Example

set oRoot = Application.ActiveProject.ActiveScene.Root
set oCube = oRoot.AddGeometry( "Cube", "MeshSurface" )
for each oParam in oCube.Parameters
        LogMessage oParam.Name
next

See Also

Parameter.AnimatedParameters Parameter.Parameters ProjectItem.Parameters ProjectItem.AnimatedParameters2 Shader.Parameters Shader.Parameters ShaderParameter.Targets X3DObject.NodeAnimatedParameters