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-111329: Fix echouer to import none Usdz ( *.usd, *.usda ) files when "USDX Texture import" option was enabled. #1392

Merged
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
13 changes: 3 additions & 10 deletions lib/mayaUsd/fileio/jobs/readJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,9 @@ bool UsdMaya_ReadJob::Read(std::vector<MDagPath>* addedDagPaths)
CHECK_MSTATUS_AND_RETURN(status, false);
}

if (this->mArgs.importUSDZTextures == true) {
// NOTE: (yliangsiew) First we check if the archive in question _is_ even a USDZ archive...
if (!stage->GetRootLayer()->GetFileFormat()->IsPackage()) {
TF_WARN(
"The layer being imported: %s is not a USDZ file.",
stage->GetRootLayer()->GetRealPath().c_str());
return MStatus::kFailure;
}

if (this->mArgs.importUSDZTexturesFilePath.length() == 0) {
// check if "USDZ Texture import" option is checked and the archive in question is a USDZ.
if (mArgs.importUSDZTextures && stage->GetRootLayer()->GetFileFormat()->IsPackage()) {
if (mArgs.importUSDZTexturesFilePath.length() == 0) {
MString currentMayaWorkspacePath = UsdMayaUtil::GetCurrentMayaWorkspacePath();
Comment on lines +264 to 267

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ysiewappl somehow Github wouldn't let me add you as a reviewer.

I adjusted the logics here to not be too intrusive when importing none USDZ files even when "USDZ Texture import" option is enabled.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change makes sense. Thanks @hamedsabri !

TF_WARN(
"Because -importUSDZTexturesFilePath was not explicitly specified, textures "
Expand Down