Esempio n. 1
0
    def createPrecisionControlGroup(self, layout):
        group = self.createUIGroup(layout, "Intensity/Precision Control")

        self.createTitledRow(group, "Intensity preset")
        self.controls.intensitySlider = IntensitySlider(
            'Drag slider to quickly set "number of steps" and "step size" aproximatelly corresponding to low or high relax intensity values',
            self.VAR_RELAX_PREFIX + 'relaxIntensity', 0.5)
        self.controls.intensitySlider.changeCommand.addHandler(
            self.intensitySliderPreset)
        self.controls.intensitySlider.create()

        self.createFixedTitledRow(group, 'Number of steps')
        self.controls.numSteps = IntField(
            self.VAR_RELAX_PREFIX + 'NumSteps',
            minValue=1,
            maxValue=1000,
            step=1,
            defaultValue=30,
            annotation=
            'Defines amount of times to repeat relax procedure. Recommended: 20 - 50'
        )

        self.createFixedTitledRow(group, 'Step size')
        self.controls.stepSize = FloatField(
            self.VAR_RELAX_PREFIX + 'StepSize',
            minValue=0,
            maxValue=1,
            step=0.001,
            defaultValue=0.15,
            annotation=
            'Defines a slight amount of relax applied with each step (0 - 1.0). Recommended: 0.02 - 0.15'
        )
Esempio n. 2
0
    def createMakeUnifyGroup(self, layout):
        group = self.createUIGroup(layout, 'Unify Weights')

        self.controls.rigidIntensity = IntensitySlider(
            'amount of effect to apply', self.VAR_RIGID_PREFIX + 'Intensity')
        self.createTitledRow(
            group,
            "Intensity",
            innerContentConstructor=self.controls.rigidIntensity.create)

        row = self.createFixedTitledRow(group, "Clustering")
        self.controls.chkSingleClusterMode = CheckBoxField(
            self.VAR_RIGID_PREFIX + "singleClusterMode",
            "Ignore separate shells or selection gaps", False,
            "When selected, whole selection is treated as one vertex cluster, regardless if vertices "
            + " are in different shells or selection is not contiguous")

        self.controls.rigidSoftSelection = SoftSelectionRow(
            self.VAR_RIGID_PREFIX + 'softSelection')
        self.controls.rigidSoftSelection.create(group)

        cmds.setParent(group)

        cmds.rowLayout(nc=2,
                       adjustableColumn=2,
                       columnWidth2=[Constants.BUTTON_WIDTH_SMALL, 50],
                       columnAttach2=["both", "both"],
                       columnAlign2=["center", "center"])
        BaseTab.createHelpButton(
            SkinToolsDocs.ASSIGNWEIGHTS_MAKERIGID_INTERFACE)
        cmds.button(height=Constants.BUTTON_HEIGHT,
                    label='Assign',
                    command=lambda *args: self.execUnifyWeights())

        cmds.setParent(layout)
Esempio n. 3
0
    def createClosestJointGroup(self,layout):
        group = self.createUIGroup(layout,"Assign Weights From Closest Joint")
        # influence chooser group
        influenceFiltersForm = cmds.formLayout(parent=group)
        l = cmds.text(label='Influences to choose from: ')
        cmds.formLayout(influenceFiltersForm,e=True,attachForm=[(l,'left',0),(l,'top',0)],attachNone=[(l,'bottom'),(l,'right')])
        radios = cmds.columnLayout();
        cmds.radioCollection()
        cmds.formLayout(influenceFiltersForm,e=True,attachForm=[(radios,'left',Constants.MARGIN_BLOCK_INDENT),(radios,'right',0),(radios,'bottom',0)],attachControl=[(radios,'top',0,l)])
        RadioButtonField(self.VAR_CJ_PREFIX+'useAllInfluences',defaultValue=1,label='All influences available in skin cluster',
                         annotation='Use all influences present in skin cluster for closest joint  search')
        
        self.controls.rdioUseListerInfluences = RadioButtonField(self.VAR_CJ_PREFIX+'useSelectedInfluences',
                        defaultValue=0,label='Selected influences in lister',
                        annotation='Use only those influences that are selected in "List Influences" tab')
        
        cmds.setParent(group)
        
        self.controls.cjIntensity = IntensitySlider(
                'amount of effect to apply',
                self.VAR_CJ_PREFIX+'Intensity')
        self.createTitledRow(group, "Intensity",innerContentConstructor=self.controls.cjIntensity.create)
        
        self.controls.cjSoftSelection = SoftSelectionRow(self.VAR_CJ_PREFIX+'softSelection')
        self.controls.cjSoftSelection.create(group)

        cmds.setParent(group)
        cmds.rowLayout(nc=2,adjustableColumn=2,columnWidth2=[Constants.BUTTON_WIDTH_SMALL,50], columnAttach2=["both","both"],columnAlign2=["center","center"])
        BaseTab.createHelpButton(SkinToolsDocs.ASSIGNWEIGHTS_CLOSESTJOINT_INTERFACE)
        cmds.button(height=Constants.BUTTON_HEIGHT,label='Assign',command=lambda *args:self.execClosestJointAssign())
        cmds.setParent(layout)
Esempio n. 4
0
    def createLimitWeightsGroup(self, layout):
        group = self.createUIGroup(layout, 'Limit Weights')

        cmds.rowLayout(parent=group,
                       nc=2,
                       columnWidth2=[
                           Constants.MARGIN_COLUMN2,
                           Constants.NUMBER_FIELD_WIDTH
                       ],
                       columnAttach2=["both", "both"],
                       columnAlign2=["right", "left"])
        cmds.text(label='Max Limit: ')
        self.controls.limitWeightsMaxInfluences = IntField(
            self.VAR_LW_PREFIX + 'maxInfluences',
            minValue=1,
            maxValue=1000,
            step=1,
            defaultValue=3,
            annotation='Maximum amount of influences per vertex')

        self.controls.limitWeightsIntensity = IntensitySlider(
            'amount of effect to apply', self.VAR_LW_PREFIX + 'Intensity')
        self.createTitledRow(
            group,
            "Intensity",
            innerContentConstructor=self.controls.limitWeightsIntensity.create)

        self.controls.limitWeightsSoftSelection = SoftSelectionRow(
            self.VAR_LW_PREFIX + 'softSelection')
        self.controls.limitWeightsSoftSelection.create(group)

        cmds.setParent(group)

        cmds.rowLayout(nc=2,
                       adjustableColumn=2,
                       columnWidth2=[Constants.BUTTON_WIDTH_SMALL, 50],
                       columnAttach2=["both", "both"],
                       columnAlign2=["center", "center"])
        BaseTab.createHelpButton(
            SkinToolsDocs.ASSIGNWEIGHTS_LIMITWEIGHTS_INTERFACE)
        cmds.button(height=Constants.BUTTON_HEIGHT,
                    label='Assign',
                    command=lambda *args: self.execLimitWeights())

        cmds.setParent(layout)