本文整理匯總了Python中maya.cmds.floatField方法的典型用法代碼示例。如果您正苦於以下問題:Python cmds.floatField方法的具體用法?Python cmds.floatField怎麽用?Python cmds.floatField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類maya.cmds
的用法示例。
在下文中一共展示了cmds.floatField方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: invokeBuild
# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import floatField [as 別名]
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)
示例2: changeShapeSize
# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import floatField [as 別名]
def changeShapeSize(self, *args):
""" Set the attribute value for shapeSize.
"""
cmds.setAttr(self.moduleGrp+".shapeSize", cmds.floatField(self.shapeSizeFF, query=True, value=True))
示例3: floatUI
# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import floatField [as 別名]
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)
示例4: updatePercent
# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import floatField [as 別名]
def updatePercent(*args):
percent = cmds.floatSlider("playblastPercentage", q=True, v=True)
cmds.floatField("playblastValue", e=True, v=percent)
示例5: handlePB
# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import floatField [as 別名]
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)
示例6: offset_orient_x
# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import floatField [as 別名]
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)
示例7: offset_orient_y
# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import floatField [as 別名]
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)
示例8: offset_orient_z
# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import floatField [as 別名]
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)
示例9: basicModuleLayout
# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import floatField [as 別名]
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)
示例10: showBuildWindow
# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import floatField [as 別名]
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)