当前位置: 首页>>代码示例>>Python>>正文


Python cmds.floatField方法代码示例

本文整理汇总了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) 
开发者ID:TomohikoMukai,项目名称:ssds,代码行数:21,代码来源:mlSSDS.py

示例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)) 
开发者ID:nilouco,项目名称:dpAutoRigSystem,代码行数:6,代码来源:dpLayoutClass.py

示例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) 
开发者ID:Clemson-DPA,项目名称:dpa-pipe,代码行数:30,代码来源:playblast.py

示例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) 
开发者ID:Clemson-DPA,项目名称:dpa-pipe,代码行数:5,代码来源:playblast.py

示例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) 
开发者ID:Clemson-DPA,项目名称:dpa-pipe,代码行数:9,代码来源:playblast.py

示例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) 
开发者ID:chadmv,项目名称:cmt,代码行数:6,代码来源:orientjoints.py

示例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) 
开发者ID:chadmv,项目名称:cmt,代码行数:6,代码来源:orientjoints.py

示例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) 
开发者ID:chadmv,项目名称:cmt,代码行数:6,代码来源:orientjoints.py

示例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) 
开发者ID:nilouco,项目名称:dpAutoRigSystem,代码行数:63,代码来源:dpLayoutClass.py

示例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) 
开发者ID:TomohikoMukai,项目名称:ssds,代码行数:63,代码来源:mlSSDS.py


注:本文中的maya.cmds.floatField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。