def getConstrainedTargets(driver, constraint_type='parentConstraint'):
    """
    Gets all the transforms the given driver is driving through the giving constraint type.

    Args:
        driver (PyNode): The transform that is driving the other transform(s) through a constraint.

        constraint_type (string): The type of constraint to look for.
        Normally "parentConstraint", "pointConstraint", "orientConstraint", or "scaleConstraint".

    Returns:
        (set): Transform(s) being driven by given driver through given constraint type.
    """
    # Using sets to remove duplicates from list connections because Maya
    constraints = set(driver.listConnections(type=constraint_type))
    targets = set()
    for constraint in constraints:
        targets.update(set(constraint.connections(source=False, destination=True, et=True, type='transform')))

    return targets