ShaderParamDefContainer

ShaderParamDefContainer

Object Hierarchy | 関連する C++クラス:ShaderParamDefContainer

継承

SIObject

ShaderParamDefContainer

導入

v9.0 (2011)

詳細

このオブジェクトは、シェーダ定義オブジェクト(ShaderDef)で定義される入力および出力パラメータのリストを管理します。これはメンバを追加および削除できるShaderParamDefCollectionでの特別な抽出機能のようですが、本当の ShaderParamDefCollection にアクセスし(ShaderParamDefContainer.Definitionsメンバを介して)、パラメータのリストを繰り返し処理します。

ShaderParamDefContainer を戻すプロパティには、ShaderDef.InputParamDefsShaderStructParamDef.SubParamDefs、およびShaderDef.OutputParamDefsの 3 つがあります。

メソッド

AddArrayParamDefオペレータ AddArrayParamDef2オペレータ AddParamDefオペレータ AddParamDef2オペレータ
GetParamDefByNameオペレータ GetParamDefByName2オペレータ IsClassOfオペレータ IsEqualToオペレータ

プロパティ

Application Categories Definitionsオペレータ FullNameオペレータ
Help Nameオペレータ NestedObjects Origin
OriginPath Parent Typeオペレータ  
       

1. Python の例

# 

# This example demonstrates how to create a dynamic shader definition 

# and then access/populate its input and output parameters via the 

# ShaderParamDefContainer interface.

#

from win32com.client import constants as cns

app = Application

oShaderDef = XSIFactory.CreateShaderDef("baddog", "mr_piddles", 1, 0)#

oShaderDef.AddShaderFamily("mrTexture")

app.LogMessage("Shader definition name: " + oShaderDef.Name)

# Set up shader parameter definition options to use with new input parameter

oShaderInParamDefOptions = XSIFactory.CreateShaderParamDefOptions();

oShaderInParamDefOptions.SetAnimatable(False)

oShaderInParamDefOptions.SetTexturable(True)

oShaderInParamDefOptions.SetInspectable(True)

oShaderInParamDefOptions.SetShortName("Bones-y")

# Add input parameter to definition

oInputParams = oShaderDef.InputParamDefs

oInputParams.AddParamDef("bonesy", cns.siShaderDataTypeColor4, oShaderInParamDefOptions)

# Set up shader parameter definition options to use with new output parameter

oShaderOutParamDefOptions = XSIFactory.CreateShaderParamDefOptions()

oShaderOutParamDefOptions.SetAnimatable(False)

oShaderOutParamDefOptions.SetTexturable(True)

oShaderOutParamDefOptions.SetInspectable(True)

oShaderOutParamDefOptions.SetShortName("Chew Toys")

# Add output parameter to definition

oOutputParams = oShaderDef.OutputParamDefs

oOutputParams.AddArrayParamDef("chewtoys", cns.siShaderDataTypeStructure, oShaderOutParamDefOptions)

# Now print info to see what we have

for oShaderInParamDef in oShaderDef.InputParamDefs.Definitions :

	Application.LogMessage("Input parameter name: " + oShaderInParamDef.DisplayName)

for oShaderOutParamDef in oShaderDef.OutputParamDefs.Definitions :

	Application.LogMessage("Output parameter name: " + oShaderOutParamDef.DisplayName)

# Expected results:

# INFO : Shader definition name: baddog.mr_piddles.1.0

# INFO : Input parameter name: Bones-y

# INFO : Output parameter name: Chew Toys

2. JScript の例

// See the example under the ShaderParamDefContainer.GetParamDefByName method reference page

関連項目

ShaderDef.InputParamDefs ShaderDef.OutputParamDefs ShaderStructParamDef.SubParamDefs ShaderParamDef ShaderDef Shader Parameter Definitions Shader Definition examples installed with Softimage Shader Parser examples installed with Softimage