ShaderParamDefOptions

Object Hierarchy | Related C++ Class: ShaderParamDefOptions

Inheritance

SIObject

ShaderParamDefOptions

Introduced

v9.0 (2011)

Categories

ICE Shaders

Description

This object provides a convenient way to specify certain characteristics for each shader parameter definition (for example, display name, default values, capabilities, etc.). You can use the same ShaderParamDefOptions object for multiple parameters, changing only the display name (and any other characteristics you need to).

The XSIFactory.CreateShaderParamDefOptions method creates a new ShaderParamDefOptions object which you need to pass to the ShaderParamDefContainer.AddParamDef or ShaderParamDefContainer.AddArrayParamDef when adding parameter definitions.

Methods

IsClassOf operator IsEqualTo operator SetAnimatable operator SetAttribute operator
SetDefaultValue operator SetHardLimit operator SetInspectable operator SetLongName operator
SetShortName operator SetSoftLimit operator SetTexturable operator  
       

Properties

Application Categories FullName operator Help
Name operator NestedObjects Origin OriginPath
Parent Type operator    
       

Examples

Python Example

# 
# This example demonstrates how to create a dynamic shader definition 
# with 2 input parameters. Before adding the input parameters, a 
# ShaderParamDefOptions object is created, populated, and then
# passed into the ShaderParamDefContainer.AddParamDef method.
#
from win32com.client import constants as cns
app = Application
oShaderDef = XSIFactory.CreateShaderDef("MyParserName", "MyDynamicShader", 1, 0)
oShaderDef.AddShaderFamily("mrTexture")
app.LogMessage("Shader definition name: " + oShaderDef.Name)
# Set up shader parameter definition options to use with the first input parameter
oShaderInParamDefOptions = XSIFactory.CreateShaderParamDefOptions()
oShaderInParamDefOptions.SetAnimatable(False)
oShaderInParamDefOptions.SetTexturable(True)
oShaderInParamDefOptions.SetInspectable(True)
oShaderInParamDefOptions.SetShortName("Main Port")
# Add input array parameter to definition
oInputParams = oShaderDef.InputParamDefs
oInputParams.AddParamDef("main", cns.siColorParameterType, oShaderInParamDefOptions)
# You can use the same parameter definition options and just modify what you need
oShaderInParamDefOptions.SetAnimatable(True)
oShaderInParamDefOptions.SetShortName("Secondary Port")
oInputParams.AddParamDef("secondary", cns.siShaderDataTypeBoolean, oShaderInParamDefOptions)
# Now print out the info
app.LogMessage("Number of parameter(s) found: " + str(oInputParams.Definitions.Count))
for oShaderParamDef in oInputParams.Definitions :
        app.LogMessage("\t" + oShaderParamDef.DisplayName)
# INFO : Shader definition name: MyParserName.MyDynamicShader.1.0
# INFO : Number of parameter(s) found: 2
# INFO :        Main Port
# INFO :        Secondary Port

See Also

XSIFactory.CreateShaderParamDefOptions ShaderParamDefContainer.AddParamDef ShaderParamDefContainer.AddArrayParamDef ShaderParamDef Adding Parameter Definitions Shader Definition examples installed with Softimage Shader Parser examples installed with Softimage