コード例 #1
0
    def __init__(self, parent):
        QtWidgets.QWidget.__init__(self, parent)
        self._ui = Ui_PropertyLegend()
        self._ui.setupUi(self)

        self._isMinimized = True
        self._iconDisplaySize = (16, 16)

        graphicsScene = QtWidgets.QGraphicsScene()

        self._ui.propertyLegendColorFallback.setScene(graphicsScene)
        self._ui.propertyLegendColorDefault.setScene(graphicsScene)
        self._ui.propertyLegendColorTimeSample.setScene(graphicsScene)
        self._ui.propertyLegendColorNoValue.setScene(graphicsScene)
        self._ui.propertyLegendColorValueClips.setScene(graphicsScene)
        self._ui.propertyLegendColorCustom.setScene(graphicsScene)

        # set color of attribute viewer legend boxes
        self._ui.propertyLegendColorFallback.setForegroundBrush(
            FallbackTextColor)
        self._ui.propertyLegendColorDefault.setForegroundBrush(
            DefaultTextColor)
        self._ui.propertyLegendColorTimeSample.setForegroundBrush(
            TimeSampleTextColor)
        self._ui.propertyLegendColorNoValue.setForegroundBrush(
            NoValueTextColor)
        self._ui.propertyLegendColorValueClips.setForegroundBrush(
            ValueClipsTextColor)
        self._ui.propertyLegendColorCustom.setForegroundBrush(RedColor)

        # set color of attribute viewer text items
        legendTextUpdate = lambda t, c: (
            ('<font color=\"%s\">' % c.color().name()) + t.text() + '</font>')
        timeSampleLegend = self._ui.propertyLegendLabelTimeSample
        timeSampleLegend.setText(
            legendTextUpdate(timeSampleLegend, TimeSampleTextColor))

        fallbackLegend = self._ui.propertyLegendLabelFallback
        fallbackLegend.setText(
            legendTextUpdate(fallbackLegend, FallbackTextColor))

        valueClipLegend = self._ui.propertyLegendLabelValueClips
        valueClipLegend.setText(
            legendTextUpdate(valueClipLegend, ValueClipsTextColor))

        noValueLegend = self._ui.propertyLegendLabelNoValue
        noValueLegend.setText(legendTextUpdate(noValueLegend,
                                               NoValueTextColor))

        defaultLegend = self._ui.propertyLegendLabelDefault
        defaultLegend.setText(legendTextUpdate(defaultLegend,
                                               DefaultTextColor))

        customLegend = self._ui.propertyLegendLabelCustom
        customLegend.setText(legendTextUpdate(customLegend, RedColor))

        interpolatedStr = 'Interpolated'
        tsLabel = self._ui.propertyLegendLabelTimeSample
        tsLabel.setText(ItalicizeLabelText(tsLabel.text(), interpolatedStr))

        vcLabel = self._ui.propertyLegendLabelValueClips
        vcLabel.setText(ItalicizeLabelText(vcLabel.text(), interpolatedStr))

        # Load up and set the icons for the property legend
        self._ui.propertyLegendTargetIcon.setPixmap(
            TARGET_TYPE_ICON().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendConnIcon.setPixmap(
            CONN_TYPE_ICON().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendAttrPlainIcon.setPixmap(
            ATTR_PLAIN_TYPE_ICON().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendRelPlainIcon.setPixmap(
            REL_PLAIN_TYPE_ICON().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendAttrWithConnIcon.setPixmap(
            ATTR_WITH_CONN_TYPE_ICON().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendRelWithTargetIcon.setPixmap(
            REL_WITH_TARGET_TYPE_ICON().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendCompIcon.setPixmap(
            CMP_TYPE_ICON().pixmap(*self._iconDisplaySize))
コード例 #2
0
ファイル: propertyLegend.py プロジェクト: lvxejay/USD
    def __init__(self, parent):
        QtWidgets.QWidget.__init__(self, parent)
        self._ui = Ui_PropertyLegend()
        self._ui.setupUi(self)

        self._isMinimized = True
        self._iconDisplaySize = (16, 16)

        graphicsScene = QtWidgets.QGraphicsScene()

        self._ui.propertyLegendColorFallback.setScene(graphicsScene)
        self._ui.propertyLegendColorDefault.setScene(graphicsScene)
        self._ui.propertyLegendColorTimeSample.setScene(graphicsScene)
        self._ui.propertyLegendColorNoValue.setScene(graphicsScene)
        self._ui.propertyLegendColorValueClips.setScene(graphicsScene)
        self._ui.propertyLegendColorCustom.setScene(graphicsScene)

        # set color of attribute viewer legend boxes
        self._ui.propertyLegendColorFallback.setForegroundBrush(
            UIPropertyValueSourceColors.FALLBACK)
        self._ui.propertyLegendColorDefault.setForegroundBrush(
            UIPropertyValueSourceColors.DEFAULT)
        self._ui.propertyLegendColorTimeSample.setForegroundBrush(
            UIPropertyValueSourceColors.TIME_SAMPLE)
        self._ui.propertyLegendColorNoValue.setForegroundBrush(
            UIPropertyValueSourceColors.NONE)
        self._ui.propertyLegendColorValueClips.setForegroundBrush(
            UIPropertyValueSourceColors.VALUE_CLIPS)
        self._ui.propertyLegendColorCustom.setForegroundBrush(
            UIBaseColors.RED)

        # set color of attribute viewer text items
        legendTextUpdate = lambda t, c: (
            ('<font color=\"%s\">' % c.color().name()) + t.text() + '</font>')
        timeSampleLegend = self._ui.propertyLegendLabelTimeSample
        timeSampleLegend.setText(
            legendTextUpdate(timeSampleLegend, UIPropertyValueSourceColors.TIME_SAMPLE))

        fallbackLegend = self._ui.propertyLegendLabelFallback
        fallbackLegend.setText(
            legendTextUpdate(fallbackLegend, UIPropertyValueSourceColors.FALLBACK))

        valueClipLegend = self._ui.propertyLegendLabelValueClips
        valueClipLegend.setText(
            legendTextUpdate(valueClipLegend, UIPropertyValueSourceColors.VALUE_CLIPS))

        noValueLegend = self._ui.propertyLegendLabelNoValue
        noValueLegend.setText(
            legendTextUpdate(noValueLegend, UIPropertyValueSourceColors.NONE))

        defaultLegend = self._ui.propertyLegendLabelDefault
        defaultLegend.setText(
            legendTextUpdate(defaultLegend, UIPropertyValueSourceColors.DEFAULT))

        customLegend = self._ui.propertyLegendLabelCustom
        customLegend.setText(
            legendTextUpdate(customLegend, UIBaseColors.RED))

        interpolatedStr = 'Interpolated'
        tsLabel = self._ui.propertyLegendLabelTimeSample
        tsLabel.setText(ItalicizeLabelText(tsLabel.text(), interpolatedStr))

        vcLabel = self._ui.propertyLegendLabelValueClips
        vcLabel.setText(ItalicizeLabelText(vcLabel.text(), interpolatedStr))

        # Load up and set the icons for the property legend
        self._ui.propertyLegendTargetIcon.setPixmap(
            PropertyViewIcons.TARGET().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendConnIcon.setPixmap(
            PropertyViewIcons.CONNECTION().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendAttrPlainIcon.setPixmap(
            PropertyViewIcons.ATTRIBUTE().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendRelPlainIcon.setPixmap(
            PropertyViewIcons.RELATIONSHIP().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendAttrWithConnIcon.setPixmap(
            PropertyViewIcons.ATTRIBUTE_WITH_CONNECTIONS().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendRelWithTargetIcon.setPixmap(
            PropertyViewIcons.RELATIONSHIP_WITH_TARGETS().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendCompIcon.setPixmap(
            PropertyViewIcons.COMPOSED().pixmap(*self._iconDisplaySize))
コード例 #3
0
    def __init__(self, parent):
        QtWidgets.QWidget.__init__(self, parent)
        self._ui = Ui_PropertyLegend()
        self._ui.setupUi(self)

        self._isMinimized = True
        self._iconDisplaySize = (16, 16)

        graphicsScene = QtWidgets.QGraphicsScene()

        self._ui.propertyLegendColorFallback.setScene(graphicsScene)
        self._ui.propertyLegendColorDefault.setScene(graphicsScene)
        self._ui.propertyLegendColorTimeSample.setScene(graphicsScene)
        self._ui.propertyLegendColorNoValue.setScene(graphicsScene)
        self._ui.propertyLegendColorValueClips.setScene(graphicsScene)
        self._ui.propertyLegendColorCustom.setScene(graphicsScene)

        # set color of attribute viewer legend boxes
        self._ui.propertyLegendColorFallback.setForegroundBrush(
            UIPropertyValueSourceColors.FALLBACK)
        self._ui.propertyLegendColorDefault.setForegroundBrush(
            UIPropertyValueSourceColors.DEFAULT)
        self._ui.propertyLegendColorTimeSample.setForegroundBrush(
            UIPropertyValueSourceColors.TIME_SAMPLE)
        self._ui.propertyLegendColorNoValue.setForegroundBrush(
            UIPropertyValueSourceColors.NONE)
        self._ui.propertyLegendColorValueClips.setForegroundBrush(
            UIPropertyValueSourceColors.VALUE_CLIPS)
        self._ui.propertyLegendColorCustom.setForegroundBrush(UIBaseColors.RED)

        # set color of attribute viewer text items
        legendTextUpdate = lambda t, c: (
            ('<font color=\"%s\">' % c.color().name()) + t.text() + '</font>')
        timeSampleLegend = self._ui.propertyLegendLabelTimeSample
        timeSampleLegend.setText(
            legendTextUpdate(timeSampleLegend,
                             UIPropertyValueSourceColors.TIME_SAMPLE))

        fallbackLegend = self._ui.propertyLegendLabelFallback
        fallbackLegend.setText(
            legendTextUpdate(fallbackLegend,
                             UIPropertyValueSourceColors.FALLBACK))

        valueClipLegend = self._ui.propertyLegendLabelValueClips
        valueClipLegend.setText(
            legendTextUpdate(valueClipLegend,
                             UIPropertyValueSourceColors.VALUE_CLIPS))

        noValueLegend = self._ui.propertyLegendLabelNoValue
        noValueLegend.setText(
            legendTextUpdate(noValueLegend, UIPropertyValueSourceColors.NONE))

        defaultLegend = self._ui.propertyLegendLabelDefault
        defaultLegend.setText(
            legendTextUpdate(defaultLegend,
                             UIPropertyValueSourceColors.DEFAULT))

        customLegend = self._ui.propertyLegendLabelCustom
        customLegend.setText(legendTextUpdate(customLegend, UIBaseColors.RED))

        interpolatedStr = 'Interpolated'
        tsLabel = self._ui.propertyLegendLabelTimeSample
        tsLabel.setText(ItalicizeLabelText(tsLabel.text(), interpolatedStr))

        vcLabel = self._ui.propertyLegendLabelValueClips
        vcLabel.setText(ItalicizeLabelText(vcLabel.text(), interpolatedStr))

        # Load up and set the icons for the property legend
        self._ui.propertyLegendTargetIcon.setPixmap(
            PropertyViewIcons.TARGET().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendConnIcon.setPixmap(
            PropertyViewIcons.CONNECTION().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendAttrPlainIcon.setPixmap(
            PropertyViewIcons.ATTRIBUTE().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendRelPlainIcon.setPixmap(
            PropertyViewIcons.RELATIONSHIP().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendAttrWithConnIcon.setPixmap(
            PropertyViewIcons.ATTRIBUTE_WITH_CONNECTIONS().pixmap(
                *self._iconDisplaySize))
        self._ui.propertyLegendRelWithTargetIcon.setPixmap(
            PropertyViewIcons.RELATIONSHIP_WITH_TARGETS().pixmap(
                *self._iconDisplaySize))
        self._ui.propertyLegendCompIcon.setPixmap(
            PropertyViewIcons.COMPOSED().pixmap(*self._iconDisplaySize))
コード例 #4
0
ファイル: propertyLegend.py プロジェクト: mplanck/USD
    def __init__(self, parent):
        QtWidgets.QWidget.__init__(self, parent)
        self._ui = Ui_PropertyLegend()
        self._ui.setupUi(self)

        self._isMinimized = True
        self._iconDisplaySize = (16,16)

        graphicsScene = QtWidgets.QGraphicsScene()

        self._ui.propertyLegendColorFallback.setScene(graphicsScene)
        self._ui.propertyLegendColorDefault.setScene(graphicsScene)
        self._ui.propertyLegendColorTimeSample.setScene(graphicsScene)
        self._ui.propertyLegendColorNoValue.setScene(graphicsScene)
        self._ui.propertyLegendColorValueClips.setScene(graphicsScene)
        self._ui.propertyLegendColorCustom.setScene(graphicsScene)
        
        # set color of attribute viewer legend boxes
        self._ui.propertyLegendColorFallback.setForegroundBrush(FallbackTextColor)
        self._ui.propertyLegendColorDefault.setForegroundBrush(DefaultTextColor)
        self._ui.propertyLegendColorTimeSample.setForegroundBrush(TimeSampleTextColor)
        self._ui.propertyLegendColorNoValue.setForegroundBrush(NoValueTextColor)
        self._ui.propertyLegendColorValueClips.setForegroundBrush(ValueClipsTextColor)
        self._ui.propertyLegendColorCustom.setForegroundBrush(RedColor)

        # set color of attribute viewer text items
        legendTextUpdate = lambda t, c: (('<font color=\"%s\">' % c.color().name())
                                         + t.text() + '</font>') 
        timeSampleLegend = self._ui.propertyLegendLabelTimeSample
        timeSampleLegend.setText(legendTextUpdate(timeSampleLegend, TimeSampleTextColor))
        
        fallbackLegend = self._ui.propertyLegendLabelFallback
        fallbackLegend.setText(legendTextUpdate(fallbackLegend, FallbackTextColor))

        valueClipLegend = self._ui.propertyLegendLabelValueClips
        valueClipLegend.setText(legendTextUpdate(valueClipLegend, ValueClipsTextColor))

        noValueLegend = self._ui.propertyLegendLabelNoValue
        noValueLegend.setText(legendTextUpdate(noValueLegend, NoValueTextColor))

        defaultLegend = self._ui.propertyLegendLabelDefault
        defaultLegend.setText(legendTextUpdate(defaultLegend, DefaultTextColor))

        customLegend = self._ui.propertyLegendLabelCustom 
        customLegend.setText(legendTextUpdate(customLegend, RedColor))

        interpolatedStr = 'Interpolated'
        tsLabel = self._ui.propertyLegendLabelTimeSample
        tsLabel.setText(ItalicizeLabelText(tsLabel.text(), interpolatedStr))

        vcLabel = self._ui.propertyLegendLabelValueClips
        vcLabel.setText(ItalicizeLabelText(vcLabel.text(), interpolatedStr))

        # Load up and set the icons for the property legend
        self._ui.propertyLegendTargetIcon.setPixmap(
            TARGET_TYPE_ICON().pixmap(*self._iconDisplaySize)) 
        self._ui.propertyLegendConnIcon.setPixmap(
            CONN_TYPE_ICON().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendAttrPlainIcon.setPixmap(
            ATTR_PLAIN_TYPE_ICON().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendRelPlainIcon.setPixmap(
            REL_PLAIN_TYPE_ICON().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendAttrWithConnIcon.setPixmap(
            ATTR_WITH_CONN_TYPE_ICON().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendRelWithTargetIcon.setPixmap(
            REL_WITH_TARGET_TYPE_ICON().pixmap(*self._iconDisplaySize))
        self._ui.propertyLegendCompIcon.setPixmap(
            CMP_TYPE_ICON().pixmap(*self._iconDisplaySize))