maya-usd icon indicating copy to clipboard operation
maya-usd copied to clipboard

UsdMayaAdaptor::RegisterTypedSchemaConversion is lacking a way to overwrite the exiting registration.

Open NickWu opened this issue 2 years ago • 1 comments

Hi, we have been using an internal feature to maya-usd to allow us to overwrite the default camera prim writer, but recently we wanted to try the new prim writer override feature https://github.com/Autodesk/maya-usd/pull/3189 to register our internal ALCamera prim writer so that we can remove our internal patch. After trying, I found we could register our ALCamera prim writer successfully with the new UsdMayaPrimWriterRegistry::Register function to overwrite the existing default camera registration, but I found I couldn't register my custom prim writer to UsdMayaAdaptor via UsdMayaAdaptor::RegisterTypedSchemaConversion, like many default prim writers do: https://github.com/search?q=repo%3AAutodesk%2Fmaya-usd%20PXRUSDMAYA_REGISTER_ADAPTOR_SCHEMA&type=code.

I found this is because UsdMayaAdaptor::RegisterTypedSchemaConversion doesn't support overriding existing registration (in our internal path, we have updated it to support overriding). The function description says "re-registering the same Maya type again will overwrite the previous registration.", but it's not true.

Describe the solution you'd like I'd like UsdMayaAdaptor::RegisterTypedSchemaConversion to be updated to support overwriting so that we can use it along with the new UsdMayaPrimWriterRegistry::Register to take full advantage of custom prim writers.

NickWu avatar Dec 01 '23 01:12 NickWu

Thanks for bringing this up. I'll bring it up with the devs.

wallworm avatar Dec 01 '23 18:12 wallworm