本文整理汇总了Python中maya.cmds.floatFieldGrp函数的典型用法代码示例。如果您正苦于以下问题:Python floatFieldGrp函数的具体用法?Python floatFieldGrp怎么用?Python floatFieldGrp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了floatFieldGrp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setPointValue
def setPointValue(FFG, point=''):
"""
Set the value of a floatFieldGrp with the position value of a specifeid point
@param FFG: FloatFieldgrp to set values for
@type FFG: str
@param point: Point to get position from
@type point: str
"""
# Check point
if point and not cmds.objExists(point):
raise Exception('Point object "' + point + '" does not exist!')
# Get object selection
sel = cmds.ls(sl=1)
if not point and not sel:
raise Exception('No point specified for floatFieldGrp values!')
# Get point
if point:
pos = glTools.utils.base.getPosition(point)
else:
pos = glTools.utils.base.getPosition(sel[0])
# Set float field values
cmds.floatFieldGrp(FFG, e=True, v1=pos[0], v2=pos[1], v3=pos[2])
开发者ID:bennymuller,项目名称:glTools,代码行数:25,代码来源:utils.py
示例2: doOptions
def doOptions(input_suffix, input_numberTwistJoints, input_elbowAimAxis, input_elbowFrontAxis, input_handFrontAxis):
"""Specifies the function called when the apply or create button is clicked"""
try:
# validate selection
selection = utils.dg.validateSelection(type='transform', name='wrist joint objects', min=1)
# validate suffix
suffix = cmds.textFieldGrp(input_suffix, q=True, tx=True)
utils.dg.validateAffix(suffix)
# set up the forearms
numberTwistJoints = cmds.intSliderGrp(input_numberTwistJoints, q=True, v=True)
newSelection = []
# perform setup for each wrist in the selection
for wrist in selection:
elbow = cmds.listRelatives(wrist, p=True, f=True)
elbowShort = cmds.listRelatives(wrist, p=True)
newJoints = doSetup(
elbowShort[0] + suffix,
numberTwistJoints,
wrist,
elbow[0],
cmds.floatFieldGrp(input_elbowAimAxis, q=True, v=True),
cmds.floatFieldGrp(input_elbowFrontAxis, q=True, v=True),
cmds.floatFieldGrp(input_handFrontAxis, q=True, v=True))
newSelection += newJoints
# select the newly created joints for easy editing
cmds.select(newSelection)
except: raise
开发者ID:0xb1dd1e,项目名称:PipelineConstructionSet,代码行数:29,代码来源:forearmSetup.py
示例3: extendUI
def extendUI(*args):
"""UI for the script"""
#UI
if cmds.window("curbWin", exists=True):
cmds.deleteUI("curbWin")
cmds.window("curbWin", t="zbw_polyExtender", w=200, h=200)
cmds.columnLayout("colLO")
cmds.frameLayout("topFrame", l="Covert Edge", cll=True, bgc=(.2,.2,.2))
cmds.text("Select poly edge to convert")
cmds.button("convertBut", l="Convert!", w=200, h=30, bgc=(.8, .8,.6), c=convertEdge)
cmds.separator(h=5)
cmds.setParent("colLO")
cmds.frameLayout("midFrame", l="Create Poly", cll=True, bgc=(.2,.2,.2))
cmds.text("Select curve")
cmds.separator(h=5)
cmds.textFieldGrp("name", l="Name", w=200, cw=[(1,30), (2,170)], tx="newPoly")
cmds.checkBox("curbCB", l="Positive Direction", v=True)
# cmds.checkBox("bumpCB", l="Add vertical hump?", v=True)
cmds.floatFieldGrp("curbFFG", l="Curb Width", cal=((1, "left"),(2,"left")), cw=([1,75],[2,50]), v1=10)
cmds.intFieldGrp("UDivIFG", l="Width Subdivisions", cal=((1, "left"),(2,"left")), cw=([1,75],[2,50]), v1=1)
cmds.intFieldGrp("VDivIFG", l="Length Subdivisions", cal=((1, "left"),(2,"left")), cw=([1,75],[2,50]), v1=1)
cmds.checkBox("polyHistory", l="Keep history on final poly?", v=False)
cmds.checkBox("history", l="Keep history objects?", v=True, cc=enableHistory)
cmds.separator(h=5)
cmds.button("curbBut", l="Create Curb", h=40, w=200, bgc=(.6, .8, .6), c=extendPoly)
cmds.showWindow("curbWin")
cmds.window("curbWin", e=True, h=150, w=200)
开发者ID:zethwillie,项目名称:zbw_python_tools,代码行数:32,代码来源:zbw_polyExtend.py
示例4: import2dTrackUI
def import2dTrackUI():
"""
"""
# Build UI Window
window = 'import2dTrackUI'
if cmds.window(window, q=True, ex=True): cmds.deleteUI(window)
window = cmds.window(window, title='Import 2D Track', wh=[500, 350])
# Build UI Elements
cmds.columnLayout(adjustableColumn=True)
perspCamListTSL = cmds.textScrollList('importTrack_camListTSL', numberOfRows=8, ams=False)
fileTFB = cmds.textFieldButtonGrp('importTrack_fileTFB', label='2D Track File', buttonLabel='Browse')
cmds.textFieldButtonGrp(fileTFB, e=True, bc='glTools.ui.utils.loadFilePath("' + fileTFB + '",fileFilter="*.*")')
cmds.textFieldGrp('importTrack_nameTFG', label="Point Name", text='trackPoint1')
cmds.floatFieldGrp('importTrack_widthFFG', numberOfFields=1, label='Source Pixel Width', value1=2348)
cmds.floatFieldGrp('importTrack_heightFFG', numberOfFields=1, label='Source Pixel Height', value1=1566)
cmds.button(label='Import Track',
c='import glTools.tools.import2dTrack;reload(glTools.tools.import2dTrack);glTools.tools.import2dTrack.import2dTrack()')
cmds.button(label='Close', c='cmds.deleteUI("' + window + '")')
# Build Camera List
camList = cmds.listCameras(p=True)
for cam in camList: cmds.textScrollList(perspCamListTSL, e=True, a=cam)
# Show Window
cmds.showWindow(window)
开发者ID:bennymuller,项目名称:glTools,代码行数:26,代码来源:import2dTrack.py
示例5: attachToCurveFromUI
def attachToCurveFromUI(close=False):
"""
Execute attachToCurve() from UI
"""
# Window
window = 'attachToCurveUI'
if not cmds.window(window, q=True, ex=1): raise UIError('AttachToCurve UI does not exist!!')
# Get UI data
curve = cmds.textFieldGrp('attachToCurveTFB', q=True, text=True)
transform = cmds.textFieldGrp('attachToCurveTransformTFB', q=True, text=True)
prefix = cmds.textFieldGrp('attachToCurvePrefixTFG', q=True, text=True)
closestPoint = cmds.checkBoxGrp('attachToCurveClosestPointCBG', q=True, v1=True)
param = cmds.floatSliderGrp('attachToCurveParamFSG', q=True, v=True)
paramAttr = cmds.textFieldGrp('attachToCurveParamAttrTFG', q=True, text=True)
orient = cmds.checkBoxGrp('attachToCurveOrientCBG', q=True, v1=True)
upVec = (cmds.floatFieldGrp('attachToCurveUpVecFFG', q=True, v1=True),
cmds.floatFieldGrp('attachToCurveUpVecFFG', q=True, v2=True),
cmds.floatFieldGrp('attachToCurveUpVecFFG', q=True, v3=True))
upVecObj = cmds.textFieldButtonGrp('attachToCurveUpVecObjTFG', q=True, text=True)
# Check curve
if not glTools.utils.curve.isCurve(curve):
raise UserInputError('Object "' + curve + '" is not a valid nurbs curve!!')
glTools.utils.attach.attachToCurve(curve=curve, transform=transform, uValue=param, useClosestPoint=closestPoint,
orient=orient, upVector=upVec, worldUpObject=upVecObj, uAttr=paramAttr,
prefix=prefix)
# Cleanup
if close: cmds.deleteUI(window)
开发者ID:bennymuller,项目名称:glTools,代码行数:27,代码来源:curve.py
示例6: addMirrorMeshCmd
def addMirrorMeshCmd(self, logicalIndex, *args ):
items = cmds.textScrollList( globalInfo.meshInfoInst._selMeshList, q=1, ai=1 )
if not items: return None
nodeName = amCmd.getBlendAndFixedShapeNode( items[0] )
targetName, driverInfo, returnIndex = amCmd.addMirrorTarget( items[0], logicalIndex )
cmds.setParent( self._scrollLay )
cmds.rowColumnLayout( nc=3, cw=[(1,25),(2,self._mainWidthList[0]-30),(3,self._mainWidthList[1]-30) ] )
cmds.button( l="X", c= partial( self.removeBlendMeshInfoElement, nodeName, logicalIndex ) )
meshNameField = cmds.textField( tx=targetName.replace( items[0]+'_', '' ), cc=partial( self.meshNameChangeCmd, nodeName, returnIndex ) )
self._meshNameList.append( meshNameField )
cmds.popupMenu( markingMenu = 1 )
cmds.menuItem( l='Edit Anim Curve', rp='W', c=partial( self.editAnimCurveCmd, nodeName, returnIndex ) )
cmds.menuItem( l='Edit Mesh',rp='N', c=partial( self.editAssigned, returnIndex) )
cmds.menuItem( l='Add Mirror Mesh',rp='E', c=partial( self.addMirrorMeshCmd, returnIndex) )
cmds.menuItem( l='Select Delta Points', rp='S', c=partial( self.selectDeltaPointsCmd, items[0], logicalIndex ) )
widthList = uifnc.setWidthByPerList( [50,50], self._mainWidthList[1] )
cmds.rowColumnLayout( nc=2, cw=[(1,widthList[0]),(2,widthList[1]-30)] )
for element in driverInfo:
engleName, value1, value2, value3= element
cmds.text( l= engleName )
cmds.floatFieldGrp( precision=2, nf=3, cw3=[50,50,50], v1=value1, v2=value2, v3=value3 )
cmds.setParent( '..' )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:26,代码来源:part3_editMesh.py
示例7: getSVFSsetting
def getSVFSsetting():
posX = 0
posY = 0
posZ = 0
if mc.checkBoxGrp("cBG_plus", q=True, value1=True):
posX = 1
elif mc.checkBoxGrp("cBG_minus", q=True, value1=True):
posX = -1
elif mc.checkBox("cB_Extra", q=True, value=True):
posX = mc.floatFieldGrp("fFG_Extra", q=True, value1=True)
if mc.checkBoxGrp("cBG_plus", q=True, value2=True):
posY = 1
elif mc.checkBoxGrp("cBG_minus", q=True, value2=True):
posY = -1
elif mc.checkBox("cB_Extra", q=True, value=True):
posY = mc.floatFieldGrp("fFG_Extra", q=True, value2=True)
if mc.checkBoxGrp("cBG_plus", q=True, value3=True):
posZ = 1
elif mc.checkBoxGrp("cBG_minus", q=True, value3=True):
posZ = -1
elif mc.checkBox("cB_Extra", q=True, value=True):
posZ = mc.floatFieldGrp("fFG_Extra", q=True, value3=True)
kmSelectVtxFromSide(mc.ls(sl=True, fl=True), [posX, posY, posZ])
return
开发者ID:smymc,项目名称:Maya-Python,代码行数:27,代码来源:kmSelectVtxFromSide.py
示例8: softDeformerUI
def softDeformerUI():
"""UI for the whole thing"""
if cmds.window("softModWin", exists = True):
cmds.deleteUI("softModWin")
widgets["window"] = cmds.window("softModWin", t="zbw_softDeformer", w=300, h=130)
widgets["tabLO"] = cmds.tabLayout()
widgets["smCLO"] = cmds.columnLayout("SoftModDeformer", w=300)
cmds.separator(h=10)
widgets["smdTFG"] = cmds.textFieldGrp(l="Deformer Name", w=300, cw=[(1,100),(2,190)], cal=[(1,"left"), (2, "left")], tx="softMod_DEF")
widgets["firstVertCBG"] = cmds.checkBoxGrp(l="Use only 1st vert (vs. avg pos)", v1=0, cw=[(1,200)], cal=[(1,"left"), (2,"left")])
widgets["parentCBG"] = cmds.checkBoxGrp(l="Parent Ctrl Under Geo?", v1=0, cw=[(1,200)], cal=[(1,"left"), (2,"left")])
widgets["incrCBG"] = cmds.checkBoxGrp(l="Increment name after creation?", v1=1, cw=[(1,200)], cal=[(1,"left"), (2,"left")])
widgets["checkCBG"] = cmds.checkBoxGrp(l="AutoCheck if there are deformers?", v1=1, cw=[(1,200)], cal=[(1,"left"), (2,"left")])
widgets["scaleFFG"] = cmds.floatFieldGrp(l="Control Scale", v1=1, pre=2, cw=[(1,100),(2,50)], cal=[(1,"left"),(2,"left")])
cmds.separator(h=10, style="single")
widgets["button"] = cmds.button(l="Create Deformer", w=300, h=40, bgc=(.6,.8,.6), c=softModDeformerDo)
#second tab to softselect deformer
cmds.setParent(widgets["tabLO"])
widgets["ssCLO"] = cmds.columnLayout("SoftSelectDeformer", w=300)
widgets["ssdTFG"] = cmds.textFieldGrp(l="Deformer Name", w=300, cw=[(1,100),(2,190)], cal=[(1,"left"), (2, "left")], tx="softSelect_DEF")
widgets["ssCPOMCBG"] = cmds.checkBoxGrp(l="Control to closest point on mesh?", v1=1, cw=[(1,200)], cal=[(1,"left"), (2,"left")])
widgets["ssParentCBG"] = cmds.checkBoxGrp(l="Parent Ctrl Under Geo?", v1=0, cw=[(1,200)], cal=[(1,"left"), (2,"left")])
widgets["ssIncrCBG"] = cmds.checkBoxGrp(l="Increment name after creation?", v1=1, cw=[(1,200)], cal=[(1,"left"), (2,"left")])
widgets["ssCheckCBG"] = cmds.checkBoxGrp(l="AutoCheck if there are deformers?", v1=1, cw=[(1,200)], cal=[(1,"left"), (2,"left")])
widgets["ssScaleFFG"] = cmds.floatFieldGrp(l="Control Scale", v1=1, pre=2, cw=[(1,100),(2,50)], cal=[(1,"left"),(2,"left")])
cmds.separator(h=10, style="single")
widgets["button"] = cmds.button(l="Create Deformer", w=300, h=40, bgc=(.6,.8,.6), c=softSelectDef)
cmds.showWindow(widgets["window"])
开发者ID:zethwillie,项目名称:zbw_python_tools,代码行数:34,代码来源:zbw_softDeformer.py
示例9: doOptions
def doOptions(input_width, input_divisionsType, input_divisions, input_divisionsPerUnit, input_taper, input_frontTwist, input_lengthTwist, input_upVector, input_uvScale, input_uvScaleType, input_uvPinLocation):
"""This is the function called when the apply or create button is clicked"""
try:
utils.dg.validateSelection(type='transform', min=1)
curves = utils.dg.getFilteredRelatives(cmds.ls(sl=True), 'nurbsCurve', False)
if len(curves) is 0: raise Exception('None of the objects you have selected are NURBS curves.')
# call the command
if cmds.radioButtonGrp(input_divisionsType, q=True, select=True) == 1:
cmds.am_ribbon(
width = cmds.floatSliderGrp(input_width, q=True, v=True),
divisions = cmds.floatSliderGrp(input_divisions, q=True, v=True),
taper = cmds.floatSliderGrp(input_taper, q=True, v=True),
twistBase = cmds.floatSliderGrp(input_frontTwist, q=True, v=True),
twistLength = cmds.floatSliderGrp(input_lengthTwist, q=True, v=True),
upVector = cmds.floatFieldGrp(input_upVector, q=True, v=True),
uvScale = cmds.floatSliderGrp(input_uvScale, q=True, v=True),
uvGroupScale = cmds.radioButtonGrp(input_uvScaleType, q=True, select=True) - 1,
uvPin = cmds.radioButtonGrp(input_uvPinLocation, q=True, select=True) - 1)
else:
cmds.am_ribbon(
width = cmds.floatSliderGrp(input_width, q=True, v=True),
divisionsPerUnit = cmds.floatSliderGrp(input_divisionsPerUnit, q=True, v=True),
taper = cmds.floatSliderGrp(input_taper, q=True, v=True),
twistBase = cmds.floatSliderGrp(input_frontTwist, q=True, v=True),
twistLength = cmds.floatSliderGrp(input_lengthTwist, q=True, v=True),
upVector = cmds.floatFieldGrp(input_upVector, q=True, v=True),
uvScale = cmds.floatSliderGrp(input_uvScale, q=True, v=True),
uvGroupScale = cmds.radioButtonGrp(input_uvScaleType, q=True, select=True) - 1,
uvPin = cmds.radioButtonGrp(input_uvPinLocation, q=True, select=True) - 1)
except: raise
开发者ID:0xb1dd1e,项目名称:PipelineConstructionSet,代码行数:31,代码来源:makeRibbons.py
示例10: prefPut
def prefPut(self):
cmds.checkBox(self.c2, e=True, v=self.prefs['BkRmvCon'])
cmds.checkBox(self.c3, e=True, v=self.prefs['BkTmRng'])
cmds.checkBox(self.c4, e=True, v=self.prefs['BkAllFrms'])
cmds.checkBox(self.c7, e=True, v=self.prefs['LocTrns'])
cmds.checkBox(self.c8, e=True, v=self.prefs['LocRot'])
cmds.checkBox(self.c12, e=True, v=self.prefs['LocAllFrms'])
cmds.checkBox(self.c17, e=True, v=self.prefs['PrntRgPosOnly'])
cmds.checkBox(self.c15, e=True, v=self.prefs['AimRgNegAim'])
cmds.radioButtonGrp(self.aimGrp, e=True, select=self.prefs['AimRgAim'])
cmds.checkBox(self.c16, e=True, v=self.prefs['AimRgNegUp'])
cmds.radioButtonGrp(self.upGrp, e=True, select=self.prefs['AimRgUp'])
cmds.checkBox(self.c18, e=True, v=self.prefs['PvtRgNegAim'])
cmds.radioButtonGrp(self.aimPivotGrp, e=True, select=self.prefs['PvtRgAim'])
cmds.checkBox(self.c19, e=True, v=self.prefs['PvtRgNegUp'])
cmds.radioButtonGrp(self.upPivotGrp, e=True, select=self.prefs['PvtRgUp'])
cmds.checkBox(self.c21, e=True, v=self.prefs['PvtRgMstr'])
cmds.radioButtonGrp(self.masterGrp, e=True, select=self.prefs['PvtRgMstrSl'])
cmds.radioButtonGrp(self.masterGrp, e=True, en=self.prefs['PvtRgMstrEnbl'])
cmds.checkBox(self.c22, e=True, v=self.prefs['PvtRgAutoDstnc'])
cmds.floatSliderGrp(self.sl1, e=True, v=self.prefs['PvtRgDstnc'])
cmds.floatSliderGrp(self.sl1, e=True, en=self.prefs['PvtRgDstncEnbl'])
cmds.checkBox(self.c21, e=True, v=self.prefs['LcAllFrms'])
cmds.checkBox(self.c5, e=True, v=self.prefs['PlcCon'])
cmds.radioButtonGrp(self.conGrp, e=True, select=self.prefs['PlcConTo'])
cmds.radioButtonGrp(self.conGrp, e=True, en=self.prefs['PlcConToEnbl'])
cmds.checkBox(self.c13, e=True, v=self.prefs['PlcMtchKys'])
cmds.checkBox(self.c9, e=True, v=self.prefs['ConOffst'])
cmds.checkBox(self.c10, e=True, v=self.prefs['ConTrns'])
cmds.checkBox(self.c11, e=True, v=self.prefs['ConRot'])
cmds.intField(self.actionField1, e=True, v=self.prefs['DstKys'])
cmds.checkBox(self.c14, e=True, v=self.prefs['DstKysDstrct'])
cmds.floatFieldGrp(self.floatGroup1, e=True, v=self.prefs['ObjctSpaceOffst'])
开发者ID:boochos,项目名称:work,代码行数:33,代码来源:constraintUI_micro_lib.py
示例11: doOptions
def doOptions(input_referenceObject, input_rotateOrder, input_axis, input_referenceAxis, input_normalizeAxes):
"""This is the function called when the apply or create button is clicked"""
try:
# validate selection
utils.dg.validateSelection(type='transform', exact=1)
# validate reference object
referenceObject = cmds.textFieldGrp(input_referenceObject, q=True, tx=True)
if len(referenceObject) > 0: utils.dg.verifyNode(referenceObject)
# call the command
if len(referenceObject) > 0:
cmds.am_exposeTransform(
ref=referenceObject,
ro=utils.kRotateOrderMapping[cmds.optionMenuGrp(input_rotateOrder, q=True, v=True)],
a=cmds.floatFieldGrp(input_axis, q=True, v=True),
ra=cmds.floatFieldGrp(input_referenceAxis, q=True, v=True),
na=cmds.checkBoxGrp(input_normalizeAxes, q=True, v1=True))
else:
cmds.am_exposeTransform(
ro=utils.kRotateOrderMapping[cmds.optionMenuGrp(input_rotateOrder, q=True, v=True)],
a=cmds.floatFieldGrp(input_axis, q=True, v=True),
ra=cmds.floatFieldGrp(input_referenceAxis, q=True, v=True),
na=cmds.checkBoxGrp(input_normalizeAxes, q=True, v1=True))
except: raise
开发者ID:0xb1dd1e,项目名称:PipelineConstructionSet,代码行数:25,代码来源:exposeTransform.py
示例12: doOptions
def doOptions(input_suffix, input_numberTwistJoints, input_pelvis, input_hipAimAxis, input_hipFrontAxis, input_pelvisAimAxis, input_pelvisFrontAxis):
"""Specifies the function called when the apply or create button is clicked"""
try:
# validate selection
selection = utils.dg.validateSelection(type='transform', name='knee joint objects', min=1)
# validate suffix
suffix = cmds.textFieldGrp(input_suffix, q=True, tx=True)
utils.dg.validateAffix(suffix)
# validate pelvis
pelvis = cmds.textFieldGrp(input_pelvis, q=True, tx=True)
utils.dg.verifyNode(pelvis)
# set up the hip
numberTwistJoints = cmds.intSliderGrp(input_numberTwistJoints, q=True, v=True)
newSelection = []
# perform setup for each knee in the selection
for knee in selection:
hip = cmds.listRelatives(knee, p=True, f=True)
hipShort = cmds.listRelatives(knee, p=True)
newJoints = doSetup(
hipShort[0] + suffix,
numberTwistJoints,
knee,
hip[0],
pelvis,
cmds.floatFieldGrp(input_hipAimAxis, q=True, v=True),
cmds.floatFieldGrp(input_hipFrontAxis, q=True, v=True),
cmds.floatFieldGrp(input_pelvisAimAxis, q=True, v=True),
cmds.floatFieldGrp(input_pelvisFrontAxis, q=True, v=True))
newSelection += newJoints
# select the newly created joints for easy editing
cmds.select(newSelection)
except: raise
开发者ID:0xb1dd1e,项目名称:PipelineConstructionSet,代码行数:35,代码来源:hipSetup.py
示例13: manualScale
def manualScale(*args):
"""uses the float field group to manually scale the object by that amount"""
origScale = cmds.floatFieldGrp(widgets["trackerFFG"], q=True, v1=True)
#get value from field
scalePer = cmds.floatFieldGrp(widgets["scaleFFG"] , q=True, v1=True)
scaleVal = scalePer/100
#scaleShapes
sel = cmds.ls(sl=True, type="transform")
if sel:
for obj in sel:
#decide on object type
objShape = cmds.listRelatives(obj, s=True)
shapeType = cmds.objectType(objShape)
cmds.select(cl=True)
if shapeType == "nurbsSurface" or shapeType == "nurbsCurve":
#get the components
cvs = cmds.select((obj + ".cv[*]"))
cmds.scale(scaleVal, scaleVal, scaleVal)
elif shapeType == "mesh":
#get the components
cvs = cmds.select((obj + ".vtx[*]"))
cmds.scale(scaleVal, scaleVal, scaleVal)
else:
cmds.warning("%s isn't a nurbs or poly object, so it was skipped")
#clear and reselect all
if sel:
cmds.select(cl=True)
cmds.select(sel)
newScale = origScale * scaleVal
cmds.floatFieldGrp(widgets["trackerFFG"], e=True, v1=newScale)
开发者ID:zethwillie,项目名称:zbw_python_tools,代码行数:33,代码来源:zbw_shapeScale.py
示例14: origScale
def origScale(*args):
"""scales the object by the inverse of the currentScale (as measured by the tracker floatfield). So if everything was reset when you started it will
undo all subsequent scaling operations"""
currScale = cmds.floatFieldGrp(widgets["trackerFFG"], q=True, v1=True)
scaleVal = 100/currScale
# print "%s = factor"%factor
# scaleVal = currScale * factor/100
cmds.floatFieldGrp(widgets["trackerFFG"], e=True, v1=scaleVal*currScale)
sel = cmds.ls(sl=True, type="transform")
if sel:
for obj in sel:
#decide on object type
objShape = cmds.listRelatives(obj, s=True)
shapeType = cmds.objectType(objShape)
cmds.select(cl=True)
if shapeType == "nurbsSurface" or shapeType == "nurbsCurve":
#get the components
cvs = cmds.select((obj + ".cv[*]"))
cmds.scale(scaleVal, scaleVal, scaleVal)
elif shapeType == "mesh":
#get the components
cvs = cmds.select((obj + ".vtx[*]"))
cmds.scale(scaleVal, scaleVal, scaleVal)
else:
cmds.warning("%s isn't a nurbs or poly object, so it was skipped")
#clear and reselect all
if sel:
cmds.select(cl=True)
cmds.select(sel)
cmds.floatFieldGrp(widgets["scaleFFG"], e=True, v1=scaleVal*100)
开发者ID:zethwillie,项目名称:zbw_python_tools,代码行数:34,代码来源:zbw_shapeScale.py
示例15: __init__
def __init__(self) :
#check to see if the window exists:
if cmds.window("Box2DTool", exists = True):
cmds.deleteUI("Box2DTool")
#create the window:
window = cmds.window("Box2DTool", title = 'Box2D Tool', sizeable = False)
#create the main layout:
cmds.columnLayout(columnWidth = 300, adjustableColumn = False, columnAttach = ('both', 10))
#make dockable:
allowedAreas = ['right', 'left']
cmds.dockControl( 'Box2D Tool', area='left', content=window, allowedArea=allowedAreas )
self.dim=cmds.floatFieldGrp('dim', numberOfFields=2, label='Dimension', extraLabel='pixel', value1=5, value2=1 )
self.dim=cmds.floatFieldGrp('friction', numberOfFields=1, label='Friction', value1=0.2 )
self.dim=cmds.floatFieldGrp('restitution', numberOfFields=1, label='restitution', value1=0.0 )
self.dim=cmds.floatFieldGrp('density', numberOfFields=1, label='density', value1=0.0 )
cmds.separator()
self.dim=cmds.floatFieldGrp('rotation', numberOfFields=1, label='rotation', value1=0.0 )
cmds.separator()
cmds.optionMenuGrp( "bodyType",l='Body Type' )
cmds.menuItem(label='b2_staticBody');
cmds.menuItem(label='b2_kinematicBody');
cmds.menuItem(label='b2_dynamicBody');
cmds.button(label = "PlaceBlock", w = 100, h = 25, c = self.placeBlock)
cmds.separator()
cmds.button( label='Export', command=self.export )
开发者ID:NCCA,项目名称:Box2DExport,代码行数:32,代码来源:Box2DTool.py
示例16: shapeScaleUI
def shapeScaleUI():
"""UI for the script"""
if (cmds.window("ssWin", exists=True)):
cmds.deleteUI("ssWin", window=True)
#cmds.winPref("shapeScaleWin", remove=True)
widgets["win"] = cmds.window("ssWin", t="zbw_shapeScale", w=400, h=75, s=False)
widgets["colLo"] = cmds.columnLayout("mainCLO", w=400, h=75)
widgets["formLO"] = cmds.formLayout(nd=100, w=400)
cmds.separator(h=10)
widgets["slider"] = cmds.floatSliderGrp("slider", f=False, l="Scale", min=0.01, max=2, pre=3, v=1, adj=3, cal=([1, "left"], [2, "left"], [3, "left"]), cw=([1, 50], [2,220]), cc= shapeScaleExecute)
cmds.separator(h=10)
widgets["scaleFFG"] = cmds.floatFieldGrp(v1=100, pre= 1, l="Scale %", en1=True, w=110, cw=([1,50],[2,50]), cal=([1,"left"], [2,"left"]))
widgets["scaleDoBut"] = cmds.button(l="Scale", w= 160, h=25, bgc=(.2,.4,.2), c=manualScale)
widgets["trackerFFG"] = cmds.floatFieldGrp(l="Change", w=100, v1=100, pre=1, en1=False, cw=([1,45],[2,50]), cal=([1,"left"], [2,"right"]), bgc=(.2,.2,.2))
widgets["clearBut"] = cmds.button(l="RESET", w=45, bgc=(.2,.2,.2), c=resetScale)
widgets["origBut"] = cmds.button(l="ORIG", w=45, bgc=(.2,.2,.2), c=origScale)
#attach to form layout
cmds.formLayout(widgets["formLO"], e=True, attachForm=[(widgets["slider"], 'top', 5), (widgets["slider"], 'left', 5)])
cmds.formLayout(widgets["formLO"], e=True, attachForm=[(widgets["scaleFFG"], 'top', 34), (widgets["scaleFFG"], 'left', 5)])
cmds.formLayout(widgets["formLO"], e=True, attachForm=[(widgets["scaleDoBut"], 'top', 34), (widgets["scaleDoBut"], 'left', 120)])
cmds.formLayout(widgets["formLO"], e=True, attachForm=[(widgets["clearBut"], 'top', 34), (widgets["clearBut"], 'left', 344)])
cmds.formLayout(widgets["formLO"], e=True, attachForm=[(widgets["trackerFFG"], 'top', 5), (widgets["trackerFFG"], 'left', 290)])
cmds.formLayout(widgets["formLO"], e=True, attachForm=[(widgets["origBut"], 'top', 34), (widgets["origBut"], 'left', 290)])
cmds.showWindow(widgets["win"])
cmds.window(widgets["win"], e=True, w=400, h=75)
开发者ID:zethwillie,项目名称:zbw_python_tools,代码行数:31,代码来源:zbw_shapeScale.py
示例17: setPlanes
def setPlanes(*args):
"""sets clipping planes for cameras based on float fields in UI. Depending on radio button, it will either do all camera or only selected"""
all = cmds.radioButtonGrp("camRBG", q=True, sl=True)
far = cmds.floatFieldGrp("farFFG", q=True, v1=True)
near = cmds.floatFieldGrp("nearFFG", q=True, v1=True)
cams = []
if all==1:
cams.extend(cmds.ls(type="camera"))
elif all==2:
transf = cmds.ls(sl=True, type="transform")
for each in transf:
shape = cmds.listRelatives(each, s=True)
if shape:
if cmds.objectType(shape) == "camera":
cams.extend(shape)
#for each, set shape.farClipPlane 100000
if cams:
print cams
for cam in cams:
try:
cmds.setAttr("%s.farClipPlane"%cam, far)
cmds.setAttr("%s.nearClipPlane"%cam, near)
except:
cmds.warning("Couldn't change the farClipPlane of %s"%cam)
开发者ID:zethwillie,项目名称:zbw_python_tools,代码行数:27,代码来源:zbw_setClipPlanes.py
示例18: addMultiAttr
def addMultiAttr():
#Create a variable for the window name
winName = 'blend'
winTitle = 'rh_addMultiAttr'
#Delete the window if it exists
if cmds.window(winName, exists=True):
cmds.deleteUI(winName, window=True)
#Build the main window
cmds.window(winName, title=winTitle, sizeable=True)
cmds.textFieldButtonGrp('Obj',label='Object :', text='', ed = False,buttonLabel='Load Sel',bc = 'sel()')
cmds.columnLayout(adjustableColumn=True)
cmds.textFieldGrp('Attr',l='Attribute:',text='')
cmds.columnLayout(adjustableColumn=True)
cmds.floatFieldGrp('minAttr', numberOfFields=1, label='Min Value', value1=0)
cmds.columnLayout(adjustableColumn=True)
cmds.floatFieldGrp('maxAttr', numberOfFields=1, label='Max Value', value1=0)
cmds.columnLayout(adjustableColumn=True)
cmds.button(label='Contact', command='Connect()')
cmds.columnLayout(adjustableColumn=True)
#Show the window
cmds.showWindow(winName)
cmds.window(winName, edit=True, width=300, height=120)
开发者ID:RyugasakiHu,项目名称:Maya-tools,代码行数:25,代码来源:rh_addMultiAttr.py
示例19: attachToSurfaceFromUI
def attachToSurfaceFromUI(close=True):
"""
Execute attachToSurface() from UI
@param close:
"""
# Window
window = 'attachToSurfaceUI'
if not cmds.window(window, q=True, ex=1): raise UIError('AttachToSurface UI does not exist!!')
# Get UI data
surf = cmds.textFieldGrp('attachToSurfaceTFB', q=True, text=True)
# Check surface
if not glTools.utils.surface.isSurface(surf):
raise UserInputError('Object "' + surf + '" is not a valid nurbs surface!!')
trans = cmds.textFieldGrp('attachToSurfaceTransformTFB', q=True, text=True)
pre = cmds.textFieldGrp('attachToSurfacePrefixTFG', q=True, text=True)
uParam = cmds.floatFieldGrp('attachToSurfaceParamTFB', q=True, v1=True)
vParam = cmds.floatFieldGrp('attachToSurfaceParamTFB', q=True, v2=True)
closePnt = cmds.checkBoxGrp('attachToSurfaceClosePntCBG', q=True, v1=True)
uAttr = cmds.textFieldGrp('attachToSurfaceUAttrTFG', q=True, text=True)
vAttr = cmds.textFieldGrp('attachToSurfaceVAttrTFG', q=True, text=True)
# Orient
orient = cmds.checkBoxGrp('attachToSurfaceOrientCBG', q=True, v1=True)
# Orient Options
tanU = str.lower(str(cmds.optionMenuGrp('attachToSurfaceUAxisOMG', q=True, v=True)))
tanV = str.lower(str(cmds.optionMenuGrp('attachToSurfaceVAxisOMG', q=True, v=True)))
align = str.lower(str(cmds.optionMenuGrp('attachToSurfaceAlignToOMG', q=True, v=True)))
# Execute command
result = glTools.utils.attach.attachToSurface(surface=surf, transform=trans, uValue=uParam, vValue=vParam,
useClosestPoint=closePnt, orient=orient, uAxis=tanU, vAxis=tanV,
uAttr=uAttr, vAttr=vAttr, alignTo=align, prefix=pre)
# Cleanup
if close: cmds.deleteUI(window)
开发者ID:bennymuller,项目名称:glTools,代码行数:34,代码来源:surface.py
示例20: ui
def ui():
'''
'''
# Window
window = 'transformDrivenBlendUI'
if mc.window(window,q=True,ex=1): mc.deleteUI(window)
window = mc.window(window,t='Transform Driven Blend')
# Layout
cl = mc.columnLayout()
# UI Elements
driveAttrTFG = mc.textFieldGrp('tdb_driveAttrTFG',label='Drive Attr', text='')
blendShapeTFG = mc.textFieldGrp('tdb_blendShapeTFG',label='BlendShape', text='')
target1TFG = mc.textFieldGrp('tdb_target1TFG',label='Target 1', text='',cc='glTools.ui.transformDrivenBlend.refreshUI()')
target2TFG = mc.textFieldGrp('tdb_target2TFG',label='Target 2', text='',cc='glTools.ui.transformDrivenBlend.refreshUI()')
weight1FFG = mc.floatFieldGrp('tdb_weight1FFG',numberOfFields=1,label='Weight 1',v1=1.0)
weight2FFG = mc.floatFieldGrp('tdb_weight2FFG',numberOfFields=1,label='Weight 2',v1=-1.0)
overlapFFG = mc.floatFieldGrp('tdb_overlapFFG',numberOfFields=1,label='Overlap',v1=0.0)
prefixTFG = mc.textFieldGrp('tdb_prefixTFG',label='Prefix', text='')
createB = mc.button('tdb_createB',label='Create',c='glTools.ui.transformDrivenBlend.executeFromUI()')
refreshB = mc.button('tdb_refreshB',label='Refresh',c='glTools.ui.transformDrivenBlend.refreshUI()')
cancelB = mc.button('tdb_cancelB',label='Cancel',c='mc.deleteUI('+window+')')
# Popup Menus
mc.popupMenu('tdb_blendShapePUM',p=blendShapeTFG)
mc.popupMenu('tdb_target1PUM',p=target1TFG)
mc.popupMenu('tdb_target2PUM',p=target2TFG)
mc.popupMenu('tdb_driveAttrPUM',p=driveAttrTFG)
mc.menuItem(label='Set from selected',c='glTools.ui.utils.loadChannelBoxSel("'+driveAttrTFG+'")')
# Show Window
refreshUI()
mc.showWindow(window)
开发者ID:auqeyjf,项目名称:glTools,代码行数:34,代码来源:transformDrivenBlend.py
注:本文中的maya.cmds.floatFieldGrp函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论