Autodesk / Autodesk/maya-usd

Shaders created by "Edit As Maya Data" are left behind in the scene after executing "Merge Maya Edits to USD"

Open
#2,941 1 comment 0 reactions 1 assignee Claimed by @santosg87 View on GitHub
bug
Dominant language
Wolfram Language
Stars
905
Forks
223
Avg merge
2d 9h
Merged PRs (30d)
17

Description

**Describe the bug**
We found the shaders create by **"Edit As Maya Data"** right-click command are still kept in the scene after executing **"Merge Maya Edits to USD"**. This would result in many redundant shaders being created when running **"Edit As Maya Data"** a few times.

**Steps to reproduce**
1. Load the attached "meshes.usda" file with `mayaUsdProxyShape`.
Screenshot 2023-03-14 at 16 03 02

2. Open **Hypershade** window.
3. Select `Mesh1` prim and right-click select **"Edit As Maya Data"**. You will notice a `lambert` shader is created and assigned to the `Mesh1` maya mesh translated from USD prim.
Screenshot 2023-03-14 at 16 08 30

4. Select `Mesh1` maya mesh and right-click select **"Merge Maya Edits to USD"**. You will notice that the `lambert` shader is still present.
Screenshot 2023-03-14 at 16 10 58


5. Repeat **"Edit As Maya Data"** followed by **"Merge Maya Edits to USD"** actions a few more times. You will see more shaders are created.

Screenshot 2023-03-14 at 16 13 46

**Expected behavior**
Ideally, shaders created by **"Edit As Maya Data"** should be deleted after running **"Merge Maya Edits to USD"** so that no redundant shaders are left behind.

**Attachments**
meshes.usda

```
#usda 1.0

def Xform "root"
{

def Xform "house" (
kind = "environment"
)
{
def Xform "box" (
kind = "group"
)
{
def Mesh "Mesh1" (
kind = "component"
)
{
float3[] extent = [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)]
token faceVaryingLinearInterpolation = "all"
int[] faceVertexCounts = [4, 4, 4, 4, 4, 4]
int[] faceVertexIndices = [0, 1, 3, 2, 2, 3, 5, 4, 4, 5, 7, 6, 6, 7, 1, 0, 1, 7, 5, 3, 6, 0, 2, 4]
token interpolateBoundary = "edgeOnly"
point3f[] points = [(-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (-0.5, 0.5, 0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, -0.5), (0.5, 0.5, -0.5), (-0.5, -0.5, -0.5), (0.5, -0.5, -0.5)]
color3f[] primvars:displayColor = [(0.13320851, 0.13320851, 0.13320851)]
texCoord2f[] primvars:st = [(0.375, 0), (0.625, 0), (0.625, 0.25), (0.375, 0.25), (0.625, 0.5), (0.375, 0.5), (0.625, 0.75), (0.375, 0.75), (0.625, 1), (0.375, 1), (0.875, 0), (0.875, 0.25), (0.125, 0), (0.125, 0.25)] (
interpolation = "faceVarying"
)
int[] primvars:st:indices = [0, 1, 2, 3, 3, 2, 4, 5, 5, 4, 6, 7, 7, 6, 8, 9, 1, 10, 11, 2, 12, 0, 3, 13]
}

}
}
}
```

**Specs (if applicable):**
- OS & version: CentOS 7.8
- Compiler & version: GCC 9.3.1
- Maya version: Maya-2023.2.0-11.0.PFIX
- Maya USD commit SHA: latest dev at https://github.com/Autodesk/maya-usd/commit/91a5ff052dae1d3f3c8acc9aac0e3d4cfe64fe60

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.