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

MAYA-112228 Use Adaptors for custom schema import-export #1814

Merged
merged 8 commits into from
Nov 17, 2021

Conversation

JGamache-autodesk
Copy link
Collaborator

Adds custom API schema importers and exporter capabilities to existing UsdMayaAdaptor class. This can be done two ways:

  • For simple attribute-to-attribute mapping we offer a way to Apply/Remove/Edit schemas using custom generated UsdMayaAttributeAdaptor
  • For more complex work, we offer a copyToPrim and copyFromPrim callbacks that allow doing all the import/export work in a single function call
    The schema API export and import call have been augmented to support animation, and an apiSchemas parameter was added to import job the replicate the export workflow.

Added the concept of jobContext to import and export code paths.
These contexts can be registered at will and will add/modify import and export job context parameters

Added Python wrappers for these new concepts
An example of use can be found in the test\lib\usd\translators\testUsdExportSchemaApi.py unit test.

Adds custom API schema importers and exporter capabilities to existing UsdMayaAdaptor class. This can be done two ways:
- For simple attribute-to-attribute mapping we offer a way to Apply/Remove/Edit schemas using custom generated UsdMayaAttributeAdaptor
- For more complex work, we offer a copyToPrim and copyFromPrim callbacks that allow doing all the import/export work in a single function call
The schema API export and import call have been augmented to support animation, and an apiSchemas parameter was added to import job the replicate the export workflow.

Added the concept of jobContext to import and export code paths.
These contexts can be registered at will and will add/modify import and export job context parameters

Added Python wrappers for these new concepts
An example of use can be found in the test\lib\usd\translators\testUsdExportSchemaApi.py unit test.
test/lib/usd/plugin/bulletAdaptor.cpp Outdated Show resolved Hide resolved
test/lib/usd/plugin/bulletAdaptor.cpp Outdated Show resolved Hide resolved
lib/mayaUsd/commands/baseListJobContextsCommand.cpp Outdated Show resolved Hide resolved
lib/mayaUsd/fileio/jobs/jobArgs.cpp Show resolved Hide resolved
lib/mayaUsd/fileio/jobs/jobArgs.cpp Show resolved Hide resolved
lib/mayaUsd/fileio/jobs/readJob.cpp Outdated Show resolved Hide resolved
lib/mayaUsd/fileio/primReaderContext.cpp Outdated Show resolved Hide resolved
test/lib/usd/plugin/nullApiExporter_plugInfo.json Outdated Show resolved Hide resolved
lib/mayaUsd/fileio/jobs/jobArgs.cpp Outdated Show resolved Hide resolved
lib/mayaUsd/fileio/jobs/jobArgs.cpp Outdated Show resolved Hide resolved
lib/mayaUsd/fileio/primReaderContext.cpp Outdated Show resolved Hide resolved
lib/mayaUsd/fileio/primReaderContext.h Outdated Show resolved Hide resolved
lib/mayaUsd/fileio/primReaderContext.h Outdated Show resolved Hide resolved
Copy link

@kxl-adsk kxl-adsk left a comment

Choose a reason for hiding this comment

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

Great job, Jerry. My last comment will be only about documentation - we will need to help developers discover how to work with API schema adaptor plugins. A white paper that describes the unit test could be a great start.

lib/mayaUsd/fileio/utils/adaptor.cpp Outdated Show resolved Hide resolved
lib/mayaUsd/fileio/utils/adaptor.cpp Show resolved Hide resolved
lib/mayaUsd/fileio/utils/adaptor.h Outdated Show resolved Hide resolved
@JGamache-autodesk JGamache-autodesk added the ready-for-merge Development process is finished, PR is ready for merge label Nov 16, 2021
@kxl-adsk kxl-adsk merged commit 572ee57 into dev Nov 17, 2021
@kxl-adsk kxl-adsk deleted the t_gamaj/MAYA-112228/adaptor_schema_exports branch November 17, 2021 00:07
@seando-adsk seando-adsk mentioned this pull request Sep 1, 2022
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