Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

bazhutkin opened this issue · comments

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

# 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

Specs (if applicable):

  • Windows 11
  • Maya 2024.2
  • Maya USD 0.26.0

Thanks for sharing. We've logged it.