본문 바로가기

Code/cinema4d & 3dsmax

[c4dpython] material & texture

Create material

 

import c4d

material = c4d.Material()
material.SetName("Generator Material")
material[c4d.MATERIAL_COLOR_COLOR] = c4d.Vector(1, 0, 0)

doc.InsertMaterial(material, None) // 여기에 checknames=False 하면 중복된 재질 이름 생성 허용
c4d.EventAdd()

 

Find Material

 materials = doc.GetMaterials()
    for mat in materials:

 

 

Apply material

Material를 Texture Tag를 이용해 Object 에 적용합니다.

 

tag = c4d.TextureTag()
tag.SetMaterial(material)
node.InsertTag(tag)