Skip to content

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

Open
@sbissonnette

Description

@sbissonnette

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

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions