I've coded some ShaderDef's manually according to the Object model API for Python. But, I'd like to put that information into a dictionary and then declare the ShaderDef's by reading the information from the dictionary. But I dont know how to do that in Python.
So I want to do something like...
Code: Select all
bsdfPlugins = {
"diffuse" : {
"reflectance" : [SpectrumType, TextureType ]
},
"roughplastic" : {
"distribution" : [ EnumerationType(["beckmann", "ggx", "phong"]) ],
"alpha" : [FloatType ],
"intIOR" : [ FloatType, EnumerationType(iorPresetNames) ],
"extIOR" : [ FloatType, EnumerationType(iorPresetNames) ],
"diffuseReflectance" : [SpectrumType, TextureType ],
"specularReflectance" : [SpectrumType, TextureType ]
},
...(one entry for every BSDF)...
}
Code: Select all
def diffuse_1_0_DefineInfo() {}
def diffuse_1_0_Define() {}
def roughplastic_1_0_DefineInfo() {}
def roughplastic_1_0_Define() {}
etc...