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

ensure UsdShadeMaterialBindingAPI schema is applied when authoring bindings during export #804

Conversation

mattyjams
Copy link
Contributor

Since UsdShadeMaterialBindingAPI is an API schema, it should be applied any time it is used for authoring. This allows querying for whether the API schema has been authored on a prim by using UsdPrim::HasAPI(). See some additional discussion of API schemas in the USD glossary here:

https://graphics.pixar.com/usd/docs/USD-Glossary.html#USDGlossary-APISchema

I believe that the shading export code updated here somewhat predated the concept of applying API schemas, which is why we weren't already doing this.

It's not strictly required that API schemas be applied in order to read data for them, but it is definitely good practice. Ideally, all API schemas would always be applied whenever they're used for authoring so that consumers of that USD could then determine whether or not they need to consider those schemas when working with a given prim. Otherwise, they have to assume that all prims might have had the API schema authored and consider the schema on every one.

…ndings during export

Since UsdShadeMaterialBindingAPI is an API schema, it should be applied any
time it is used for authoring. This allows querying for whether the API schema
has been authored on a prim by using UsdPrim::HasAPI(). See some additional
discussion of API schemas in the USD glossary here:

https://graphics.pixar.com/usd/docs/USD-Glossary.html#USDGlossary-APISchema

The shading export code here somewhat predates the concept of applying API
schemas, which is why handling of this is only now being added.
This is not strictly necessary for the purposes of any existing tests, but is
rather just for hygiene. The shading export will now be applying the API schema
when authoring bindings, so these updated USD files will better represent what
is actually produced by an export.
@kxl-adsk kxl-adsk added the import-export Related to Import and/or Export label Sep 28, 2020
@kxl-adsk kxl-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Sep 29, 2020
@kxl-adsk kxl-adsk merged commit d3a9430 into Autodesk:dev Sep 29, 2020
@mattyjams mattyjams deleted the pr/apply_UsdShadeMaterialBindingAPI_schema_during_export branch September 29, 2020 16:22
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.

3 participants