I need help with the sketch material
If I want to create and apply a regular material to, say, a cube I am fine using the code below:
mat = c4d.BaseMaterial(c4d.Mmaterial) # material
tag = c4d.BaseTag(c4d.Ttexture) # tag
tag.SetMaterial(mat) # assign material to tag
obj = c4d.BaseObject(c4d.Ocube) # create cube
doc.InsertObject(obj) # insert cube
doc.InsertMaterial(mat) # insert material
obj.InsertTag(tag) # apply tag to material
Now if I want to do the same thing with the sketch material with the analogous code:
c4d.Msketch = 1011014 # add missing descriptor for sketch material
c4d.Tsketch = 1011012 # add missing descriptor for sketch tag
mat = c4d.BaseMaterial(c4d.Msketch) # material
tag = c4d.BaseTag(c4d.Tsketch) # tag
tag.SetMaterial(mat) # assign material to tag
obj = c4d.BaseObject(c4d.Ocube) # create cube
doc.InsertObject(obj) # insert cube
doc.InsertMaterial(mat) # insert material
obj.InsertTag(tag) # apply tag to material
I get the error message:
AttributeError: 'c4d.BaseTag' object has no attribute 'SetMaterial'
I obtained the missing descriptors from the script log, but the sketch tag and material seem to behave differently than regular materials in this regard.
Help would be greatly appreciated!