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

__repr__ implementation of multiple apply schemas double quotes instance name. #3270

Open
nvmkuruc opened this issue Sep 4, 2024 · 1 comment
Labels
good first issue Indicates a good issue for first-time contributors

Comments

@nvmkuruc
Copy link
Collaborator

nvmkuruc commented Sep 4, 2024

Description of Issue

The code gen template for multi apply schemas is this. Note that it adds single quotes around instanceName.c_str().

    return TfStringPrintf(
        "{{ libraryName[0]|upper }}{{ libraryName[1:] }}.{{ cls.className }}(%s, '%s')",
        primRepr.c_str(), instanceName.c_str());

However instanceName was constructed using TfPyRepr which already adds quotes to strings.

The fix is simple, but it will requires rerunning schema gen on all schema domains.

Steps to Reproduce

  1. Run the following code snippet
>>> s = Usd.Stage.CreateInMemory()
>>> p = s.DefinePrim('/root')
>>> Usd.CollectionAPI.Apply(p, 'c')
Usd.CollectionAPI(Usd.Prim(</root>), ''c'')

Note that ''c'' has two single quotes on each side instead of one.

System Information (OS, Hardware)

Package Versions

Build Flags

@jesschimein
Copy link

Filed as internal issue #USD-10071

@nvmkuruc nvmkuruc added the good first issue Indicates a good issue for first-time contributors label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indicates a good issue for first-time contributors
Projects
None yet
Development

No branches or pull requests

2 participants