def recurse(objset):
    for member in objset:
        if member.isA(om.MFn.kSet):
            recurse(member)
        elif (type is not None):
            if (type == member.typeName):
                members.add(member)
        else:
            members.add(member)
def recurse(objset):
    for member in objset:
        if member.isA(om.MFn.kSet):
            recurse(member)
        elif (type is not None):
            if (type == member.typeName):
                members.add(member)
        else:
            members.add(member)