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-106486 UDIM Import/Export #883

Merged
merged 2 commits into from
Nov 4, 2020
Merged

Conversation

JGamache-autodesk
Copy link
Collaborator

Correctly detect and handle UDIM on import and export.

Correctly detect and handle UDIM on import and export.
Copy link
Contributor

@mattyjams mattyjams left a comment

Choose a reason for hiding this comment

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

Looks good to me!

lib/usd/translators/shading/usdFileTextureWriter.cpp Outdated Show resolved Hide resolved
Comment on lines +211 to +229
// USD did not resolve the path to absolute because the file name was not an
// actual file on disk. We need to find the first tile to help Maya find the
// other ones.
std::string udimPath(filePath.substr(0, udimPos));
udimPath += "1001";
udimPath += filePath.substr(udimPos + _tokens->UDIMTag.GetString().size());

Usd_Resolver res(&prim.GetPrimIndex());
for (; res.IsValid(); res.NextLayer()) {
std::string resolvedName
= SdfComputeAssetPathRelativeToLayer(res.GetLayer(), udimPath);

if (!resolvedName.empty() && !ArIsPackageRelativePath(resolvedName)
&& resolvedName != udimPath) {
udimPath = resolvedName;
break;
}
}
val = SdfAssetPath(udimPath);
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would love to use that function, but it is currently private:
https://github.com/PixarAnimationStudios/USD/blob/dev/pxr/usdImaging/usdImaging/CMakeLists.txt#L68
Maybe in the next version?

@JGamache-autodesk JGamache-autodesk added the ready-for-merge Development process is finished, PR is ready for merge label Nov 3, 2020
@kxl-adsk kxl-adsk merged commit 9d64663 into dev Nov 4, 2020
@kxl-adsk kxl-adsk deleted the t_gamaj/MAYA-106486/udim_import_export branch November 4, 2020 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-export Related to Import and/or Export ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants