Object Hierarchy | 関連する C++クラス:ShaderParamDefContainer
ShaderParamDefContainer
v9.0 (2011)
このオブジェクトは、シェーダ定義オブジェクト(ShaderDef)で定義される入力および出力パラメータのリストを管理します。これはメンバを追加および削除できるShaderParamDefCollectionでの特別な抽出機能のようですが、本当の ShaderParamDefCollection にアクセスし(ShaderParamDefContainer.Definitionsメンバを介して)、パラメータのリストを繰り返し処理します。
ShaderParamDefContainer を戻すプロパティには、ShaderDef.InputParamDefs、ShaderStructParamDef.SubParamDefs、およびShaderDef.OutputParamDefsの 3 つがあります。
AddArrayParamDef | AddArrayParamDef2 | AddParamDef | AddParamDef2 |
GetParamDefByName | GetParamDefByName2 | IsClassOf | IsEqualTo |
# # 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 |
// See the example under the ShaderParamDefContainer.GetParamDefByName method reference page |