'
' This example illustrates how to enumerate all parameters under a material and
' any connected shaders.
'
if Selection.Count <> 0 then
set oObject = Selection(0)
else
set oRoot = Application.ActiveProject.ActiveScene.Root
set oObject = oRoot.AddGeometry("Cylinder", "MeshSurface")
ApplyShader "Material\Constant", oObject
end if
set oMaterial = oObject.Material
' Log material parameters
Application.LogMessage "Material: " & oMaterial.FullName
For each oParam in oMaterial.Parameters
Application.LogMessage oParam.FullName
Next
' Log shader parameters
For each oShader in oMaterial.Shaders
Application.LogMessage "Shader: " & oShader.FullName
For each oParam in oShader.Parameters
Application.LogMessage oParam.FullName
Next
Next |