maya-usd icon indicating copy to clipboard operation
maya-usd copied to clipboard

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

Open bazhutkin opened this issue 2 years ago • 3 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

bazhutkin avatar Feb 07 '24 13:02 bazhutkin

Thanks for sharing. We've logged it.

wallworm avatar Feb 14 '24 16:02 wallworm