Autodesk / maya-usd

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

[MAYA-122129] Attribute Editor: Does not display array-type attributes on usd scopes #2111

Closed mlfecho closed 2 months ago

mlfecho commented 2 years ago

Describe the bug The Attribute Editor does not display array-type attributes on usd scopes. These array attributes are, however, present, and queryable via the Usd API. Additionally, you must change tabs in the Attribute Editor to refresh and reflect newly created attributes.

Steps to reproduce Steps to reproduce the behavior:

  1. Open a new file in Maya 2022
  2. Navigate to Create -> Universal Scene Description (USD) -> Stage with new layer
  3. Right click on the proxy shape -> Add new prim -> Sphere
  4. Select the sphere in the Outliner
  5. Paste and run the following code in the Script Editor:
    
    from maya import cmds
    import mayaUsd.ufe
    from pixar import Sdf

node = cmds.ls(sl=True, ufe=True)[0] prim = mayaUsd.ufe.ufePathToPrim(node)

this shows up under Extra Attributes (need to change tabs to refresh)

stringAttr = prim.CreateAttribute('stringAttr', Sdf.ValueTypeNames.String) stringAttr.Set('hello world') print(stringAttr.Get())

this does not show up under in Attribute Editor

stringArrayAttr = prim.CreateAttribute('stringArrayAttr', Sdf.ValueTypeNames.StringArray) stringArrayAttr.Set(['hello', 'world']) print(stringArrayAttr.Get())

this shows up under Extra Attributes (need to change tabs to refresh)

intAttr = prim.CreateAttribute('intAttr', Sdf.ValueTypeNames.Int) intAttr.Set(42) print(intAttr.Get())

this does not show up under in Attribute Editor

intArrayAttr = prim.CreateAttribute('intArrayAttr', Sdf.ValueTypeNames.IntArray) intArrayAttr.Set([42, 24]) print(intArrayAttr.Get())


6. Toggle tabs in the Attribute Editor to refresh, and expand Extra Attributes.
7. Only intAttr and stringAttr are shown

**Expected behavior**
All four newly created attributes (stringAttr, stringArrayAttr, intAttr, and intArrayAttr) should be shown in the Attribute Editor

**Attachments**
![missingAttrArrays1](https://user-images.githubusercontent.com/488219/154395561-c812a392-15e0-480a-af79-19c481deacc9.gif)

**Specs (if applicable):**
 - OS: Linux 64 bit
 - Maya version: Maya 2022.update3
seando-adsk commented 2 years ago

By default we are hiding the array attributes from the Attribute Editor (AE). You can enable them by checking "Show | Show Array Attributes" in the AE. This setting is saved in user prefs.

Also note in the AE we don't display the values of the array, instead we display the type and size. There is a context menu for these array types with menu items to copy the values or print them to script editor.

Sean

mlfecho commented 2 years ago

Ah! My bad. This is perfect, thank you.

seando-adsk commented 2 years ago

Great thanks for the update.

@santosg87 Can you test "you must change tabs in the Attribute Editor to refresh and reflect newly created attributes" and log internally if needed.

santosd commented 2 years ago

Logged the AE refresh issue internally MAYA-122129.

santosg87 commented 2 months ago

The fix for the AE refresh has been in for some time now without any new reports.

Marking this as closed, as all the relevant issues have been addressed.