Autodesk / Autodesk/maya-usd

Viewport does not update when deleting Hidden Display Layer containing USD Objects

Open
#4,193 1 comment 0 reactions 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**
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**

1. Create an Empty Stage
2. Create Sphere Prim
3. Create Display Layer with the Sphere
4. Set Display Layer Visibility to OFF
5. Delete Display Layer
6. 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**

![Image](https://github.com/user-attachments/assets/bfa103ab-b96d-4d4b-a517-0def7d7ff5a8)

**Code Sample to create the scene**
```python
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

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.