diff --git a/third_party/maya/lib/usdMaya/MayaPrimWriter.cpp b/third_party/maya/lib/usdMaya/MayaPrimWriter.cpp index 7458580224..c0c18ca141 100644 --- a/third_party/maya/lib/usdMaya/MayaPrimWriter.cpp +++ b/third_party/maya/lib/usdMaya/MayaPrimWriter.cpp @@ -183,6 +183,11 @@ MayaPrimWriter::shouldPruneChildren() const return false; } +void +MayaPrimWriter::postExport() +{ +} + void MayaPrimWriter::setExportsVisibility(bool exports) { diff --git a/third_party/maya/lib/usdMaya/MayaPrimWriter.h b/third_party/maya/lib/usdMaya/MayaPrimWriter.h index 0d908168f5..7199cd1a69 100644 --- a/third_party/maya/lib/usdMaya/MayaPrimWriter.h +++ b/third_party/maya/lib/usdMaya/MayaPrimWriter.h @@ -69,6 +69,12 @@ class MayaPrimWriter PXRUSDMAYA_API virtual bool shouldPruneChildren() const; + /// Post export function that runs before saving the stage. + /// + /// Base implementation does nothing. + PXRUSDMAYA_API + virtual void postExport(); + public: const MDagPath& getDagPath() const { return mDagPath; } const SdfPath& getUsdPath() const { return mUsdPath; } diff --git a/third_party/maya/lib/usdMaya/usdWriteJob.cpp b/third_party/maya/lib/usdMaya/usdWriteJob.cpp index e1c15c7a94..00048e77f0 100644 --- a/third_party/maya/lib/usdMaya/usdWriteJob.cpp +++ b/third_party/maya/lib/usdMaya/usdWriteJob.cpp @@ -382,6 +382,10 @@ void usdWriteJob::endJob() // prim for the export... usdVariantRootPrimPath mJobCtx.mStage->GetRootLayer()->SetDefaultPrim(defaultPrim); } + // Running post export function on all the prim writers. + for (auto& primWriter: mJobCtx.mMayaPrimWriterList) { + primWriter->postExport(); + } if (mJobCtx.mStage->GetRootLayer()->PermissionToSave()) { mJobCtx.mStage->GetRootLayer()->Save(); }