-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unexpected behavior of expression-mode collection with explicitOnly expansion rule #3423
Comments
Filed as internal issue #USD-10441 |
I re-read the docs recently and discovered that my confusion stems in part from the fact that expandPrims in expression mode also doesn't behave as I'd expect. If I am reading it right, expandPrims behaves as I would expect explicitOnly to behave, which arguably could explain why explicitOnly does nothing. And I understand that expression mode makes it relatively easy to write an expression that is equivalent to relationship mode expandPrims behavior. But I still find this quite unexpected. To be specific, in relationship mode:
I hope this clarifies why I find this behavior confusing, even in light of this recent upgrade to my understanding. |
Yeah,
I think the reasoning was that with a pattern, it was unclear what "explicit" would mean? |
Yeesh, I did not mean to close this, sorry -- had some kind of mouse freak-out. Anyway I agree that this is confusing. Though I'm not sure what the right solution is. Calling out expressions that have just a single pattern that's an explicit path seems weird. Same with expressions that are |
Just to be a bit more concrete, in |
Another option would be to treat |
Hey @gitamohr, I'm definitely interpreting some of these words differently than you are. To me "explicitlyOnly" mean "only return prims that explicitly match this pattern". So there is no doubt in my mind that in "explicitOnly" mode "/foo/b*r" would match "/foo/bar". The "explicitness" has nothing to do with the patterns that make up the expression. This differs from "expandPrims" which (to me) means "match any prim that either matches the pattern or is a descendant of a prim that matches the pattern" (i.e. the set of all prims returned if we were in "explicitOnly" mode plus all the descendants of those prims). This is how things work when you put a path in the "includes" relationship in relationship-mode. The "expand" refers to "expand down the hierarchy". So I expected expression mode to interpret these expansion modes the same way - "expand" means "expand down the hierarchy". That said, I really don't have a use case for changing the interpretation of these modes (other than my claim that "it makes sense to me"). So I would be perfectly happy if "explicitOnly" === "expandPrims" in expression-mode. Leaving it the way it is now just feels like a bit of a trap which doesn't serve any useful purpose that I can see. |
Ah I see, yeah we don't treat Spiff is also on board with treating |
Description of Issue
I noticed some behavior that seemed odd to me when using expression-mode collections (specifically, I was testing with the kitchen scene and a path expression of
//Cheerio*
). With the expansion rule set toexplicitOnly
, I expected to match all prims namedCheerio*
anywhere in the scene. Instead I got back an empty result. Then I found this in the docs:Why has this limitation been imposed? I can see this rule made explicit in the code in
_ComputeIncludedImpl
ofusd/collectionMembershpiQuery.cpp
, the last major block inthat function does:Basically I'm trying to understand why this limitation would exist, and hoping that the rule can be changed so
explicitOnly
does what I would consider "the expected thing".I'm happy to attempt a PR if this is an acceptable change.
Package Versions
24.08
The text was updated successfully, but these errors were encountered: