Use ShaderDef.ShaderFamilies or ShaderDef::GetShaderFamilies to retrieve a safearray of strings:
for sFamily in oShaderDef.ShaderFamilies : Application.LogMessage(sFamily) # ...
Use ShaderDef.PrimaryShaderFamily or ShaderDef::GetPrimaryShaderFamily to return the shader family ID as a string:
Application.LogMessage(oShaderDef.PrimaryShaderFamily)
Use ShaderDef.IsShaderFamily or ShaderDef::IsShaderFamily with one of the native Softimage shader families or a custom shader family you defined:
if (oShaderDef.IsShaderFamily("mrLight")) : # do something with light shaders else : # do something with non-light shaders
Use ShaderDef.AddShaderFamily or ShaderDef::AddShaderFamily, passing the shader family name for each shader family you want to add; however, the second parameter determines whether that family will be primary or not. So if you don't pass a value for that parameter, the last family added will be considered the primary family:
# Adds the lens shader family only oShaderDef.AddShaderFamily(siShaderFamilyLens) # Adds the data blob and texture families with texture as primary (because it's # the most versatile shader family--it has the fewest connection restrictions of anything) oShaderDef.AddShaderFamily(siShaderFamilyTexture, True) oShaderDef.AddShaderFamily(siShaderFamilyData, False) # Same thing but without specifying second parameter oShaderDef.AddShaderFamily(siShaderFamilyData) oShaderDef.AddShaderFamily(siShaderFamilyTexture)
To register a custom shader family in Softimage, see Creating Custom Shader Families. To use one of the native Softimage shader families, consult Native Softimage Shader Families for a list of supported families.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License