book_4_sparkGenerated
code_blocksInput

Description

The FilterModifier.Not field is a member of the FilterModifier enumeration within the Editor.NodeEditor namespace. This enumeration is used to specify modifiers that can be applied to filters in a node editor context. The Not modifier is used to invert the logic of a filter, effectively applying a logical NOT operation to the filter's condition.

Usage

Use the FilterModifier.Not field when you need to negate a filter condition in a node editor. This is particularly useful when you want to exclude certain nodes or elements based on a specific condition.

Example

// Example of using FilterModifier.Not in a node editor context

// Assume we have a filter function that checks for a specific condition
bool IsConditionMet(Node node) {
    // Logic to determine if the condition is met
    return node.HasProperty("Active");
}

// Applying the Not modifier to invert the filter logic
FilterModifier modifier = FilterModifier.Not;

// Example usage in a filtering process
List<Node> nodes = GetAllNodes();
List<Node> filteredNodes = nodes.Where(node =>
{
    bool conditionMet = IsConditionMet(node);
    return modifier == FilterModifier.Not ? !conditionMet : conditionMet;
}).ToList();

// filteredNodes will contain nodes where the condition is NOT met