diff --git a/plugin/pxr/maya/lib/usdMaya/userExportedAttributesUI.py b/plugin/pxr/maya/lib/usdMaya/userExportedAttributesUI.py index e8398d4144..42e8ea8960 100644 --- a/plugin/pxr/maya/lib/usdMaya/userExportedAttributesUI.py +++ b/plugin/pxr/maya/lib/usdMaya/userExportedAttributesUI.py @@ -44,9 +44,9 @@ from PySide6.QtGui import QStringListModel try: - from PySide2.QtGui import QAbstractItemView, QCheckBox, QComboBox, QLabel, QListView, QPushButton, QStyledItemDelegate, QTableView, QVBoxLayout, QWidget + from PySide2.QtWidgets import (QAbstractItemView, QCheckBox, QComboBox, QLabel, QListView, QPushButton, QStyledItemDelegate, QTableView, QVBoxLayout, QWidget) except: - from PySide6.QtGui import QAbstractItemView, QCheckBox, QComboBox, QLabel, QListView, QPushButton, QStyledItemDelegate, QTableView, QVBoxLayout, QWidget + from PySide6.QtWidgets import (QAbstractItemView, QCheckBox, QComboBox, QLabel, QListView, QPushButton, QStyledItemDelegate, QTableView, QVBoxLayout, QWidget) import json @@ -214,6 +214,9 @@ def __eq__(self, other): self._usdAttrType == other._usdAttrType and self._usdAttrName == other._usdAttrName) + def __hash__(self): + return hash((self._mayaAttrName, self._usdAttrType, self._usdAttrName)) + @property def mayaAttrName(self): return self._mayaAttrName @@ -340,8 +343,7 @@ def RemoveExportedAttributesForNode(nodeName, mayaAttrNames): exportedAttrs = ExportedAttribute.GetExportedAttributesFromNode(nodeName) # Filter out the attrs whose names are in mayaAttrNames. - exportedAttrs = filter( - lambda x: x.mayaAttrName not in mayaAttrNames, exportedAttrs) + exportedAttrs = [x for x in exportedAttrs if x.mayaAttrName not in mayaAttrNames] ExportedAttribute._WriteExportedAttributesToNode(nodeName, exportedAttrs)