Skip to content

Commit

Permalink
Merge pull request #4065 from Autodesk/bailp/EMSUSD-1996/expression-data
Browse files Browse the repository at this point in the history
EMSUSD-1996 Fix expression UI
  • Loading branch information
seando-adsk authored Jan 9, 2025
2 parents 05bcc2b + f6b7643 commit 058e1ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
EXPAND_PRIMS_MENU_OPTION = "Expand Prims"
EXPAND_PRIMS_PROPERTIES_MENU_OPTION = "Expand Prims and Properties"
EXPLICIT_ONLY_MENU_OPTION = "Explicit Only"
kIncludeExcludeLabel = "Include/Exclude"
kRemoveAllLabel = "Remove All"
INCLUDE_EXCLUDE_LABEL = "Include/Exclude"
REMOVE_ALL_LABEL = "Remove All"


class ExpressionMenu(QMenu):
def __init__(self, data: CollectionData, parent: QWidget):
Expand All @@ -23,8 +24,8 @@ def __init__(self, data: CollectionData, parent: QWidget):
# Note: this is necessary to avoid the separator not show up.
self.setSeparatorsCollapsible(False)

self._incExSeparator = self.addSection(kIncludeExcludeLabel)
self._removeAllAction = QAction(kRemoveAllLabel, self)
self._incExSeparator = self.addSection(INCLUDE_EXCLUDE_LABEL)
self._removeAllAction = QAction(REMOVE_ALL_LABEL, self)
self.addActions([self._incExSeparator, self._removeAllAction])

self._removeAllAction.triggered.connect(self._onRemoveAll)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
from PySide2.QtCore import QEvent, Qt # type: ignore
from PySide2.QtWidgets import QSizePolicy, QTextEdit, QWidget, QVBoxLayout, QHBoxLayout # type: ignore

from pxr import Usd, Sdf

class ExpressionWidget(QWidget):
def __init__(self, data: CollectionData, parent: QWidget, expressionChangedCallback):
super(ExpressionWidget, self).__init__(parent)
Expand Down Expand Up @@ -54,7 +52,7 @@ def __init__(self, data: CollectionData, parent: QWidget, expressionChangedCallb
def _onDataChanged(self):
usdExpressionAttr = self._collData.getMembershipExpression()
if usdExpressionAttr != None:
self._expressionText.setPlainText(usdExpressionAttr.GetText())
self._expressionText.setPlainText(usdExpressionAttr)

def submitExpression(self):
self._collData.setMembershipExpression(self._expressionText.toPlainText())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def _onDataChanged(self):
incAll = self._collData.includesAll()
if incAll != self._include.cbIncludeAll.isChecked():
self._include.cbIncludeAll.setChecked(incAll)
self.onListSelectionChanged()

def onAddToIncludePrimClicked(self):
stage = self._collData.getStage()
Expand Down

0 comments on commit 058e1ca

Please sign in to comment.