Skip to content

Commit

Permalink
Merge pull request #31 from BigRoy/chore/get_applied_item_backwards_c…
Browse files Browse the repository at this point in the history
…ompatibility

Refactor `GetAppliedItems()` to be backwards compatible
  • Loading branch information
BigRoy authored Nov 30, 2023
2 parents 5a00ae3 + 77eca7e commit a8b27ee
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions usd_qtpy/references.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
from .prim_hierarchy_model import HierarchyModel


def get_applied_items(list_proxy):
"""Backwards compatible equivalent of `GetAppliedItems()`"""
return list_proxy.ApplyEditsToList([])


class PickPrimPath(QtWidgets.QDialog):

picked_path = QtCore.Signal(Sdf.Path)
Expand Down Expand Up @@ -282,10 +287,8 @@ def clear(layout):
references = []
payloads = []
for prim_spec in stack:
for reference in prim_spec.referenceList.GetAppliedItems():
references.append(reference)
for payload in prim_spec.payloadList.GetAppliedItems():
payloads.append(payload)
references.extend(get_applied_items(prim_spec.referenceList))
payloads.extend(get_applied_items(prim_spec.payloadList))

for reference in references:
self._add_widget(self.references_layout, item=reference)
Expand Down

0 comments on commit a8b27ee

Please sign in to comment.