how to ungroup the null object which has only one child in object manager tree. I have a scene imported from other software, and the object manager tree has many redundant null objects. how do I write a python script to reduce OM
Python - Reduce Object Manager Tree
Cairyn
#3
I happen to have a fitting script on my Patreon; have a look whether this is what you need:
https://www.patreon.com/posts/script-club-1-05-34001411 (description; free)
https://www.patreon.com/posts/script-club-1-05-34001607 (Script; protected)
mogh
#4
`import c4d
from c4d import gui
def removeempty(obj):
if not obj:
return
removeempty(obj.GetDown())
removeempty(obj.GetNext())
if not obj.GetDown():
if obj.GetType()== c4d.Onull:
if not obj.GetFirstTag():
obj.Remove()
def main():
obj = doc.GetFirstObject()
removeempty(obj)
c4d.EventAdd()
if name==‘main’:
main()`
perhaps you can change this to your needs