Open
Description
Describe the bug
When we delete a Display Layer with its Visibility flag set to OFF, all USD Objects that were in it won't reappear in the Viewport.
Steps to reproduce
- Create an Empty Stage
- Create Sphere Prim
- Create Display Layer with the Sphere
- Set Display Layer Visibility to OFF
- Delete Display Layer
- Notice the issue (Sphere isn't visible in viewport)
Expected behavior
All USD Objects that were in the deleted Display Layer should be back visible in the Viewport.
Workaround
I currently found nothing. We need to re-open the scene.
Attachments
Code Sample to create the scene
import mayaUsd
import maya.cmds as cmds
from pxr import UsdGeom
# Create Stage node
stage_node = cmds.createNode('mayaUsdProxyShape', skipSelect=True, name='stageShape1')
stage_node = cmds.ls(stage_node, long=True)[0]
# Create USD Sphere
stage = mayaUsd.ufe.getStage(stage_node)
xformPrim = UsdGeom.Xform.Define(stage, '/hello')
sphere_prim = UsdGeom.Sphere.Define(stage, '/hello/world')
# Create DisplayLayer with Sphere
dag_node = '{},{}'.format(stage_node, sphere_prim.GetPath().pathString)
cmds.select(dag_node)
cmds.createDisplayLayer(name='USDSphere')
Specs:
- AlmaLinux: 9.4
- Nvidia Driver: 570.124.06
- Maya: 2024
- maya-usd: 0.30.0 & 0.31.0