def get_filter_from_filter_list(step_list):
    """
    Build a Shotgun query filter from a list of Steps.

    :returns: A Shotgun filter which can be directly added to a Shotgun query.
    """
    if step_list is None:
        # No Steps saved yet, allow all Steps.
        return []
    if not step_list:
        # All steps off, ask for a non-existing step
        return ["step.Step.id", "is", -1]
    # General case, build the filter from the Step list.
    step_filter = ["step.Step.id", "in", [x["id"] for x in step_list]]
    return step_filter