Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[usdMaya] Clearing out the prim writers before saving the stage. #229

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions third_party/maya/lib/usdMaya/MayaPrimWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ MayaPrimWriter::shouldPruneChildren() const
return false;
}

void
MayaPrimWriter::postExport()
{
}

void
MayaPrimWriter::setExportsVisibility(bool exports)
{
Expand Down
6 changes: 6 additions & 0 deletions third_party/maya/lib/usdMaya/MayaPrimWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
4 changes: 4 additions & 0 deletions third_party/maya/lib/usdMaya/usdWriteJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down