Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
760 stars 202 forks source link

Texture paths are resolved differently by Maya and the exporter #3201

Open dgovil opened 1 year ago

dgovil commented 1 year ago

Describe the bug Maya appears to try multiple ways to resolve a texture path, which can cause scenarios where a texture fails to resolve correctly for the USD exporter. This results in USDZ files without any textures at all.

It appears that Maya will try and find missing textures in sourceImages, even if the file node shows an absolute path that doesn't exist. As long as a texture with the same base filename exists in sourceImages, it will be substituted by Maya.

However, since this behaviour isn't exposed to USD, the asset path resolution will then correctly fail.

Steps to reproduce Steps to reproduce the behavior:

  1. Create a Maya workspace and add some textures to the sourceImages directory
  2. Create a Maya scene in this workspace with an object.
  3. Assign the texture to the object but make sure to use the absolute path.
  4. Relocate the workspace
  5. Try to export the scene to a USDZ

The USDZ will be missing the textures because the Path given to it by Maya does not actually exist.

Expected behavior Maya should show the texture is missing. Instead it substitutes it with any filename match within sourceImages. The USDZ will have missing textures because the path it is given does not exist.

Tried with Maya 2024.1 and the latest Maya USD version.

maya-usd-git-sync[bot] commented 10 months ago

Issue synced internally to EMSUSD-790