Autodesk / Autodesk/maya-usd

[EMSUSD-1025] Maya creates unnecessary groups "rigParent|rig" for MayaReference when switching other variant sets.

Open
#3,598 3 comments 1 reaction 1 assignee Claimed by @santosg87 View on GitHub
bug
Dominant language
Wolfram Language
Stars
905
Forks
223
Avg merge
2d 9h
Merged PRs (30d)
17

Description

**Describe the bug**
While testing the USD pipeline, I encountered an unexpected problem. If an asset, in addition to switching the variant between the USD representation and the rig, has other variants, for example, for texture path switching, then in this case, when switching additional variants, the rig becomes invisible, due to the fact that Maya creates new "rigParent#|rig" groups when switching other variants to other values (different from the value at which the first switch to rig occurred).

**Steps to reproduce**
```
import mayaUsd
from pxr import Sdf, Usd
shapeNode = cmds.ls(cmds.createNode('mayaUsdProxyShape', skipSelect = True, name = 'sceneShape'), long = True)[0]
stage = mayaUsd.ufe.getStage(shapeNode)
# create prim and add reference
prim = stage.DefinePrim('/world/prop_1')
prim.GetReferences().AddReference('assets/props/testProp_colorVariant/usd/pub/testProp_colorVariant.usd')
# switch to rig variant
geo_variant_sets = prim.GetVariantSets().GetVariantSet('geo')
geo_variant_sets.SetVariantSelection('rig')

# no problem
```

```
# switch to USD (cache variant)
geo_variant_sets.SetVariantSelection('cache')
# switch to green color variant
color_variant_sets = prim.GetVariantSets().GetVariantSet('color')
color_variant_sets.SetVariantSelection('Green')
# switch to rig variant
geo_variant_sets.SetVariantSelection('rig')

# problem, we don't see the rig
```
![USD Maya Reference switch variant bug](https://github.com/Autodesk/maya-usd/assets/124043393/10dc5690-eac6-4081-a409-13fc3e0c48a2)

```
# switch to red color (default) variant
color_variant_sets.SetVariantSelection('Red')

# no problem, we see the rig again
```

**Expected behavior**
Switching other variant sets should not be related to switching an asset into a rig representation.

**Attachments**
Test asset
[testProp_colorVariant.zip](https://github.com/Autodesk/maya-usd/files/14194095/testProp_colorVariant.zip)

**Specs (if applicable):**
- Windows 11
- Maya 2024.2
- Maya USD 0.26.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.