def getLayer(object): uuid = ce.getUUID(object) layers = ce.getObjectsFrom(ce.scene, ce.isLayer) # this could be sped up by filtering layers by type of object for layer in layers: for o in ce.getObjectsFrom(layer): if ce.getUUID(o) == uuid : return layer return None if __name__ == '__main__': print getLayer(ce.selection()[0])