Skip to content

Commit 901f76d

Browse files
authored
Merge pull request #3913 from dj-mcg/pr/Legacy_Default_Prim_Logic
Use legacy DefaultPrim logic if using legacy material scopes
2 parents 7aec718 + 4222dc7 commit 901f76d

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)