Building custom importers and exporters: Quick Reference — Data Exchange (NVIDIA-Certified Professional: OpenUSD Development)

Quick Reference: Building Custom Importers and Exporters in OpenUSD This guide provides essential facts and best practices for creating custom...

Quick Reference: Building Custom Importers and Exporters in OpenUSD

This guide provides essential facts and best practices for creating custom importers and exporters as part of data exchange workflows in OpenUSD, a key skill for the NVIDIA-Certified Professional: OpenUSD Development exam.

Key Concepts

Steps for Building Custom Importers

  1. Analyze Source Format: Understand the structure, data types, and semantics of the external format.
  2. Create Data Mapping Document: Define how source elements map to USD prims, attributes, and relationships.
  3. Use USD APIs: Utilize UsdStage to create and populate USD scene graph nodes.
  4. Handle Metadata and Variants: Map source metadata and variant sets appropriately to preserve scene fidelity.
  5. Validate Output: Verify the generated USD file for correctness and completeness.

Steps for Building Custom Exporters

  1. Identify Target Format Requirements: Document the expected schema and constraints of the external format.
  2. Map USD Data: Use the data mapping document to translate USD prims and attributes to target format elements.
  3. Traverse USD Stage: Iterate over the UsdStage scene graph to extract relevant data.
  4. Serialize Data: Convert extracted data into the target format's file structure and encoding.
  5. Test Exported Files: Ensure compatibility and correctness by loading files in target applications.

Best Practices

Common USD APIs for Importer/Exporter Development

Example Snippet: Creating a USD Prim in Python

Task: Create a mesh prim named "MyMesh" under the root.

stage = Usd.Stage.CreateNew("output.usda") mesh_prim = stage.DefinePrim("/MyMesh", "Mesh") mesh = UsdGeom.Mesh(mesh_prim)

Set points, face vertex counts, etc.

mesh.CreatePointsAttr(points) stage.GetRootLayer().Save()

Summary

Building custom importers and exporters in OpenUSD requires a clear understanding of both source/target data formats and the USD scene graph API. Using well-defined data mapping documents and leveraging USD scripting APIs enables efficient, maintainable data interchange pipelines essential for professional OpenUSD development.

More in this topic

Related topics:

#OpenUSD #data-exchange #custom-importers #exporters #NVIDIA-Certified

Ready to test your knowledge?

Put what you've learned into practice with a quick quiz and track your progress.

Test your knowledge →