Autodesk / Autodesk/maya-usd

Prim highlighted in Outliner after clearing UFE selection on `SelectionReplaced` notification

Open
#2,473 2 comments 0 reactions 1 assignee Assigned to @ppt-adsk View on GitHub
bug
Dominant language
Wolfram Language
Stars
905
Forks
223
Avg merge
2d 9h
Merged PRs (30d)
17

Description

Hi all,

We're encountering an issue with selection highlighting in the Outliner when we clear the UFE selection inside a `ufe.SelectionReplaced` notification. The Outliner is still highlighting the selected prim despite nothing is actually selected. Note that we only see this issue when selecting a prim in the Outliner. When selecting a prim in the view port the selection is cleared as expected and nothing is highlighted in the Outliner.

**Steps to reproduce**
1. Create a stage with a new layer & add a prim in the Outliner (context menu > `Add New Prim`).
2. Add `MySelectionObserver` to the global selection:
```python
import ufe

class MySelectionObserver(ufe.Observer):
def __call__(self, notification):
if isinstance(notification, ufe.SelectionReplaced):
self._clearSelection(notification)

def _clearSelection(notification):
selection = ufe.GlobalSelection.get()
selection.clear()

observer = MySelectionObserver()
selection = ufe.GlobalSelection.get()
selection.addObserver(observer)
```
3. Select the previously created prim in the Outliner. Note that Outliner is still highlighting the selection. However, the prim's parents are not indicating the selection as it would be expected usually.
4. Query the global selection and notice that nothing is selected even though the Outliner is highlighting the selected prim.
```python
>>> print(item.path() for item in ufe.GlobalSelection.get())
[]
```

**Specs (if applicable):**
- CentOS Linux 7.4.1708
- Maya 2023.0.0-4.0
- MayaUSD Plugin 0.18.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.