On 19/11/2017 at 19:33, xxxxxxxx wrote:
Hey!
I'm writing a simple script that creates and sets up a C4D Material based on a folder of .jpgs with appropriate "*_diffuse.jpg", "*_specular.jpg" etc. names.
I've figured out how to create a material, but I'm stuck on how to add the filepath to a ".jpg" to the [c4d.MATERIAL_COLOR_SHADER].
Create new C4D Material
c4d.CallCommand(13015, 13015) # New Material
# Get First Material, the one we just created
material = doc.GetFirstMaterial()
# rename: cdmat-"name"
material[c4d.ID_BASELIST_NAME] = "name"
# Enable Color Mat[c4d.MATERIAL_USE_COLOR]
material.SetChannelState(c4d.CHANNEL_COLOR, True)
# Set Mat[c4d.MATERIAL_COLOR_SHADER] to name_diffuse.jpg
material[c4d.MATERIAL_COLOR_SHADER] = "D:\CD-Scenes\008-BedroomDemo\008-Bedroom-01.jpg"
print(material[c4d.MATERIAL_COLOR_SHADER])
Thanks!
Matt