-
Notifications
You must be signed in to change notification settings - Fork 203
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-107682] usdz export writes incorrect texture paths #972
Comments
Are you using the |
@JGamache-autodesk I did try that, but it didn't change the results. Still the same issue unfortunately |
I am not able to reproduce the issue you are having. Could you expand on how you export the scene by pasting the Maya command that was used for step 2? |
Sure, so I did a fresh build from Maya Workspace: bugreports.zip Little diagnostic script that exports the file, then prints out the usdz contents and then the texture file path from maya import cmds
import zipfile
import os
from pxr import Usd
from pxr import UsdShade
path = os.path.join(os.path.dirname(cmds.file(q=True, sn=True)), "asset.usdz")
# Write the file out
cmds.mayaUSDExport(
f=path,
exportSkels="auto",
frameRange=(1,100),
compatibility='appleArKit'
)
# List the zipfile hierarchy
with zipfile.ZipFile(path) as zf:
zf.printdir()
# Check with USD what the path is
stage = Usd.Stage.Open(path)
prim = stage.GetPrimAtPath("/AssetGroup/Looks/pxrUsdPreviewSurface1SG/file1")
shader = UsdShade.Shader(prim)
tex = shader.GetInput("file").Get()
print(tex) And the output when run. The last line shows the texture path on the file prim. This almost matches the Maya workspace except it adds the The second last line shows the path to the actual texture in the usdz. Previously, this would be in a numerical directory within the zip. e.g. the path would have been:
|
@JGamache-autodesk I am able to reproduce this issue internally as well. we have a Jira item logged for it already. |
This bug was reproduced on OS/X, but not on Windows and Linux where the texture path is correct: |
(I know y'all are out for a well earned holiday break, but posting here before I forget) Just doing some digging, but in if (fileExt == UsdMayaTranslatorTokens->UsdFileExtensionPackage) {
// We don't write to fileNameWithExt directly; instead, we write to
// a temp stage file.
_fileName = _MakeTmpStageName(TfGetPathName(fileNameWithExt));
}
I'm going to try and put the original file name into the ExportArgs for retrieval later, since I don't see any where that it is accessible otherwise |
I've opened a PR for the fix: #1028 |
…h rather than any temp paths the exporter sets. Address Autodesk#972
PR #1028 has been merged. @santosg87 please validate and close this issue. |
Describe the bug
This is an issue that builds on #795.
The resulting usdz file now does contain the texture, but it now contains the entire full path hierarchy to the file instead.
See this screenshot showing the usdz files hierarchy. Note, this could potentially be revelatory for certain people if the hierarchy included project names etc...
The usdz file is attached :
asset.usdz.zip
The resulting usd file inside the usdz also does not point to the correct texture path, instead pointing to the path as it was in the Maya file.
The workaround of disabling the block of code mentioned in #795 works to let us workaround this behaviour.
While the change in the #865 partially fixed the original issue so the texture is included, it actually creates a different issue as described here. Apologies for not catching this sooner, as the change in the PR did satisfy a specific part of our pipeline that obscured the second part of this issue. Testing in a fully vanilla environment exposes this next bit which is still problematic.
Steps to reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect the texture to be written such that it's using the same relative path as the maya material does, just inlined into the Maya file.
If the texture lives outside the Maya workspace, then it would be best to keep the old behaviour where it was stored in
0/textureName.jpg
etc....Specs (if applicable):
The text was updated successfully, but these errors were encountered: