Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. import c4d
  2. from c4d import gui
  3. # Welcome to the world of Python
  4. # Author: Mike Udin,
  5. # Tutorial here http://mikeudin.net/?p=2930
  6. # 2016
  7.  
  8.  
  9. def main():
  10.     objs = doc.GetActiveObjects(1)
  11.     if not objs: return
  12.    
  13.     tlist = [1018791, 1018544, 1010865, 5142, 1011010, 1019396, 5140]    
  14.     menu = c4d.BaseContainer()
  15.     for otype in tlist:
  16.         menu.SetString(c4d.FIRST_POPUP_ID+len(menu), c4d.GetObjectName(otype))
  17.    
  18.     result = gui.ShowPopupDialog(cd=None, bc=menu, x=c4d.MOUSEPOS, y=c4d.MOUSEPOS)-c4d.FIRST_POPUP_ID
  19.     if result<0:return
  20.     parent = c4d.BaseObject(tlist[result])
  21.     parent.InsertBefore(objs[0])
  22.     parent.SetBit(c4d.BIT_ACTIVE)
  23.     for obj in reversed(objs):
  24.         obj.InsertUnder(parent)
  25.         obj.DelBit(c4d.BIT_ACTIVE)
  26.     c4d.EventAdd()
  27.    
  28. if __name__=='__main__':
  29.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement