-
Notifications
You must be signed in to change notification settings - Fork 201
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
EMSUSD-92 - Ability to exclude primvars with specific Namespace #3223
EMSUSD-92 - Ability to exclude primvars with specific Namespace #3223
Conversation
std::string primVarNameSpaceString = primVarNameSpace.GetString(); | ||
|
||
// The primVarString is a substring of excludePrimVarNamespace string from the beginning | ||
if (primVarString.find(primVarNameSpaceString) == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the probability that a prim var has no namespace but has a name that matches a namespace is low? IDK if there is a way to extract just the namespace from the primVar (maybe [rimVar.GetPrimVarNamsapce or some such?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think I can do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just like to know if you think it would possible to target just the namespace of the prim var for the string match before approving.
Thanks for the suggestion @pierrebai-adsk and I have made the fix. Instead of using GetNamepsace, I used primvar.NameContainsNamespaces() to check if the primvar we are importing does have a namespace. We only proceed the checking if this primvar has a namespace. In this way we can avoid the corner case you mentioned and be more efficient at the mean time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add a new import flag "excludePrimvarNamespace" which allows users to exclude the whole namespaces of primvars.
For example:
We can exclude this primvar
float[] primvars:ExcludeMeNamespace:ExcludeMeToo:testExclude = [.5]
if we import with flag-excludePrimvarNamespace "ExcludeMeNamespace:ExcludeMeToo"
or-excludePrimvarNamespace "ExcludeMeNamespace"