Advertisement
Guest User

Untitled

a guest
Mar 5th, 2014
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. def add_channel(tagname, tagchannel):
  2.    
  3.     buffer = c4d.BaseList2D(c4d.Zmultipass)
  4.     buffer.GetDataInstance()[c4d.MULTIPASSOBJECT_TYPE] = c4d.MULTIPASSOBJECT_OBJECTBUFFER
  5.     # check nach vorhandenen MPs
  6.     rd = doc.GetActiveRenderData()
  7.     vp = rd.GetFirstMultipass()
  8.     exist_buffer = 0
  9.    
  10.     while vp:
  11.         if vp.GetTypeName() == "Object Buffer":
  12.            
  13.            if vp[c4d.MULTIPASSOBJECT_OBJECTBUFFER] == tagchannel:
  14.                print "channel "+ str(tagchannel) + " vorhanden"
  15.                exist_buffer = 1
  16.  
  17.         vp = vp.GetNext()    
  18.    
  19.     if exist_buffer == 0:
  20.         buffer.SetName ( tagname )
  21.         buffer[c4d.MULTIPASSOBJECT_OBJECTBUFFER] = tagchannel
  22.         rd.InsertMultipass (buffer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement