How to get material's color and texture info
Posted: Fri Sep 24, 2021 10:48 am
Can anyone get me some hints that how to get the material's Reflectance 0/90 color and texture information?
my code:
scene = Cmaxwell(mwcallback_cb)
scene.readMXS(mxsFile)
materials = CmaxwellMaterialIterator() # read all materials into a list.
mat = materials.first(scene) # get the first item from the list.
while not mat.isNull():
name = mat.getName()
numLayers = mat.getNumLayers()
for i in range(numLayers[0]):
layer = mat.getLayer(i)
for b in range(layer.getNumBSDFs()[0]):
bsdfdata = layer.getBSDF(b)
reflectance_0_map = bsdfdata.getAttribute('reflectance_0_map')
print(reflectance_0_map[0])
mat = materials.next()
my code:
scene = Cmaxwell(mwcallback_cb)
scene.readMXS(mxsFile)
materials = CmaxwellMaterialIterator() # read all materials into a list.
mat = materials.first(scene) # get the first item from the list.
while not mat.isNull():
name = mat.getName()
numLayers = mat.getNumLayers()
for i in range(numLayers[0]):
layer = mat.getLayer(i)
for b in range(layer.getNumBSDFs()[0]):
bsdfdata = layer.getBSDF(b)
reflectance_0_map = bsdfdata.getAttribute('reflectance_0_map')
print(reflectance_0_map[0])
mat = materials.next()