Advertisement
gr4ph0s

Untitled

Apr 7th, 2017
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. import c4d
  2.  
  3.  
  4. def main():
  5.     objs = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN)
  6.     doc.StartUndo()
  7.     for obj in objs:
  8.         mat = c4d.BaseMaterial(c4d.Mmaterial)
  9.         mat.SetName(obj.GetName())
  10.         tag_tex = c4d.BaseTag(c4d.Ttexture)
  11.         tag_tex[c4d.TEXTURETAG_MATERIAL] = mat
  12.         tag_tex[c4d.TEXTURETAG_PROJECTION] = 6
  13.        
  14.         doc.AddUndo(c4d.UNDOTYPE_NEW, tag_tex)
  15.         obj.InsertTag(tag_tex)
  16.        
  17.         doc.AddUndo(c4d.UNDOTYPE_NEW, mat)
  18.         doc.InsertMaterial(mat)
  19.    
  20.     c4d.EventAdd()
  21.     doc.EndUndo()
  22.  
  23. if __name__=='__main__':
  24.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement