You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
See the attached Maya scene in nurbs_curve_weights.ma. This scene contains two NURBS curves that only differ by the presence of non-default 'weights' on the CVs.
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
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:
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:
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:
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.usdaThe 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:
maya-usd/lib/mayaUsd/fileio/translators/translatorCurves.cpp
Lines 215 to 227 in ed7764d
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 tocurves.GetPointWeightsAttr()
.Similarly, for export to USD, the weights embedded in the
MPointArray
would need to be extracted and sent toprimSchema.GetPointWeightsAttr()
in the body of this method:maya-usd/lib/usd/translators/nurbsCurveWriter.cpp
Line 150 in ed7764d
The text was updated successfully, but these errors were encountered: