Python
4d
cinema

[Cinema 4D] function of check all object in scene

A function of check all object in the scene with multiple hierarchies.

def GetNextObject(obj):

    if obj.GetDown():
        obj = obj.GetDown()
        return obj

    if obj.GetNext():
        obj = obj.GetNext()
        return obj

    while obj.GetUp():
        obj = obj.GetUp()
        if obj.GetNext():
            obj = obj.GetNext()
            return obj

    return False