728x90
오브젝트 가져오기
for obj in doc.GetObjects():
children = object.GetChildren()
import c4d
from c4d import gui
def test():
o = doc.GetActiveObject() # Only one object
# o = doc.GetActiveObjects(0) # return list
if not o:
return
o.SetName('test')
c4d.EventAdd()
if __name__ == '__main__':
test()
import c4d
from c4d import gui
def test():
print 'hello'
o = doc.GetActiveObjects(0)
if o == []:
return
newName = c4d.gui.InputDialog("New name:")
sNumber = int(c4d.gui.InputDialog("Start number:"))
for i in range(len(o)):
o[i].SetName(newName+str(sNumber))
sNumber = sNumber + 1
c4d.EventAdd()
if __name__ == '__main__':
test()
참고 자료:
c4d.BaseList2D:
c4d.BaseObject: c4d.BaseList2D 의 자식
c4d.GeListNode;
728x90