Autodesk / Autodesk/maya-usd

Cube export and re-import shows different normals

Open
#3,396 3 comments 1 reaction 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**

When exporting a default maya cube (with or without construction history) and re-importing it the mesh normals appear different.

![image](https://github.com/Autodesk/maya-usd/assets/2439881/19a2530b-90eb-4cf5-8a9f-a66fbda0d184)

**Steps to reproduce**
Steps to reproduce the behavior:

1. Create a cube
3. Export USD
4. Import USD
5. See cube difference

**Expected behavior**

I'd expect the cube to look the same - or that export or import has a dedicated flag that exports/imports the edge creasing or face normals to ensure meshes remain consistent throughout.

**Attachments**

It seems that the only differing attributes before/after are `.face` and `.edge` - in particular the Maya scene shows:

Before (maya default cube without construction history):
```
setAttr -s 12 ".ed[0:11]" 0 1 0 2 3 0 4 5 0 6 7 0 0 2 0 1 3 0 2 4 0
3 5 0 4 6 0 5 7 0 6 0 0 7 1 0;
setAttr -s 6 -ch 24 ".fc[0:5]" -type "polyFaces"
f 4 0 5 -2 -5
mu 0 4 0 1 3 2
f 4 1 7 -3 -7
mu 0 4 2 3 5 4
f 4 2 9 -4 -9
mu 0 4 4 5 7 6
f 4 3 11 -1 -11
mu 0 4 6 7 9 8
f 4 -12 -10 -8 -6
mu 0 4 1 10 11 3
f 4 10 4 6 8
mu 0 4 12 0 2 13;
```

After (after export + import):
```
setAttr -s 12 ".ed[0:11]" 0 1 1 1 3 1 3 2 1 2 0 1 3 5 1 5 4 1 4 2 1
5 7 1 7 6 1 6 4 1 7 1 1 0 6 1;
setAttr -s 6 -ch 24 ".fc[0:5]" -type "polyFaces"
f 4 0 1 2 3
mu 0 4 0 1 3 2
f 4 -3 4 5 6
mu 0 4 2 3 5 4
f 4 -6 7 8 9
mu 0 4 4 5 7 6
f 4 -9 10 -1 11
mu 0 4 6 7 9 8
f 4 -11 -8 -5 -2
mu 0 4 1 10 11 3
f 4 -12 -4 -7 -10
mu 0 4 12 0 2 13;
```

**Specs (if applicable):**

- OS & version: Windows 10
- Maya version: 2024.1
- Maya USD: 0.25.0

**Additional context**

This might just be user error on how the export or import are defined - but this appears to be the default export/import behavior and can also be reproduced by "Duplicate as USD data" to and "Edit as Maya Data" back from a `MayaUsdProxyShape`.

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.