def output_modal(func, output: set):
    """Updates output with the result of func, a modal which returns a set.
     Cheap way to monitor the modal result of a bpy.Operator."""
    def wrap(self, context, event):
        result = func(self, context, event)
        output.update(result)
        return result
    return wrap