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-215 support custom display name for USD attributes #3499

Merged
merged 3 commits into from
Dec 13, 2023

Conversation

pierrebai-adsk
Copy link
Collaborator

Add support to have custom names for USD attributes to have nicer names for UI display purpose. We already had an algorithm to automatically make the names prettier, this adds support for user-defined attribute names. We now read the USD 'displayName' metadata on each attribute. If the metadata exists then we use its value as the display name.

The built-in function to make the name prettier has also been enhanced to remove the "xformOp:" prefix. Also, the prettyfying avoids generating two spaces in a row (if, for example, : was followed by _).

Modify the USD attribute-related classes:

  • Add a displayName funtion to the UsdAttrbute class.
  • Add a displayName funtion to the UsdAttributeHolder class.
  • Add a displayName funtion to the UsdShaderAttributeHolder class.
  • The displayName function in UsdAttributeHolder prettify the name.

Add support for display name in the Attribute Editor template:

  • Add a AttributeCustomControl base class to handle display names.
  • Make the default control creation use the display names.

Added a simple unit test and fix some attribute unit tests.

Add support to have custom names for USD attributes to have nicer names for UI
display purpose. We already had an algorithm to automatically make the names
prettier, this adds support for user-defined attribute names. We now read
the USD 'displayName' metadata on each attribute. If the metadata exists then
we use its value as the display name.

The built-in function to make the name prettier has also been enhanced to
remove the "xformOp:" prefix. Also, the prettyfying avoids generating two
spaces in a row (if, for example, : was followed by _).

Modify the USD attribute-related classes:
- Add a displayName funtion to the UsdAttrbute class.
- Add a displayName funtion to the UsdAttributeHolder class.
- Add a displayName funtion to the UsdShaderAttributeHolder class.
- The displayName function in UsdAttributeHolder prettify the name.

Add support for display name in the Attribute Editor template:
- Add a AttributeCustomControl base class to handle display names.
- Make the default control creation use the display names.

Added a simple unit test and fix some attribute unit tests.
Copy link
Collaborator

@AramAzhari-adsk AramAzhari-adsk left a comment

Choose a reason for hiding this comment

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

Overall looks good. Only a couple of minor questions regarding ifdefs

@pierrebai-adsk
Copy link
Collaborator Author

Only PF failure is the testVP2RenderDelegateDisplayLayers on Linux that is known to be flaky

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Dec 12, 2023
@seando-adsk seando-adsk merged commit 407029b into dev Dec 13, 2023
12 of 13 checks passed
@seando-adsk seando-adsk deleted the bailp/EMSUSD-215/attr-nice-names branch December 13, 2023 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin 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.

5 participants