Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
779 stars 201 forks source link

Ability to register a prim to not be exported #2607

Open mrawde opened 2 years ago

mrawde commented 2 years ago

Is your feature request related to a problem? Please describe. This came out of an attempt to use the schema api adaptors for PxrMeshLight. Instead of PxrMeshLight resulting in a new prim in usd, we instead just author it as an applied API on the mesh itself. We'd like to prevent the usd exporter from creating a prim for it because it interferes with the "merge shape and transform" logic.

If we follow the example in: https://github.com/Autodesk/maya-usd/blob/dev/test/lib/usd/plugin/bulletAdaptor.cpp#L416

We still end up with a node, which breaks this case:

|SomeMesh # transform
  |SomeMeshShape # mesh
  | PxrMeshLight # transform
    | PxrMeshLightShape # PxrMeshLight

The |SomeMesh|PxrMeshLight|PxrMeshLightShape would end up still being exported at /SomeMesh/PxrMeshLight which would mess up the mergeTransformAndShape logic. With the Primless registry, we're able to tell the writer to completely ignore the prim, which allows |SomeMesh and |SomeMesh|SomeMeshShape to be merged into just /SomeMesh.

Describe the solution you'd like Part of https://github.com/Autodesk/maya-usd/pull/2557 was adding a new Primless registry. This told the exporter to not create a node which allowed the merge logic to behave as expected.

santosg87 commented 1 year ago

This is something we are currently investigating the viability of adding support for. There is is definitely a good use case for this.