Maya NURBS curves with rational (weighted) CVs are not properly transferred to/from USD
- Dominant language
- Wolfram Language
- Stars
- 905
- Forks
- 223
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 17
Description
**Describe the bug**
Maya NURBS curves with rational (weighted) CVs are not properly transferred to/from USD.
**Steps to reproduce**
Steps to reproduce the behavior:
1. See the attached Maya scene in [nurbs_curve_weights.ma](https://github.com/Autodesk/maya-usd/files/13243980/nurbs_curve_weights.ma.txt). This scene contains two NURBS curves that only differ by the presence of non-default 'weights' on the CVs.
2. Export the scene to USD. The necessary `pointWeights` attribute is not present in the USD file.
**Expected behavior**
Here is a hand-edited example containing the USD file exported from Maya, but with the expected `pointWeights` attribute added in: [nurbs_curve_weights_fixed.usda](https://github.com/Autodesk/maya-usd/files/13244016/nurbs_curve_weights_fixed.usda.txt)
The original scene should easily round-trip through USD (setting the `pointWeights` on export, and reading them back on import).
**Attachments**
Here is an image showing the attached sample-scene. The NURBS curve with weighted CVs is highlighted. Other than the CV weights, the two curves are identical (although offset by one unit in the Z direction for testing purposes).

**Additional context**
In roughly this block of the USD-importing code:
https://github.com/Autodesk/maya-usd/blob/ed7764db0c7fa4210e20971202aa9c0150071ff7/lib/mayaUsd/fileio/translators/translatorCurves.cpp#L215-L227
We can see from this code that a "rational" curve is already being created. The call to `mayaPoints.set()` on line 219 just needs to be augmented to pass in the USD weights. Those would need to be extracted earlier via a call to `curves.GetPointWeightsAttr()`.
Similarly, for export to USD, the weights embedded in the `MPointArray` would need to be extracted and sent to `primSchema.GetPointWeightsAttr()` in the body of this method:
https://github.com/Autodesk/maya-usd/blob/ed7764db0c7fa4210e20971202aa9c0150071ff7/lib/usd/translators/nurbsCurveWriter.cpp#L150
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.