From 3a6abe81062c47b369c59edcb80b5a6a58d76ff8 Mon Sep 17 00:00:00 2001 From: Samuel Liu Date: Thu, 29 Jun 2023 16:25:27 -0400 Subject: [PATCH] Code cleanup --- lib/mayaUsd/fileio/primWriterRegistry.cpp | 2 +- lib/mayaUsd/fileio/primWriterRegistry.h | 5 ++++- lib/mayaUsd/fileio/utils/adaptor.cpp | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/mayaUsd/fileio/primWriterRegistry.cpp b/lib/mayaUsd/fileio/primWriterRegistry.cpp index 16960042c3..3d0354ec45 100644 --- a/lib/mayaUsd/fileio/primWriterRegistry.cpp +++ b/lib/mayaUsd/fileio/primWriterRegistry.cpp @@ -200,7 +200,7 @@ void UsdMayaPrimWriterRegistry::Poke(const std::string& mayaTypeName) std::tie(first, last) = _reg.equal_range(mayaTypeName); if (first == last) { - // The type name is not currently in our registry + // If the type name is not currently in our registry, check for plugin registry static const TfTokenVector SCOPE = { _tokens->UsdMaya, _tokens->PrimWriter }; UsdMaya_RegistryHelper::FindAndLoadMayaPlug(SCOPE, mayaTypeName); } diff --git a/lib/mayaUsd/fileio/primWriterRegistry.h b/lib/mayaUsd/fileio/primWriterRegistry.h index 49d135036a..a3c6580052 100644 --- a/lib/mayaUsd/fileio/primWriterRegistry.h +++ b/lib/mayaUsd/fileio/primWriterRegistry.h @@ -82,9 +82,11 @@ struct UsdMayaPrimWriterRegistry using ContextPredicateFn = std::function; - // TODO: Write new brief /// \brief Register \p fn as a factory function providing a /// UsdMayaPrimWriter subclass that can be used to write \p mayaType. + /// Provide a supportability of the primWriter. Use "supported" to + /// override the default primWriter + /// /// If you can't provide a valid UsdMayaPrimWriter for the given arguments, /// return a null pointer from the factory function \p fn. /// @@ -143,6 +145,7 @@ struct UsdMayaPrimWriterRegistry static WriterFactoryFn Find(const std::string& mayaTypeName, const UsdMayaJobExportArgs& exportArgs); + /// \brief Check for external primWriter for \p mayaTypeName. MAYAUSD_CORE_PUBLIC static void Poke(const std::string& mayaTypeName); diff --git a/lib/mayaUsd/fileio/utils/adaptor.cpp b/lib/mayaUsd/fileio/utils/adaptor.cpp index 3c86b0b911..3f8dcefa4c 100644 --- a/lib/mayaUsd/fileio/utils/adaptor.cpp +++ b/lib/mayaUsd/fileio/utils/adaptor.cpp @@ -158,7 +158,6 @@ TfType UsdMayaAdaptor::GetUsdType() const // The adaptor type mapping might be registered externally in a prim writer // plugin. This simply pokes the prim writer registry to load the prim // writer plugin in order to pull in the adaptor mapping. - //UsdMayaPrimWriterRegistry::Find(depNode.typeName().asChar(), *_jobExportArgs); UsdMayaPrimWriterRegistry::Poke(depNode.typeName().asChar()); TfRegistryManager::GetInstance().SubscribeTo();