Autodesk / maya-usd

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

Material Import fails to set texture paths when shader inputs:file properties are connected #3836

Open andrewkaufman opened 5 days ago

andrewkaufman commented 5 days ago

Describe the bug I have a Material Prim serving as an interface for a shader network. Attributes on the Material connect to attributes on the shaders. When I load this scene via the Layer Panel it all works as expected. When I instead File->Import this scene, the textures fail to load onto the Maya shaders (even with importUSDZTextures=1).

Steps to reproduce

  1. Download the usdz from the source data google drive link below
  2. Open Maya, load maya-usd plugin
  3. Open Layer Editor, Create Stage from File, Select the usdz, Enable texture shading in the viewport -> Success
  4. File New, File->Import, Select the usdz, Enable "Import USDZ Textures" in the file type specific import options, Enable texture shading in the viewport -> Fail

Expected behavior The viewport should render steps (3) and (4) the same way, which should appear as a cube mesh with a cracked stone texture.

Attachments

Source data: https://drive.google.com/file/d/1qUHkOrtXG55vjtSAMl-i0qhnykPgezqr/view

Via Layer Editor: image

Via Import: image

Specs

Additional context The Material Prim is serving as an interface for the shader network. The AssetPath texture inputs are specified on the Material Prim, and the actual inputs:file properties on the UsdUVTexture shaders are connected to the inputs on the Material Prim. If I delete this interface & instead set the Shader prim inputs directly, then the Maya textures are setup correctly via File->Import.

santosg87 commented 4 days ago

thank you for reporting this.

I will bring the discussion to the team to investigate a bit deeper, although, this might be just a limitation of the importer. As maya would have to change those connections in order to convert the shader network properly - i could be wrong on this though. I will take a look at your original file attached and see what i can find :)

andrewkaufman commented 4 days ago

I don't see why Maya would have to remove those connections when importing. The equivalent Maya shader network should be custom attributes added to the shadingEngine and connected to the fileTextureName on the file shaders.

PS. @santosg87 I will try to open up permessions on the example file. I granted you access for now, but I may have to swap the link to a different storage to make it fully open to the public.

andrewkaufman commented 4 days ago

I have replaced the google drive link with a new one that is hopefully fully open to the public. Let me know if you have trouble accessing it.