Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

NickWu opened this issue · 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 #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.

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