Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
761 stars 202 forks source link

NurbsCurve floatArray “widths” values always exports as single constant values #3018

Open asims-al opened 1 year ago

asims-al commented 1 year ago

Describe the bug Upon export of a NurbsCurve with a widths floatArray, the data written out is always a single constant value:

float[] widths = [1] (
                interpolation = "constant"
            )

Perhaps this makes sense as a default if there is no widths on the curve, but not when a multi-valued floatArray data is present.


Steps to reproduce

  1. Open the following nurbs_curve.ma (uploaded with ".txt" extension) Note:

    • we imported the NurbsCurve into Maya via AL plugin via the example.usa file mentioned on this issue: https://github.com/Autodesk/maya-usd/issues/3017
    • we have the correct values on our extra attribute
      import maya.cmds as cmds
      cmds.getAttr("example_curveShape.widths")
      # Result: [0.004000000189989805, 0.004000000189989805, 0.00800000037997961, ....
      cmds.getAttr("example_curveShape.widths", type=True)
      # Result: floatArray
  2. Export with root selected image

export_options = {
    "selection": True,
    'file': "export_path.usda",
}
cmds.mayaUSDExport(**export_options)
  1. The exported usda will have:
    float[] widths = [1] (
                interpolation = "constant"
            )

Expected behavior For the width floatArray values to carry over to exported.

Specs (if applicable):

maya-usd-git-sync[bot] commented 10 months ago

Issue synced internally to EMSUSD-768