Ejemplo n.º 1
0
    def createTabletSettingsGroup(self, parent):
        group = self.createUIGroup(parent, 'Stylus Pressure')
        titledRow.create(group, title=None)
        self.controls.stylusPressureOnOff = CheckBoxField(
            self.VAR_PREFIX + 'stylusPressureOnOff',
            label="Use stylus pressure",
            annotation='Turn stylus pressure on/off',
            defaultValue=1)
        self.controls.stylusPressureOnOff.changeCommand.addHandler(
            self.configurePaintValues, ownerUI=parent)

        titledRow.createFixed(group, title="Pressure mapping")
        mode = DropDownField(self.VAR_PREFIX + 'stylesPressureMapping')
        mode.addOption("Opacity")
        mode.addOption("Radius")
        mode.addOption("Both")
        mode.changeCommand.addHandler(self.configurePaintValues,
                                      ownerUI=parent)
        self.controls.stylusPressureMode = mode
Ejemplo n.º 2
0
    def createUI(self, parent):

        group = self.mirrorOptionsGroup = uiGroup.create(
            parent, 'Influences Mapping')

        titledRow.createFixed(group, 'Position Tolerance')
        self.influenceDistanceError = FloatField(
            self.VAR_PREFIX + 'distanceError',
            minValue=0,
            maxValue=None,
            step=0.01,
            defaultValue=0.001,
            annotation=
            'Defines maximum inaccuracy between left and right influence positions'
        )

        self.influencePrefixSuffixSelector = InfluencePrefixSuffixSelector()
        self.influencePrefixSuffixSelector.createUI(group)
        titledRow.createFixed(group, None)

        cmds.button(label="Edit influence associations...",
                    command=self.showEditInfluencesWindow)
Ejemplo n.º 3
0
    def createUI(self, parent):
        group = self.rootGroup = uiGroup.create(parent, 'Vertex Mapping')
        titledRow.createFixed(group, 'Mirror Axis')
        self.mirrorAxis = DropDownField(self.VAR_PREFIX + 'mirrorAxis')
        self.mirrorAxis.setItems('X', 'Y', 'Z')
        self.mirrorAxis.changeCommand.addHandler(self.updateConfiguration,
                                                 parent)

        titledRow.create(parent=group, title="Mapping mode")
        cmds.columnLayout()
        self.transferMode = DropDownField(self.VAR_PREFIX +
                                          'vertexMirrorMappingMode')
        self.transferMode.setItems(*self.vertexTransferModes.keys())
        self.transferMode.changeCommand.addHandler(self.updateConfiguration,
                                                   parent)

        def update():
            mirrorAxis = selectionState.mirrorInfo.get()['axis']
            if mirrorAxis is not None:
                self.mirrorAxis.setValue(mirrorAxis.upper())

        selectionState.mirrorInfo.changed.addHandler(update, parent)

        update()
Ejemplo n.º 4
0
    def createUI(self, parent):
        group = self.mirrorOptionsGroup = uiGroup.create(
            parent, 'Mirroring Options')

        titledRow.createFixed(group, 'Mirror direction')
        self.mirrorDirection = DropDownField(self.VAR_PREFIX +
                                             'mirrorDirection')

        def getMirrorSideTexts():
            axis = selectionState.mirrorInfo.get()['axis']
            if axis is None:
                axis = 'x'
            return self.MIRROR_TEXTS[axis]

        def rebuildMirrorDirectionDropDown():
            self.mirrorDirection.beginRebuildItems()
            self.mirrorDirection.addOption(self.MIRROR_GUESS)
            for mirrorText in getMirrorSideTexts():
                self.mirrorDirection.addOption(mirrorText)
            self.mirrorDirection.addOption(self.MIRROR_FLIP)
            self.mirrorDirection.endRebuildItems()

        selectionState.mirrorInfo.changed.addHandler(
            rebuildMirrorDirectionDropDown, parent)

        def updateEnabled():
            data = LayerDataModel.getInstance()
            self.mirrorDq.setEnabled(data.layerDataAvailable
                                     and data.isDqMode())

        MayaEvents.nodeSelectionChanged.addHandler(updateEnabled, parent)

        titledRow.createFixed(group, 'Mirror Seam Width')
        self.mirrorWidth = FloatField(
            self.VAR_PREFIX + 'mirrorWidth',
            minValue=0,
            maxValue=None,
            step=1.0,
            defaultValue=0.1,
            annotation=
            'Defines width of the interpolation from left to right side on the model center line.'
        )
        cmds.setParent(group)
        titledRow.create(group, 'Elements')
        self.mirrorWeights = CheckBoxField(
            self.VAR_PREFIX + 'MirrorWeights',
            label="Mirror weights",
            annotation=
            'Check this if mirror operation should be mirroring weights',
            defaultValue=1)
        self.mirrorMask = CheckBoxField(
            self.VAR_PREFIX + 'MirrorMask',
            label="Mirror mask",
            annotation=
            'Check this if mirror operation should be mirroring layer mask',
            defaultValue=1)
        self.mirrorDq = CheckBoxField(
            self.VAR_PREFIX + 'MirrorDualQuaternion',
            label="Mirror dual quaternion weights",
            annotation=
            'Check this if mirror operation should be mirroring dual quaternion weights',
            defaultValue=1)

        LayerEvents.mirrorConfigurationChanged.addHandler(
            rebuildMirrorDirectionDropDown, parent)
        rebuildMirrorDirectionDropDown()
        updateEnabled()
Ejemplo n.º 5
0
 def createFixedTitledRow(parent, title):
     return titledRow.createFixed(parent, title)