Autodesk / Autodesk/maya-usd

Primvar Support in LookdevX+VP2

Open
#3,575 3 comments 0 reactions 1 assignee Claimed by @santosg87 View on GitHub
bug
Dominant language
Wolfram Language
Stars
905
Forks
223
Avg merge
2d 5h
Merged PRs (30d)
16

Description

**Describe the bug**
We're seeing several issues with the use of PrimVars when using LookDevX in Maya 2024.2 with Viewport 2.0 on a Mac. I assume these limitations extend to other platforms too.

I believe this is a Maya USD side issue rather than LookDevX, but it manifests itself through use of LookDevX hence the title.

The attached file has an example usda and usdz file.

## UV Map Selection

The UV Map selection via `UsdPrimvarReader` does not display correctly when more than one reader is in play.
Here we have a quad with two UV sets: `st` and `st1`. `st` maps textures from 0-1 in UV space, while `st1` maps them in a diagonal. Please refer to the USDZ in the file

`st` or `map1`
![image](https://github.com/Autodesk/maya-usd/assets/4443090/95175ba0-565d-4da0-bcb3-05abf05f8011)

`st1` or `map2`
![image](https://github.com/Autodesk/maya-usd/assets/4443090/23ca17d1-02e6-4ca3-a9da-8bb6bf88d728)

Now, if you consider this network with the following nodes: UsdPrimvarReader, UsdUVTexture, UsdPreviewSurfaceShader
![image](https://github.com/Autodesk/maya-usd/assets/4443090/67fbd1c9-925f-419f-a780-0b663ff2cc7a)

In the image above, a primvar reader for `st1` outputs this varname into the emissive and the base color, while a reader for `st` is connected into occlussion.

In viewport, however, base color and emissive appear to be using `st`, while occlusion uses `st1`, but the opposite should be the case.

![image](https://github.com/Autodesk/maya-usd/assets/4443090/e1c5e92a-4ee3-416b-bf20-e958a7862e65)

The same asset works properly in Preview on macOS

![image](https://github.com/Autodesk/maya-usd/assets/4443090/ffb089dd-bb1c-4f01-bf3a-2176ccf1776b)

Trying the same with MaterialX nodes almost works, but occlussion doesn't seem to work with the following nodes: ND_geompropvalue_vector2, ND_image_color3, ND_UsdPreviewSurface_surfaceshader)

![image](https://github.com/Autodesk/maya-usd/assets/4443090/562d462a-0c6b-4d83-9f48-476258971a62)

## Custom Primvars

In another example, we create a `uniform color3`f primvar in a bound mesh, and refer to it also via a `Usd Primvar Reader`, or a `geompropvalue` using MaterialX.

See the attached usda file as an example.

This doesn't seem to work in VP2.0

![image](https://github.com/Autodesk/maya-usd/assets/4443090/c74a9d20-fde3-4ec7-ac99-420263bd6b33)

Switching this to a MaterialX version with `geompropvalue` and `standard surface` doesn't work either

![image](https://github.com/Autodesk/maya-usd/assets/4443090/01fb0222-c671-4097-8ca1-c5ddacfd9d99)

However this works in other MaterialX supported contexts like Houdini

![image](https://github.com/Autodesk/maya-usd/assets/4443090/8d5ec2a2-2e0b-49ae-98cd-4a0655838a56)

**Steps to reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Attachments**
[Archive.zip](https://github.com/Autodesk/maya-usd/files/14059075/Archive.zip)

**Specs (if applicable):**
- macOS Ventura 13.6
- Maya 2024.2
- Maya USD 0.25.0

**Additional context**
Add any other context about the problem here.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.