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

Simplify token creation #438

Merged
merged 2 commits into from
Aug 17, 2023
Merged

Simplify token creation #438

merged 2 commits into from
Aug 17, 2023

Conversation

lilleyse
Copy link
Contributor

The previous approach for adding new tokens was overly complex, requiring changes in 5 different places within Tokens.h and Tokens.cpp. Now it's as simple as adding a new token to USD_TOKENS and letting the macros do the rest of the work.

USD tokens are now created in a more standard way with TF_DECLARE_PUBLIC_TOKENS and TF_DEFINE_PUBLIC_TOKENS and are accessed as pxr::UsdTokens->tokenName.

Fabric tokens are created with FABRIC_DECLARE_TOKENS and FABRIC_DEFINE_TOKENS which are inspired by the pxr macros and are accessed as FabricTokens::tokenName like before.

Copy link
Contributor

@weegeekps weegeekps left a comment

Choose a reason for hiding this comment

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

Lots cleaner. :shipit:

@lilleyse lilleyse merged commit 66234e0 into main Aug 17, 2023
3 checks passed
@lilleyse lilleyse deleted the simplify-tokens branch August 17, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants