-
Notifications
You must be signed in to change notification settings - Fork 78
Add type alias support to the reverse bindings (#USDU-3 part 2) #260
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
Conversation
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.
This is awesome!
I do think we should keep the data private (typeAliases) and wrap it with a public API, but other than that, it looks great.
package/com.unity.formats.usd/Dependencies/USD.NET/serialization/TypeBinder.cs
Outdated
Show resolved
Hide resolved
package/com.unity.formats.usd/Dependencies/USD.NET.Unity/UnityTypeBindings.cs
Outdated
Show resolved
Hide resolved
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.
Aggree with @jcowles 's comments
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.
Ship it!
Purpose of this PR
Ticket/Jira #:
USD allows certain attribute type to be given roles (aliases) to help unambiguously determine how data should be interpreted.
Ex:
This is a problem when using our reverse bindings which let the USD type drive the C# type the primvar data should deserialized to. The reverse bindings are useful in the case a given attribute can be defined as multiple types. Typically UVs primvars can be defined as float2/float3/half2/half3/double2/double3 and as such can be also given the role of texcoord2f/texcoord3f/texcoord2h/texcoord3h/texcoord2d/texcoord3d .... As we already have a 1-to-1 mapping to Unity type for the standard types (float2, float3, ...) we can't augment the mapping to support roles.
This PR adds a way to define aliases for a given type and allow the reverse binding to convert roles to their canonic type before doing the type lookup.
Testing
Functional Testing status:
Performance Testing status:
Overall Product Risks
Complexity:
Halo Effect:
Additional information
Note to reviewers:
Reminder: