Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import c4d
- def main():
- objs = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN)
- doc.StartUndo()
- for obj in objs:
- mat = c4d.BaseMaterial(c4d.Mmaterial)
- mat.SetName(obj.GetName())
- tag_tex = c4d.BaseTag(c4d.Ttexture)
- tag_tex[c4d.TEXTURETAG_MATERIAL] = mat
- tag_tex[c4d.TEXTURETAG_PROJECTION] = 6
- doc.AddUndo(c4d.UNDOTYPE_NEW, tag_tex)
- obj.InsertTag(tag_tex)
- doc.AddUndo(c4d.UNDOTYPE_NEW, mat)
- doc.InsertMaterial(mat)
- c4d.EventAdd()
- doc.EndUndo()
- if __name__=='__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement