Skip to content

Commit 4222dc7

Browse files
committed
Use legacy DefaultPrim logic if using legacy material scopes
Since the default prim logic was needed to determine the parent scope of materials in the current material scope behavior, it isn't needed if using the legacy material scope strategy
1 parent cdf562b commit 4222dc7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/mayaUsd/fileio/jobs/writeJob.cpp

+10-6
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,16 @@ bool UsdMaya_WriteJob::_BeginWriting(const std::string& fileName, bool append)
222222
MayaUsd::ProgressBarScope progressBar(8);
223223

224224
// If no default prim for the exported root layer was given, select one from
225-
// the available root nodes of the Maya scene. We take into account the excluded
226-
// node types based on the export job arguments.
227-
if (mJobCtx.mArgs.defaultPrim.empty()) {
228-
MStringArray roots = GetExportDefaultPrimCandidates(mJobCtx.mArgs);
229-
if (roots.length() > 0) {
230-
mJobCtx.mArgs.defaultPrim = roots[0].asChar();
225+
// the available root nodes of the Maya scene in order for materials to be
226+
// parented correctly. We take into account the excluded node types based on
227+
// the export job arguments. This is not required if using the legacy
228+
// material scope.
229+
if (!mJobCtx.mArgs.legacyMaterialScope) {
230+
if (mJobCtx.mArgs.defaultPrim.empty()) {
231+
MStringArray roots = GetExportDefaultPrimCandidates(mJobCtx.mArgs);
232+
if (roots.length() > 0) {
233+
mJobCtx.mArgs.defaultPrim = roots[0].asChar();
234+
}
231235
}
232236
}
233237

0 commit comments

Comments
 (0)