Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: exclude path in filter #5668

Open
BrianHanke opened this issue Feb 13, 2024 · 2 comments
Open

Feature request: exclude path in filter #5668

BrianHanke opened this issue Feb 13, 2024 · 2 comments

Comments

@BrianHanke
Copy link
Contributor

Following up from Discord, it would be cool if there was a way to exclude paths in Gaffer PathFilters. In Maya render layers you can use the - operator to exclude a path, such as -geo/popsicles. In Houdini you can use ! to exclude groups or ranges: !popsicles or !1-100 applied to point numbers, for example. Both approaches are very intuitive for the end user. Thanks!

@johnhaddon
Copy link
Member

Would I be right in thinking you'd use it something like this?

/octopus/arms/arm*   # Match all the arms 
-/octopus/arms/arm1  # Except this one

And do you have any thoughts about the potential for confusion from this?

/octopus/arms         # Match the parent
-/octopus/arms/arm1   # But not a child

In the latter case, you don't get the effect you want from shader assignments because you still get an assignment to the parent, and that inherits to the child (through normal attribute inheritance) even though the child doesn't get a local assignment. This has been something we've found hard to communicate when exploring "inverting" filters.

I also wonder what you would think to a more general DifferenceFilter, that would work like the UnionFilter (with two input filters) but take away the matches from the second one?

@BrianHanke
Copy link
Contributor Author

BrianHanke commented Feb 14, 2024

@johnhaddon Yep, that first example is what I was thinking of. I see now the issue with inheritance, it's logical that it works like that. I checked Maya's render layers and it has the same behavior. Still, I think it's nice to have the option to exclude paths that way, although it might generate more Discord messages asking why it doesn't work like people expect!

I love the idea of a DifferenceFilter, in fact I did look for that when I was trying to solve my original problem. It would be a perfect solution. Expanding on that, even better might be something like an OperationsFilter that lets you choose from difference, union, intersection, etc. I think you already have this for working with sets, but this would be for paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants