ShaderArrayParamDef.ItemDef
 
 
 

ShaderArrayParamDef.ItemDef operator

Introduced

v9.0 (2011)

Description

Returns the underlying ShaderParamDef or ShaderStructParamDef object for this array item.

You can use this when you want to query an existing shader definition to find out information about its parameter definitions. For example, if you are writing a tool to find a parameter defined as an array of booleans. The example below demonstrates using this to query an array of structures to find its sub types.

Note: This method could return an invalid object in python, use ShaderArrayParamDef.ItemDef2 instead.

C# Syntax

// get accessor
ShaderParamDef rtn = ShaderArrayParamDef.ItemDef;

Examples

Python Example

#
# This example goes through the list of shader definitions in Softimage, 
# looks for arrays of structures and prints the parameter names as well
# as the ProgID of the owning shader definition
#
from win32com.client import constants as si
app = Application
app.NewScene("", 0)
for shaderdef in app.ShaderDefinitions :
        for paramdef in shaderdef.InputParamDefs.Definitions :
                if paramdef.IsArray :
                        underlying = paramdef.ItemDef2
                        if underlying.IsStructure :
                                app.LogMessage("Found an array of structures for %s in %s" 
                                        % (paramdef.Name, shaderdef.ProgID))
# Expected results:
# INFO : Found an array of structures for lights in Softimage.material-phong.1.0
# INFO : Found an array of structures for Lights in Softimage.Bionic_Volume_vol.1.0
# INFO : Found an array of structures for lights in Softimage.material-lambert.1.0
# INFO : Found an array of structures for scatter_lights_input in Softimage.March_Fractal_vol.1.0
# INFO : Found an array of structures for shadow_lights_input in Softimage.March_Fractal_vol.1.0
# INFO : Found an array of structures for trans_model in Softimage.March_Fractal_vol.1.0

See Also

ShaderArrayParameter