On 27/02/2018 at 04:48, xxxxxxxx wrote:
I try to get and set some values of a reflectance layer.
import c4d
from c4d import gui
def main() :
mat1 = doc.SearchMaterial("MatReflectance")
print "nr of reflectance layers: ", mat1.GetReflectionLayerCount()
refl_shd = mat1.GetAllReflectionShaders()
for rs in refl_shd:
print "bitmap:" ,rs[c4d.BITMAPSHADER_FILENAME]
print "refl strength: ", rs[c4d.REFLECTION_LAYER_MAIN_VALUE_REFLECTION] #!not working
#setting a bitmap is working!
rs[c4d.BITMAPSHADER_FILENAME] = "del.hdr"
c4d.EventAdd()
if __name__=='__main__':
main()
I get an error when trying to get the layer reflection strength (REFLECTION_LAYER_MAIN_VALUE_REFLECTION).
It is also strange that I have to use BITMAPSHADER_FILENAME to get the bitmap file name and not REFLECTION_LAYER_COLOR_TEXTURE. This is the constant I get when I drag this field into the console.
-Pim