Python maya.cmds.floatField() Examples
The following are 10
code examples of maya.cmds.floatField().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
maya.cmds
, or try the search function
.
Example #1
Source File: mlSSDS.py From ssds with MIT License | 6 votes |
def invokeBuild(arg): maxInfluence = cmds.intField(uiMaxInfluenceName[1], query = True, value = True) numJoints = cmds.intField(uiNumJointsName[1], query = True, value = True) numIterations = cmds.intField(uiNumIterationsName[1], query = True, value = True) transformStr = cmds.radioCollection(uiTransformRadioCollectionName, query = True, select = True) transformType = uiTransformNames.index(transformStr) concentrate = cmds.floatField(uiConcentrateName[1], query = True, value = True) cmds.undoInfo(openChunk = True) try: ssds.build(numJoints = numJoints, transformType = transformType, numMaxInfluences = maxInfluence, numIterations = numIterations, concentrate = concentrate) except Exception as e: raise e finally: cmds.undoInfo(closeChunk = True)
Example #2
Source File: dpLayoutClass.py From dpAutoRigSystem with GNU General Public License v2.0 | 5 votes |
def changeShapeSize(self, *args): """ Set the attribute value for shapeSize. """ cmds.setAttr(self.moduleGrp+".shapeSize", cmds.floatField(self.shapeSizeFF, query=True, value=True))
Example #3
Source File: playblast.py From dpa-pipe with MIT License | 5 votes |
def floatUI(): # Check to see if window exists if cmds.window("PBQuality", exists=True): cmds.deleteUI("PBQuality") # Create window window = cmds.window("PBQuality", title="DPA Playblast", w=300, h=100, mnb=False, mxb=False, sizeable=False) # Create a main layout mainLayout = cmds.columnLayout(adj=True) blastLayout = cmds.columnLayout("blastLayout", p=mainLayout, w=260, adj=False, rs=5, cat=('left', 5)) cmds.separator(p=blastLayout) cmds.text(label="Enter desired playbast quality:", p=blastLayout) qualityField = cmds.floatField("playblastValue", p=blastLayout, w=250, min=50, max=100, pre=0, step=1, v=90, ed=True) qualitySlider = cmds.floatSlider("playblastPercentage", p=blastLayout, w=250, min=50, max=100, step=1, v=90, dc=updatePercent) cmds.separator(p=blastLayout) sequenceOption = cmds.checkBox("sequenceOption", label="From Sequence", value=False) reviewOption = cmds.checkBox("reviewOption", label="Auto-bot review submission", value=False) cmds.separator(p=blastLayout) confirmLayout = cmds.rowColumnLayout("confirmLayout", p=mainLayout, w=250, nc=2, rs=(5, 5), co=[(1, 'left', 5), (2, 'right', 5)], cw=[(1, 125), (2, 125)]) cancelButton = cmds.button("cancelButton", p=confirmLayout, label="Cancel", c="cmds.deleteUI('PBQuality')", w=80, h=30) pbButton = cmds.button("pbButton", p=confirmLayout, label="Playblast", c=handlePB, w=100, h=30) cmds.separator(p=confirmLayout) cmds.showWindow(window)
Example #4
Source File: playblast.py From dpa-pipe with MIT License | 5 votes |
def updatePercent(*args): percent = cmds.floatSlider("playblastPercentage", q=True, v=True) cmds.floatField("playblastValue", e=True, v=percent)
Example #5
Source File: playblast.py From dpa-pipe with MIT License | 5 votes |
def handlePB(*args): percent = cmds.floatField("playblastValue", q=True, v=True) #check to see if sequence option is selected seqTag = cmds.checkBox("sequenceOption", query=True, value =True) #check for auto review submission revTag = cmds.checkBox("reviewOption", query=True, value =True) runPB(percent, seqTag, revTag)
Example #6
Source File: orientjoints.py From cmt with MIT License | 5 votes |
def offset_orient_x(self, direction): joints = cmds.ls(sl=True, type="joint") or [] amount = cmds.floatField(self.offset_x, q=True, value=True) * direction offset_orient(joints, amount, Axis.x)
Example #7
Source File: orientjoints.py From cmt with MIT License | 5 votes |
def offset_orient_y(self, direction): joints = cmds.ls(sl=True, type="joint") or [] amount = cmds.floatField(self.offset_y, q=True, value=True) * direction offset_orient(joints, amount, Axis.y)
Example #8
Source File: orientjoints.py From cmt with MIT License | 5 votes |
def offset_orient_z(self, direction): joints = cmds.ls(sl=True, type="joint") or [] amount = cmds.floatField(self.offset_z, q=True, value=True) * direction offset_orient(joints, amount, Axis.z)
Example #9
Source File: dpLayoutClass.py From dpAutoRigSystem with GNU General Public License v2.0 | 4 votes |
def basicModuleLayout(self, *args): """ Create a Basic Module Layout. """ # BASIC MODULE LAYOUT: self.basicColumn = cmds.rowLayout(numberOfColumns=5, width=190, columnWidth5=(30, 20, 80, 20, 35), adjustableColumn=3, columnAlign=[(1, 'left'), (2, 'left'), (3, 'left'), (4, 'left'), (5, 'left')], columnAttach=[(1, 'both', 2), (2, 'both', 2), (3, 'both', 2), (4, 'both', 2), (5, 'both', 2)], parent=self.topColumn) # create basic module UI: self.selectButton = cmds.button(label=" ", annotation=self.langDic[self.langName]['m004_select'], command=partial(self.reCreateEditSelectedModuleLayout, True), backgroundColor=(0.5, 0.5, 0.5), parent=self.basicColumn) self.annotationCheckBox = cmds.checkBox(label=" ", annotation=self.langDic[self.langName]['m014_annotation'], onCommand=partial(self.displayAnnotation, 1), offCommand=partial(self.displayAnnotation, 0), value=0, parent=self.basicColumn) self.userName = cmds.textField('userName', annotation=self.langDic[self.langName]['m006_customName'], text=cmds.getAttr(self.moduleGrp+".customName"), changeCommand=self.editUserName, parent=self.basicColumn) self.colorButton = cmds.button(label=" ", annotation=self.langDic[self.langName]['m013_color'], command=self.colorizeModuleUI, backgroundColor=(0.5, 0.5, 0.5), parent=self.basicColumn) shapeSizeValue = cmds.getAttr(self.moduleGrp+'.shapeSize') self.shapeSizeFF = cmds.floatField('shapeSizeFF', annotation=self.langDic[self.langName]['m067_shapeSize'], minValue=0.001, value=shapeSizeValue, precision=2, step=0.01, changeCommand=self.changeShapeSize, parent=self.basicColumn) # edit values reading from guide: displayAnnotationValue = cmds.getAttr(self.moduleGrp+'.displayAnnotation') cmds.checkBox(self.annotationCheckBox, edit=True, value=displayAnnotationValue) # declaring the index color list to override and background color of buttons: # Manually add the "none" color self.colorList = [[0.627, 0.627, 0.627]] #WARNING --> color index in maya start to 1 self.colorList += [cmds.colorIndex(iColor, q=True) for iColor in range(1,32)] ''' self.colorList = [ [0.627, 0.627, 0.627], [0, 0, 0], [0.247, 0.247, 0.247], [0.498, 0.498, 0.498], [0.608, 0, 0.157], [0, 0.016, 0.373], [0, 0, 1], [0, 0.275, 0.094], [0.145, 0, 0.263], [0.780, 0, 0.78], [0.537, 0.278, 0.2], [0.243, 0.133, 0.122], [0.600, 0.145, 0], [1, 0, 0], [0, 1, 0], [0, 0.255, 0.6], [1, 1, 1], [1, 1, 0], [0.388, 0.863, 1], [0.263, 1, 0.635], [1, 0.686, 0.686], [0.890, 0.675, 0.475], [1, 1, 0.384], [0, 0.6, 0.325], [0.627, 0.412, 0.188], [0.620, 0.627, 0.188], [0.408, 0.627, 0.188], [0.188, 0.627, 0.365], [0.188, 0.627, 0.627], [0.188, 0.404, 0.627], [0.435, 0.188, 0.627], [0.627, 0.188, 0.412] ] ''' # edit current colorIndex: currentIndexColor = cmds.getAttr(self.moduleGrp+'.guideColor') self.setColorModule(currentIndexColor) self.reCreateEditSelectedModuleLayout(self)
Example #10
Source File: mlSSDS.py From ssds with MIT License | 4 votes |
def showBuildWindow(arg): labelWidth = 100 fieldWidth = 100 cmds.window(uiWindowName, title = 'SSDS') cmds.formLayout(uiFormName) cmds.columnLayout(uiFormLayoutName, rowSpacing = 5) # joints cmds.rowLayout(uiNumJointsName[0], numberOfColumns = 2, columnWidth2 = (labelWidth, fieldWidth), columnAlign2 = ('right', 'right')) cmds.text(label = '# Joints') cmds.intField(uiNumJointsName[1], minValue = 0, maxValue = 100, value = 1, width = fieldWidth) cmds.setParent('..') # max influences cmds.rowLayout(uiMaxInfluenceName[0], numberOfColumns = 2, columnWidth2 = (labelWidth, fieldWidth), columnAlign2 = ('right', 'right')) cmds.text(label = 'Max Influences') cmds.intField(uiMaxInfluenceName[1], minValue = 1, maxValue = 8, value = 4, width = fieldWidth) cmds.setParent('..') # iterations cmds.rowLayout(uiNumIterationsName[0], numberOfColumns = 2, columnWidth2 = (labelWidth, fieldWidth), columnAlign2 = ('right', 'right')) cmds.text(label = '# Iterations') cmds.intField(uiNumIterationsName[1], minValue = 0, maxValue = 100, value = 10, width = fieldWidth) cmds.setParent('..') # transform type cmds.rowLayout('SsdsTransformTypeLayout', numberOfColumns = 2, columnWidth2 = (labelWidth, fieldWidth), columnAlign2 = ('right', 'right')) cmds.text(label = 'Transform Type') cmds.columnLayout('temporary', rowSpacing = 3) cmds.radioCollection(uiTransformRadioCollectionName) cmds.radioButton(uiTransformNames[0], label = 'T') cmds.radioButton(uiTransformNames[1], label = 'R+T') cmds.radioButton(uiTransformNames[2], label = 'S+R+T') cmds.radioCollection(uiTransformRadioCollectionName, edit = True, select = uiTransformNames[2]) cmds.setParent(uiFormLayoutName) # concentrate cmds.rowLayout(uiConcentrateName[0], numberOfColumns = 2, columnWidth2 = (labelWidth, fieldWidth), columnAlign2 = ('right', 'right')) cmds.text(label = 'Concentrate') cmds.floatField(uiConcentrateName[1], minValue = 0, maxValue = 100, value = 0.0, precision = 3, width = fieldWidth) cmds.setParent('..') # build cmds.button(uiBuildButtonName, label='Build', command = invokeBuild, width = labelWidth + fieldWidth) cmds.formLayout(uiFormName, edit = True, attachForm = [(uiFormLayoutName, 'top', 5), (uiFormLayoutName, 'left', 5), (uiFormLayoutName, 'right', 5)]) cmds.showWindow(uiWindowName)