On 06/09/2013 at 04:33, xxxxxxxx wrote:
Hi, I want to add a layer to the color channel and then insert in this layer multiple bitmaps / hdr's.
The following script code is not working
The layer is created in the color channel, but the bitmap is not inserted?
What am I doing wrong?
import c4d
from c4d import gui
def main() :
path = r"preset://prime.lib4d/Materials/HDRI/tex/HDR001.hdr"
mat = doc.SearchMaterial("pim")
shd = c4d.BaseList2D(c4d.Xbitmap) #bitmap to be inserted under layer
shd[c4d.BITMAPSHADER_FILENAME] = path
layershd = c4d.BaseList2D(c4d.Xlayer) #create layer for color channel
mat[c4d.MATERIAL_COLOR_SHADER] = layershd
layershd.InsertShader(shd) # insert bitmap under layer
mat.InsertShader(layershd)
mat.Message(c4d.MSG_UPDATE)
mat.Update(True, True)
print "Done."
if __name__=='__main__':
main()