Advertisement
gr4ph0s

example JVC

Oct 5th, 2017
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. #graphos 02/10/2017
  2. import c4d
  3.  
  4.  
  5. def main():
  6.     #On recup notre sky sur le quel on veux mettre un mat
  7.     objSky = doc.GetFirstObject()
  8.    
  9.     doc.StartUndo()
  10.     mat = c4d.Material(c4d.Mmaterial) #Materiaux classique
  11.    
  12.     doc.AddUndo(c4d.UNDOTYPE_NEW, mat) #undo_new = avant insertion
  13.     doc.InsertMaterial(mat) #on l'insert dans le documents
  14.    
  15.  
  16.     textureTag = c4d.BaseTag(c4d.Ttexture) #on créer le tag de texture
  17.     textureTag[c4d.TEXTURETAG_MATERIAL] = mat #On assigne le materiaux au tag
  18.    
  19.     doc.AddUndo(c4d.UNDOTYPE_NEW, mat) #undo_new = avant insertion
  20.     objSky.InsertTag(textureTag) #On insert ontre tag sur lobjet
  21.    
  22.     doc.EndUndo()
  23.     c4d.EventAdd()
  24.  
  25. if __name__=='__main__':
  26.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement