ShaderParameter

Object Hierarchy | Related C++ Class: ShaderParameter

Inheritance

SIObject

Parameter

ShaderParameter

Introduced

v9.0 (2011)

Description

This object is a specialization of the Parameter interface on a Shader. This interface also has its own specialization for shader array parameters: ShaderArrayParameter.

Methods

AddCustomOp AddExpression AddFCurve AddFCurve2
AddScriptedOp AddScriptedOpFromFile AnimatedParameters Connect
ConnectFromFile ConnectFromFile2 ConnectFromPreset ConnectFromPreset2
ConnectFromProgID ConnectFromProgID2 Disconnect Enable operator
GetInstanceValue GetValue2 operator IsAnimated IsClassOf operator
IsEqualTo operator IsLocked operator IsSupportedInstanceValue PutValue2 operator
SetCapabilityFlag operator SetInstanceValue SetLock Show operator
UnSetLock      
       

Properties

Animatable operator Application Capabilities operator Categories
DataType operator Default operator Definition operator Definition2 operator
Description operator FullName operator HasInstanceValue Help
Keyable operator LockLevel operator LockType operator Marked
Max operator Min operator Model Name operator
NestedObjects Origin OriginPath OriginalValue operator
OverridenObject OverridingObject Parameters operator Parent
Parent3DObject ReadOnly operator ScriptName operator Source
Sources SuggestedMax operator SuggestedMin operator Tags operator
Targets operator Type operator Value operator ValueType operator

Examples

Python Example

# 
# This example demonstrates how to access each shader parameter instantiated 
# on the specified shader and report its shader parameter type
#
from win32com.client import constants as si
app = Application
app.NewScene("", False)
# Set up a dictionary to return nice shader parameter type names
shaderparamtypes = {
	"-1":"siShaderDataTypeUnknown", "0":"siShaderDataTypeBoolean", "1":"siShaderDataTypeInteger",
	"2":"siShaderDataTypeScalar", "3":"siShaderDataTypeVector2", "4":"siShaderDataTypeVector3",
	"5":"siShaderDataTypeVector4", "6":"siShaderDataTypeQuaternion", "7":"siShaderDataTypeMatrix33",
	"8":"siShaderDataTypeMatrix44", "9":"siShaderDataTypeColor3", "10":"siShaderDataTypeColor4",
	"11":"siShaderDataTypeString", "16":"siShaderDataTypeProperty", "17":"siShaderDataTypeProfileCurve",
	"18":"siShaderDataTypeGradient", "32":"siShaderDataTypeReference", "33":"siShaderDataTypeImage",
	"48":"siShaderDataTypeCustom", "64":"siShaderDataTypeStructure", "65":"siShaderDataTypeArray"
}
# Set up a cube with a SimpleSSS shader compound
app.CreatePrim("Cube", "MeshSurface")
sh = app.CreateShaderFromProgID("XSIRTCOMPOUND.SimpleSSS.1.2", "Sources.Materials.DefaultLib.Scene_Material", "")
app.SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.SimpleSSS.Surface", 
	"Sources.Materials.DefaultLib.Scene_Material.Phong.ambient", False)
# Now we can see what kind of parameters are instantiated on this shader
for param in sh.Parameters :
	if (param.IsClassOf(si.siShaderParameterID)) :
		app.LogMessage("'" + param.ScriptName + "' == " + shaderparamtypes[str(param.DataType)])
# Expected output:
# INFO : 'bump' == siShaderDataTypeVector3
# INFO : 'ambient' == siShaderDataTypeColor4
# INFO : 'overall_color' == siShaderDataTypeColor4
# INFO : 'diffuse_color' == siShaderDataTypeColor4
# INFO : 'diffuse_weight' == siShaderDataTypeScalar
# INFO : 'front_sss_color' == siShaderDataTypeColor4
# INFO : 'front_sss_weight' == siShaderDataTypeScalar
# INFO : 'front_sss_radius' == siShaderDataTypeScalar
# INFO : 'back_sss_color' == siShaderDataTypeColor4
# INFO : 'back_sss_weight' == siShaderDataTypeScalar
# INFO : 'back_sss_radius' == siShaderDataTypeScalar
# INFO : 'back_sss_depth' == siShaderDataTypeScalar
# INFO : 'specular' == siShaderDataTypeColor4
# INFO : 'exponent' == siShaderDataTypeScalar
# INFO : 'radiance' == siShaderDataTypeColor4
# INFO : 'light' == siShaderDataTypeImage
# INFO : 'screen_composit' == siShaderDataTypeBoolean
# INFO : 'scale_conversion' == siShaderDataTypeScalar
# INFO : 'falloff' == siShaderDataTypeScalar
# INFO : 'samples' == siShaderDataTypeInteger
# INFO : 'lightmap_gamma' == siShaderDataTypeScalar
# INFO : 'scatter_bias' == siShaderDataTypeScalar
# INFO : 'Surface' == siShaderDataTypeColor4
# INFO : 'Lightmap' == siShaderDataTypeCustom

See Also

Shader Parameter