本文整理汇总了Python中maya.cmds.radioButtonGrp函数的典型用法代码示例。如果您正苦于以下问题:Python radioButtonGrp函数的具体用法?Python radioButtonGrp怎么用?Python radioButtonGrp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了radioButtonGrp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeGUI
def makeGUI():
if cmds.window('CameraProject', ex=1, q=1):
cmds.deleteUI('CameraProject')
camProjWindow = cmds.window('CameraProject')
form = cmds.formLayout(numberOfDivisions=125)
b1 = cmds.radioButtonGrp('ButtonOne', label='Frame Type', labelArray2=['Animated', 'Specific Frame(s)'], numberOfRadioButtons=2)
b2 = cmds.radioButtonGrp('ButtonTwo', label='Material Type', labelArray2=['VRayLight', 'VRayMtl'], numberOfRadioButtons=2)
tf3 = cmds.textField('textField', width=200)
sepText = cmds.text(label = 'Separate frames by comma (limit 9)')
b3 = cmds.button(label='GO', width=100, command='cameraProject.actOnPress()')
########## Checks for ShotCam #############
if not cmds.objExists('*shotcam*'):
shotcamWarn = cmds.text(label = 'Could not find shotcam. Please import and re-run tool.', bgc = [1,0,0])
else:
shotcamWarn = cmds.text(label = 'Found shotcam', bgc = [0,1,0])
######## Checks for HDR #################
hdrExists = cmds.ls(type='VRayLightDomeShape')
if len(hdrExists) == 0:
hdrWarn = cmds.text(label = 'Could not find HDR. Please import and re-run tool', bgc = [1,0,0])
else:
hdrWarn = cmds.text('Found HDR', bgc = [0,1,0])
####### Loads VRay ##########################
if cmds.pluginInfo('vrayformaya', q=True, loaded=True) == False:
cmds.loadPlugin('vrayformaya', qt=True)
cmds.formLayout(form, edit=True, attachControl=[(b1, 'bottom', 5, b2), (tf3, 'left', 25, b1), (b2, 'bottom', 25, b3), (tf3, 'bottom', 5, sepText), (b3, 'bottom', 50, shotcamWarn), (shotcamWarn, 'bottom', 75, hdrWarn)], attachForm = [(b3, 'left', 500), (sepText, 'left', 410), (shotcamWarn, 'left', 25), (hdrWarn, 'left', 25)])
cmds.showWindow(camProjWindow)
示例2: uiSetFlags
def uiSetFlags(self):
'''
Gets the channel state data from the UI and then sets the flags.
'''
# Get channel state flag values
channelState = []
for attr in self.channel:
channelState.append(mc.radioButtonGrp('rbg'+attr.upper(),q=1,sl=1)-2)
# Get list of objects to set flags for
objType = mc.radioButtonGrp('rbgObjType',q=1,sl=1)
objectList = []
if objType == 1: objectList = mc.ls(sl=1)
elif objType == 2:
doit = mc.confirmDialog(title='Confirm Set Flags on ALL Transforms',
m='Are you sure you want to mass edit all the channel state attributes?',
button=('Yes','No'),
defaultButton='No',
cancelButton='No',
dismissString='NO')
if doit == 'No': return
objectList = mc.ls('*.channelState',o=True)
elif objType == 3:
selType = mc.textField('tfType',q=1,text=1)
objectList = mc.ls(type=selType)
# Set Flags
self.setFlags(channelState,objectList)
示例3: __init__
def __init__(self,*args):
if(cmds.window("rbbnChainBuilder",exists=True)):
cmds.deleteUI("rbbnChainBuilder",window=True)
cmds.window("rbbnChainBuilder",title="Build Ribbon Rig v1.0", rtf=True)
cmds.columnLayout()
self.prefixFld = cmds.textFieldGrp(label='Prefix',text='L_upLegRbbn_')
self.ribbonFld = cmds.textFieldButtonGrp( label="Ribbon:", buttonLabel="Load", bc = self.loadRibbon)#,text='main_plane' )
self.startFld = cmds.textFieldButtonGrp( label="Start Control:", buttonLabel="Load", bc = self.loadStart,text='cnt_1' )
self.endFld = cmds.textFieldButtonGrp( label="End Control:", buttonLabel="Load", bc = self.loadEnd,text='cnt_2' )
self.numFld = cmds.intFieldGrp(label='Controls:',nf=1,v1=5)
self.skinFld = cmds.intFieldGrp(label='Skin Joints:',nf=1,v1=5)
self.buildFld = cmds.radioButtonGrp(nrb=2,labelArray2=('U','V'),label='Build along:',sl=1)
cmds.frameLayout(label='Control Options: ',fn='boldLabelFont',cll=False)
cmds.columnLayout()
self.crvCreateFld = cmds.radioButtonGrp(nrb=2,labelArray2=('Yes','No'),label='Create bend-bo controls?',sl=1)
self.radFld = cmds.floatFieldGrp(label='Radius:',nf=1,v1=0.2)
self.crvNrFld = cmds.radioButtonGrp(nrb=3,labelArray3=('X','Y','Z'),label='Controller normal Axis:',sl=2)
cmds.setParent("..")
cmds.setParent("..")
cmds.rowLayout(nc=2,cw2=(200,100))
cmds.text(' ')
cmds.button(label = " Create", c = self.buildRig,w=100 )
cmds.setParent('..')
cmds.showWindow("rbbnChainBuilder")
示例4: projListWindow
def projListWindow(self, *args):
global projRoot
global pathTypeId
global projRootList
window = 'ProjectLoader'
cmds.deleteUI(window) if cmds.window(window, ex= 1) else None
cmds.window(window, t= window, s= 0)
cmds.columnLayout(adj= 1)
rdBtnLabel = ['Z :/', '//' + os.getenv('computername').lower() + '/', 'D :/']
cmds.radioButtonGrp('pathTypeRidBtn', l= 'Path Type : ', la3= rdBtnLabel, an1 = rdBtnLabel[0], an2= rdBtnLabel[1], an3 = rdBtnLabel[2], nrb= 3,cw4= [70, 40, 65, 50], sl= pathTypeId, cc= self.changePathType)
cmds.radioButtonGrp('workTypeRidBtn', l= 'Work Type : ', la2= ['1-scenes', '1-shots'], nrb= 2,cw3= [70, 70, 50], sl= workTypeId, cc= self.changeWorkType)
cmds.frameLayout('projListFrame', l= 'List', li= 106, w= 244)
cmds.columnLayout('projListColumn', adj= 1)
cmds.button('openPrjBtn', l= projRoot, w= 240, h= 25, bgc= [0.1, 0.5, 0.7], c= self.openProjFolder)
cmds.button('justForGapBtn1', l= '', h= 2, bgc= [.25,.25,.25], en= 0)
for i, p in reversed(list(enumerate(projRootList))):
if cmds.file(p, q= 1, ex= 1):
projRoot = p
pathTypeId = i + 1
mel.eval('radioButtonGrp -e -en' + str(i + 1) + ' 1 -sl ' + str(pathTypeId) + ' "pathTypeRidBtn";')
else:
mel.eval('radioButtonGrp -e -en' + str(i + 1) + ' 0 -sl ' + str(pathTypeId) + ' "pathTypeRidBtn";')
if projRoot:
self.refreshProjList()
else:
sorryStr = 'All project root path off-line.\n' + '\n'.join(projRootList)
cmds.confirmDialog( title='Sorry', message=sorryStr, button=['Confirm'], defaultButton='Confirm', icon= 'information')
cmds.window(window, e= 1, w= 10, h= 10)
cmds.showWindow(window)
示例5: mainModule
def mainModule(self):
cmds.rowColumnLayout(nc=2,cw =[(1,130),(2,285)]) #etchedOut rowlumnLayout.str#
cmds.frameLayout(label=self.moduleLabel,mw =1 ,mh =3,bs="etchedOut",cl= 0,cll=0 ,h=self.hgt)
cmds.symbolButton(h= 80,image= 'sphere.png' )
#cmds.rowColumnLayout( numberOfRows=1 ) #Side rowlumnLayout.str#
#cmds.setParent('..') #Side rowlumnLayout.end#
cmds.setParent('..') #etchedOut rowlumnLayout.end#
cmds.frameLayout(label='options:',mw =1 ,mh =3,bs="etchedOut",cl= 0,cll=0 ,h= self.hgt)
#optionsForm = cmds.formLayout()
cmds.rowColumnLayout(nc=5,cw =[(1,50),(2,50),(3,50),(4,50),(5,50)])
cmds.text(l='joint:')
cmds.text(l='fingers:')
cmds.text(l='no:')
cmds.text(l='segment:')
cmds.text(l='symmetry:')
cmds.textField()
cmds.checkBox(l ="" )
cmds.textField()
cmds.textField()
cmds.checkBox(l ="" )
#cmds.formLayout(optionsForm ,e=1,)
cmds.setParent('..')
cmds.rowColumnLayout( numberOfRows=1 )#Side: .str
cmds.text(l=' Side: ')
cmds.radioButtonGrp(nrb=2 ,la2=["L","R"] ,cw2=[30 ,30],sl =1)
cmds.scrollField(wordWrap =1,text ="creates arm skeleton template setup. ideal use: any arm Humans, Insects.." ,editable= 0,h=80,w=180)
cmds.setParent('..')##Side: .end
cmds.setParent('..')
cmds.setParent('..')
cmds.separator(height =3 ,style= "none" )
示例6: readUI
def readUI(self):
'''
This reads the UI elements and turns them into arguments saved in a kwargs style member variable
'''
if self.uiArgDict:
#this is some fanciness to read the values of UI elements and generate or run the resulting command
#keys represent the argument names, the values are UI elements
for k in self.uiArgDict.keys():
uiType = mc.objectTypeUI(self.uiArgDict[k])
value = None
if uiType == 'rowGroupLayout':
controls = mc.layout(self.uiArgDict[k], query=True, childArray=True)
if 'check1' in controls:
value = mc.checkBoxGrp(self.uiArgDict[k], query=True, value1=True)
elif 'radio1' in controls:
buttonNumber = mc.radioButtonGrp(self.uiArgDict[k], query=True, select=True)
#there should be a control for the label and each the buttons..I hope
labels = mc.radioButtonGrp(self.uiArgDict[k], query=True, **{'labelArray'+str(len(controls)-1):True})
value = labels[buttonNumber-1]
else:
OpenMaya.MGlobal.displayWarning('Cannot read '+uiType+' UI element: '+self.uiArgDict[k])
continue
self.kwargs[k] = value
示例7: enableCurve
def enableCurve(*args):
"""when hierarchy is selected, this enables the option for curves only """
val = cmds.radioButtonGrp(widgets["hierarchyRBG"], q=True, sl=True)
if val==2:
cmds.radioButtonGrp(widgets["curvesRBG"], e=True, en=True)
else:
cmds.radioButtonGrp(widgets["curvesRBG"], e=True, en=False)
示例8: setValue
def setValue(self, value):
if(self.rootUI is not None):
cmds.radioButtonGrp(self.axisRadio, edit=True, select=value.axis + 1)
cmds.checkBox(self.negativeCheck, edit=True, value=value.negative)
self.value = value
self.callChangeFunc()
示例9: tanUI
def tanUI(*args):
"""the UI for the clean/tangent functions"""
if cmds.window("tanWin", exists=True):
cmds.deleteUI("tanWin")
widgets["win"] = cmds.window("tanWin", t="zbw_tangents", w=300, h=160)
widgets["mainCLO"] = cmds.columnLayout()
# widgets["tabLO"] = cmds.tabLayout()
#tab for changing all tangent types
# cmds.setParent(widgets["tabLO"])
widgets["tangentCLO"] = cmds.columnLayout("Tangents")
#radioButtons for tangent type (step, linear, auto, spline)
widgets["tangentType"] = cmds.radioButtonGrp(nrb=4, l1="Step", l2="Linear", l3="Spline", l4="Auto", sl=1, cw=[(1,50),(2,50),(3,50),(4,50)])
#radio button group for all selected or for hierarchy under selected
widgets["tanHierRBG"] = cmds.radioButtonGrp(nrb=2, l1="Selected Objs Only", l2="Hierarchy Under Selected", sl=2, cc=enableSelect)
#radioButtons for time (timeslider, all anim, range)
widgets["tanTimeRBG"] = cmds.radioButtonGrp(nrb=3,l1="Timeslider", l2="All Anim", l3="Frame Range", sl=2, cw=[(1,100),(2,75),(3,75)],cc=partial(enableFR,"tanTimeRBG","tanFrameRangeIFG"))
#int field group for frame range
widgets["tanFrameRangeIFG"] = cmds.intFieldGrp(nf=2, l="Start/End", v1=1, v2=24, en=False, cal=[(1,"left"),(2,"left"),(3,"left")], cw=[(1,75),(2,75),(3,75)])
#radioButtons for curves only or for all DAG objects
widgets["tanCurvesRBG"] = cmds.radioButtonGrp(nrb=2, l1="Curves/Volume Primatives Only", l2="All DAG", sl=1, cw=[(1, 190),(2, 110)])
cmds.separator(h=10)
#Button for executing the change
#button to SELECT those objects rather than change the tangents
widgets["buttonRCLO"] = cmds.rowColumnLayout(w=300, nc=2, cw=[(1,200),(2,100)])
widgets["tanBut"] = cmds.button(l="Change Tangent Type!", w=200, h=40, bgc=(.6,.6,.8), c=changeTan)
widgets["selectBut"] = cmds.button(l="Select \nHierarchy", w=100, h=40, bgc=(.8,.6,.6), c=selectHier)
cmds.showWindow(widgets["win"])
cmds.window(widgets["win"], e=True, w=300, h=160)
示例10: 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
示例11: makeGUI
def makeGUI():
if cmds.window('VRayAtrributeAssigner', ex=1, q=1):
cmds.deleteUI('VRayAttributeAssigner')
vrayAttrAssignWindow = cmds.window('VRayAttributeAssigner')
form = cmds.formLayout()
RB1 = cmds.radioButtonGrp('ButtonOne', label='Assign to objects ', labelArray2=['By Selection', 'By Keyword'], numberOfRadioButtons=2, of2 = 'cmds.textField("keyIn", enable=0, edit=True)', on2 = 'cmds.textField("keyIn", enable=1, edit=True)', cw3 = [150, 100, 50])
getButtonState = cmds.radioButtonGrp('ButtonOne', q=True, sl=True)
keyText = cmds.text(label = 'Keyword')
keyInput = cmds.textField('keyIn', width = 200, enable=0)
debugButton = cmds.button(label='DEBUG', width=50, command='debugButton()')
IDcheckBox = cmds.checkBox('IDCheck', label = 'Object ID', ofc = 'cmds.textField("IDIn", enable=0, edit=True)\ncmds.checkBox("IDRemove", value=0, enable=0, edit=True)', onc = 'cmds.textField("IDIn", enable=1, edit=True)\ncmds.checkBox("IDRemove", enable=1, edit=True)' )
IDRemoveBox = cmds.checkBox('IDRemove', label = 'Remove', en=False, onc = 'cmds.textField("IDIn", enable=0, edit=True)', ofc = 'cmds.textField("IDIn", enable=1, edit=True)')
IDText = cmds.text(label = 'Object ID #')
IDInput = cmds.textField('IDIn', tx = '0', width = 50, enable=0)
UAcheckBox = cmds.checkBox('UACheck', label = 'User Attributes', ofc = 'cmds.textField("UAIn", enable=0, edit=True)\ncmds.checkBox("UARemove", value = 0, enable=0, edit=True)', onc = 'cmds.textField("UAIn", enable=1, edit=True)\ncmds.checkBox("UARemove", enable=1, edit=True)')
UARemoveBox = cmds.checkBox('UARemove', label = 'Remove', en=False, onc = 'cmds.textField("UAIn", enable=0, edit=True)', ofc = 'cmds.textField("UAIn", enable=1, edit=True)')
UAText = cmds.text(label = 'UserAttributes')
UAInput = cmds.textField('UAIn', width = 500, enable=0)
DOIT = cmds.button(label='DO IT!', width=100, command='actOnPress()')
cmds.formLayout(form, edit=True, attachForm = [(RB1, 'left', 0), (RB1, 'top', 10), (keyText, 'top', 35), (keyText, 'left', 100), (keyInput, 'top', 30), (keyInput, 'left', 150), (debugButton, 'top', 30), (debugButton, 'left', 360), (IDcheckBox, 'top', 75), (IDcheckBox, 'left', 25), (IDRemoveBox, 'top', 75), (IDRemoveBox, 'left', 100), (IDText, 'left', 15), (IDText, 'top', 100), (IDInput, 'left', 80), (IDInput, 'top', 95), (UAcheckBox, 'top', 135), (UAcheckBox, 'left', 25), (UARemoveBox, 'top', 135), (UARemoveBox, 'left', 125), (UAText, 'left', 15), (UAText, 'top', 165), (UAInput, 'left', 100), (UAInput, 'top', 160), (DOIT, 'left', 500), (DOIT, 'top', 200)])
cmds.showWindow(vrayAttrAssignWindow)
示例12: jointOrientRefreshUI_aimAxis
def jointOrientRefreshUI_aimAxis():
'''
Refresh Aim Axis list based on Primary Axis selection.
'''
labelIndex = mc.radioButtonGrp('jointOrientPrimAxisRBG',q=True,sl=True)
labelArray = [('Y','Z'),('X','Z'),('X','Y')]
mc.radioButtonGrp('jointOrientAimAxisRBG',e=True,la2=labelArray[labelIndex-1])
示例13: __init__
def __init__(self):
### Initialize, definitions
if(mc.window("ms_orientJoint",exists=True)):
mc.deleteUI("ms_orientJoint",window=True)
mc.window("ms_orientJoint",title="Orient Joint v1.0",rtf=True)
mc.columnLayout()
mc.rowLayout(nc=2)
mc.text(" ")
mc.text("Orient joint A to joint B")
mc.setParent("..")
mc.separator(w=500)
self.aimAxisField = mc.radioButtonGrp(label="Aim Axis",labelArray3=['x','y','z'],nrb=3,sl = 1)
self.aimAxisPolField = mc.radioButtonGrp(label="Aim Axis Polarity",labelArray2=['+','-'],nrb=2,sl = 1)
self.upAxisField = mc.radioButtonGrp(label="Up Axis",labelArray3=['x','y','z'],nrb=3,sl = 2)
self.upPolarityField = mc.radioButtonGrp(label="Up Axis Polarity",labelArray2=['+','-'],nrb=2,sl=1)
mc.separator(w=500)
mc.rowLayout(nc=3)
mc.text(" ")
mc.button(label="-=Orient=-",c=self.orient)
mc.button(label="-=None Orient=-",c=self.noneOrient)
mc.setParent("..")
mc.showWindow("ms_orientJoint")
示例14: setEnabled
def setEnabled(self, enabled):
if(self.rootUI is not None):
if(enabled):
cmds.radioButtonGrp(self.axisRadio, edit=True, enable=True)
cmds.checkBox(self.negativeCheck, edit=True, enable=True)
else:
cmds.radioButtonGrp(self.axisRadio, edit=True, enable=False)
cmds.checkBox(self.negativeCheck, edit=True, enable=False)
示例15: cmdAimRig
def cmdAimRig(self, *args):
ar = web.mod('animRig_lib')
axs = [None, [1, 0, 0], [0, 1, 0], [0, 0, 1]]
inverseA = cmds.checkBox(self.actionColumn.c15, q=True, v=True)
aimGp = cmds.radioButtonGrp(self.actionColumn.aimGrp, q=True, select=True)
inverseU = cmds.checkBox(self.actionColumn.c16, q=True, v=True)
upGp = cmds.radioButtonGrp(self.actionColumn.upGrp, q=True, select=True)
ar.aimRig(target=None, obj=None, aim=axs[aimGp], u=axs[upGp], tipOffset=1.0, mo=False, bake=True, inverseA=inverseA, inverseU=inverseU)