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

MAYA-128511 fix export roots behaviour #3131

Merged
merged 1 commit into from
Jun 2, 2023
Merged
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
22 changes: 11 additions & 11 deletions lib/mayaUsd/commands/baseExportCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ MStatus MayaUSDExportCommand::doIt(const MArgList& args)
// The priority order for what objects get exported is (from highest to lowest):
//
// - Requesting to export the current selection.
// - Explicit export roots provided to the command.
// - Explicit objects given to the command.
// - Explicit export roots provided to the command.
// - Otherwise defaults to all objects.
//
// This priority order is embodied from code here and from code in the function
Expand All @@ -357,18 +357,18 @@ MStatus MayaUSDExportCommand::doIt(const MArgList& args)
UsdMayaUtil::MDagPathSet dagPaths;
bool exportSelected = argData.isFlagSet(kSelectionFlag);
if (!exportSelected) {
if (userArgs.count(UsdMayaJobExportArgsTokens->exportRoots) > 0) {
const auto exportRoots = DictUtils::extractVector<std::string>(
userArgs, UsdMayaJobExportArgsTokens->exportRoots);
if (exportRoots.size() > 0) {
for (const std::string& root : exportRoots) {
objSelList.add(root.c_str());
}
}
}
argData.getObjects(objSelList);

if (objSelList.isEmpty()) {
argData.getObjects(objSelList);
if (userArgs.count(UsdMayaJobExportArgsTokens->exportRoots) > 0) {
const auto exportRoots = DictUtils::extractVector<std::string>(
userArgs, UsdMayaJobExportArgsTokens->exportRoots);
if (exportRoots.size() > 0) {
for (const std::string& root : exportRoots) {
objSelList.add(root.c_str());
}
}
}
}
}
UsdMayaUtil::GetFilteredSelectionToExport(exportSelected, objSelList, dagPaths);
Expand Down