Autodesk / Autodesk/maya-usd

Provide the ability to export UV sets in "vertex" interpolation

Open
#3,636 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Wolfram Language
Stars
905
Forks
223
Avg merge
2d 9h
Merged PRs (30d)
17

Description

**Is your feature request related to a problem? Please describe.**

Hi,

In our pipeline when exporting mesh UV sets via AL_USDMaya, there is an ["compaction level"](https://github.com/Autodesk/maya-usd/blob/v0.27.0/plugin/al/translators/CommonTranslatorOptions.h#L39) option to ["guess" & compress the UV data](https://github.com/Autodesk/maya-usd/blob/v0.27.0/plugin/al/usdmayautils/AL/usdmaya/utils/DiffPrimVar.cpp#L810) , the resulted UV sets could be "interpolation = vertex".

When exporting by "USD Export", the UV sets seems always being exported as ["interpolation = faceVarying"](https://github.com/Autodesk/maya-usd/blob/v0.27.0/lib/mayaUsd/fileio/utils/meshWriteUtils.cpp#L921).

**Describe the solution you'd like**

Ideally having an option similar as AL_USDMaya that can be turned on/off to compress UV sets data and output interpolation type accordingly.

**Describe alternatives you've considered**
N/A

**Additional context**

Example output of a poly plane geometry, exported from AL_USDMaya when "compaction level" set to be "extensive":
```
#usda 1.0
(
defaultPrim = "pPlane1"
)

def Mesh "pPlane1"
{
float3[] extent = [(-0.5, -1.110223e-16, -0.5), (0.5, 1.110223e-16, 0.5)]
int[] faceVertexCounts = [4, 4, 4, 4]
int[] faceVertexIndices = [0, 1, 4, 3, 1, 2, 5, 4, 3, 4, 7, 6, 4, 5, 8, 7]
normal3f[] normals = [(0, 1, 0)] (
interpolation = "constant"
)
point3f[] points = [(-0.5, -1.110223e-16, 0.5), (0, -1.110223e-16, 0.5), (0.5, -1.110223e-16, 0.5), (-0.5, 0, 0), (0, 0, 0), (0.5, 0, 0), (-0.5, 1.110223e-16, -0.5), (0, 1.110223e-16, -0.5), (0.5, 1.110223e-16, -0.5)]
float2[] primvars:st = [(0, 0), (0.5, 0), (1, 0), (0, 0.5), (0.5, 0.5), (1, 0.5), (0, 1), (0.5, 1), (1, 1)] (
interpolation = "vertex"
)
uniform token[] xformOpOrder = []
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with lib/mayaUsd/fileio/utils/meshWriteUtils.cpp around line 921 to understand the current UV interpolation export, then compare the compaction behavior in CommonTranslatorOptions.h and DiffPrimVar.cpp. Done means USD Export has an option to enable or disable UV compaction and emits vertex interpolation when the data permits it.

Written by the indexing model from the issue text.

Assessment

Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.