Returns whether the shader parameter is an input or output parameter and also its type. If the parameter is not connected to a shader, this method returns siUnknownParameterType instead.

C# Syntax

Object Shader.GetShaderParameterType( String in_ParameterName );

Scripting Syntax

oArray = Shader.GetShaderParameterType( ParameterScriptName );

Return Value

A two-member Array where item[0] is a Boolean and item[1] is a siShaderParameterType value.

If the parameter is not connected to a shader, this method returns siUnknownParameterType instead.


Parameter Type Description
ParameterScriptName String Script name of parameter (Parameter.ScriptName).


JScript Example

	This example shows how to set up a texture shader on a sphere
	and then get information about one of its parameters.
// Create an object with a texture shader
NewScene( null, false );
var root = Application.ActiveProject.ActiveScene.Root;
var model = root.AddModel(); = "MyModel";
var object = model.AddGeometry( "Sphere", "MeshSurface" );
BlendInPresets( "Image", object, 1, false );
CreateProjection( object, siTxtSpherical, siTxtDefaultSpherical, "TxtSupport", "TxtProjection" );
var filename = Application.InstallationPath( siFactoryPath ) + 
var imageclip = CreateImageClip( filename, "XSILogo" );
// Set up the texture space on texture shader
var mat = object.Material;
var textureshader = object.Material.CurrentTexture;
// GetShaderParameterType returns a SafeArray, so convert it to a JS array
var vbShaderInfo = textureshader.GetShaderParameterType("tex");
var shaderInfo = vbShaderInfo.toArray();
Application.LogMessage( shaderInfo[0] );
Application.LogMessage( ShaderParameterTypeAsText(shaderInfo[1]) );
// Expected results:
// INFO : True
// INFO : siTextureParameterType
// Convenience function to get a human-readable string
function ShaderParameterTypeAsText(type)
	switch (type)
		case siUnknownParameterType : return "siUnknownParameterType";		
		case siBooleanParameterType : return "siBooleanParameterType";		
		case siColorParameterType : return "siColorParameterType";		
		case siDataParameterType : return "siDataParameterType";		
		case siIntegerParameterType : return "siIntegerParameterType";		
		case siLensParameterType : return "siLensParameterType";		
		case siLightParameterType : return "siLightParameterType";		
		case siMaterialParameterType : return "siMaterialParameterType";	
		case siMatrixParameterType : return "siMatrixParameterType";		
		case siModelParameterType : return "siModelParameterType";		
		case siRealTimeParameterType : return "siRealTimeParameterType";	
		case siReferenceParameterType : return "siReferenceParameterType";	
		case siScalarParameterType : return "siScalarParameterType";		
		case siShaderParameterType : return "siShaderParameterType";		
		case siStringParameterType : return "siStringParameterType";		
		case siStructParameterType : return "siStructParameterType";		
		case siTextureParameterType : return "siTextureParameterType";		
		case siTextureSpaceParameterType : return "siTextureSpaceParameterType";
		case siVectorParameterType : return "siVectorParameterType";		
		default: return type;

See Also

Shader.GetShaderParameterTargets Shader.GetShaderParameterType Parameter.HasInstanceValue Parameter.SetInstanceValue Parameter.GetInstanceValue Parameter.ScriptName Shader.OutputType