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

EMSUSD-92 - Ability to exclude primvars with specific Namespace #3223

Merged
merged 5 commits into from
Jul 14, 2023

Conversation

samuelliu-adsk
Copy link
Collaborator

@samuelliu-adsk samuelliu-adsk commented Jul 12, 2023

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"

std::string primVarNameSpaceString = primVarNameSpace.GetString();

// The primVarString is a substring of excludePrimVarNamespace string from the beginning
if (primVarString.find(primVarNameSpaceString) == 0) {
Copy link
Collaborator

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?)

Copy link
Collaborator Author

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

Copy link
Collaborator

@pierrebai-adsk pierrebai-adsk left a 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.

@samuelliu-adsk
Copy link
Collaborator Author

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.

Copy link
Collaborator

@pierrebai-adsk pierrebai-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@samuelliu-adsk samuelliu-adsk added adsk Related to Autodesk plugin import-export Related to Import and/or Export ready-for-merge Development process is finished, PR is ready for merge labels Jul 13, 2023
@seando-adsk seando-adsk removed the adsk Related to Autodesk plugin label Jul 14, 2023
@seando-adsk seando-adsk merged commit 785f636 into dev Jul 14, 2023
@seando-adsk seando-adsk deleted the samuelliu-adsk/MAYA-128421/exclude-namespace branch July 14, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-export Related to Import and/or Export ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants