Ejemplo n.º 1
0
 def __init__(self):
     QtWidgets.QDialog.__init__(self, None)
     self.setWindowTitle('Duplicate Asset Found')
     layout = QtWidgets.QVBoxLayout(self)
     self.__productLabel = QtWidgets.QLabel('', self)
     layout.addWidget(self.__productLabel)
     layout.addSpacing(32)
     layout.addStretch()
     checkboxLayout = QtWidgets.QHBoxLayout(self)
     layout.addItem(checkboxLayout)
     self.__doForAllCheckbox = QtWidgets.QCheckBox(
         'Apply Action To All Remaining Duplicates', self)
     checkboxLayout.addWidget(self.__doForAllCheckbox)
     checkboxLayout.addStretch()
     self.__skipButton = QtWidgets.QPushButton('Skip', self)
     self.__addAnywayButton = QtWidgets.QPushButton('Add Anyway', self)
     self.__cancelButton = QtWidgets.QPushButton('Cancel', self)
     buttonLayout = QtWidgets.QHBoxLayout()
     layout.addItem(buttonLayout)
     buttonLayout.addStretch()
     buttonLayout.addWidget(self.__skipButton)
     buttonLayout.addWidget(self.__addAnywayButton)
     buttonLayout.addWidget(self.__cancelButton)
     self.__cancelButton.clicked.connect(self.reject)
     self.__skipButton.clicked.connect(self.__skipButtonClicked)
     self.__addAnywayButton.clicked.connect(self.__addAnywayButtonClicked)
     self.__result = None
     return
Ejemplo n.º 2
0
    def __init__(self, parent, group):
        super(UsdMaterialBakeEditor, self).__init__(parent=parent)
        self.setLayout(QtWidgets.QVBoxLayout())

        self.__groupNode = group
        self.__interruptWidget = None
        self.__timer = None

        #For auto upgrade in the future
        # pylint: disable=undefined-variable
        versionValue = 1
        versionParam = group.getParameter('__networkVersion')

        if versionParam:
            versionValue = int(versionParam.getValue(0))

        self.__widgetFactory = UI4.FormMaster.ParameterWidgetFactory
        widgets = []
        self.__rootPolicy = UI4.FormMaster.CreateParameterPolicy(
            None, group.getParameters())
        widgets.append(self.__widgetFactory.buildWidget(
            self, self.__rootPolicy.getChildByName('rootLocations')))
        variantsWidget = VariantsWidget(self.__groupNode, parent=self)
        widgets.append(variantsWidget)
        widgets.append(UI4.Widgets.VBoxLayoutResizer(variantsWidget))
        widgets.append(self.__widgetFactory.buildWidget(
            self, self.__rootPolicy.getChildByName('saveTo')))
        widgets.append(self.__widgetFactory.buildWidget(
            self, self.__rootPolicy.getChildByName('looksFilename')))
        widgets.append(self.__widgetFactory.buildWidget(
            self, self.__rootPolicy.getChildByName('looksFileFormat')))
        widgets.append(self.__widgetFactory.buildWidget(
            self, self.__rootPolicy.getChildByName('alwaysCreateVariantSet')))
        widgets.append(self.__widgetFactory.buildWidget(
            self, self.__rootPolicy.getChildByName(
                'createCompleteUsdAssemblyFile')))
        widgets.append(self.__widgetFactory.buildWidget(
            self, self.__rootPolicy.getChildByName('assemblyFilename')))
        widgets.append(self.__widgetFactory.buildWidget(
            self, self.__rootPolicy.getChildByName('payloadFilename')))
        widgets.append(self.__widgetFactory.buildWidget(
            self, self.__rootPolicy.getChildByName('rootPrimName')))
        widgets.append(self.__widgetFactory.buildWidget(
            self, self.__rootPolicy.getChildByName('variantSetName')))

        labelWidthList = []
        for w in widgets:
            if hasattr(w, "getLabelWidth"):
                labelWidthList.append(w.getLabelWidth())
        maxLabelWidth = reduce(max, labelWidthList)

        for w in widgets:
            if hasattr(w, "setLabelWidth"):
                w.setLabelWidth(maxLabelWidth)
            self.layout().addWidget(w)

        self.__writeButton = QtWidgets.QPushButton("Write", parent=self)
        self.__writeButton.clicked.connect(
            lambda checked : self.__groupNode.bake(parentWidget=self))
        self.layout().addWidget(self.__writeButton)