本文整理汇总了Python中maya.cmds.confirmDialog函数的典型用法代码示例。如果您正苦于以下问题:Python confirmDialog函数的具体用法?Python confirmDialog怎么用?Python confirmDialog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了confirmDialog函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: dynamicChainCmd
def dynamicChainCmd(*args):
'''
Get information and create dynamic joint chain network
'''
from time import gmtime, strftime
verified = True
log = ""
# get the selected joints
joints = cmds.ls(sl=True)
if len(joints) != 2:
log += "- Need to select the start joint and the end joint\n"
verified = False
if verified:
# create class instance
dynChain = lpDynamicChain(joints[0], joints[1])
# create the dynamic network
nodes = dynChain.create()
if nodes:
dateTime = strftime("%a, %b %d %Y - %X", gmtime())
nodesString = ""
# build string for feedback
for i,node in enumerate(nodes):
nodesString += "%d. %s\n" % (i,node)
cmds.confirmDialog(messageAlign="left", title="lpDynamicChains", message="%s\n------------------\n\nNew dynamic nodes:\n\n%s\n\nThank you!" % (dateTime, nodesString), button=["Accept"], defaultButton="Accept")
# select the custom node last
cmds.select(dynChain.mNode)
else:
cmds.confirmDialog(messageAlign="left", title="lpDynamicChains", message="Log:\n" + log, button=["Accept"], defaultButton="Accept")
开发者ID:Mortaciunea,项目名称:bdScripts,代码行数:34,代码来源:lpDynamicChains.py
示例2: run
def run(parent):
"""requires amTinyTools"""
try:
import amTinyTools
amTinyTools.Menu.menuSelect(parent)
except ImportError:
cmds.confirmDialog(m="this module requires amTinyTools")
开发者ID:DavideAlidosi,项目名称:May9,代码行数:7,代码来源:amTinyToolsSelect.py
示例3: checkout
def checkout(self):
curfilepath = cmd.file(query=True, sceneName=True)
if not curfilepath == '':
cmd.file(save=True, force=True)
toCheckout = self.get_asset_path()
try:
destpath = amu.checkout(toCheckout, True)
except Exception as e:
print str(e)
if not amu.checkedOutByMe(toCheckout):
cmd.confirmDialog( title = 'Can Not Checkout'
, message = str(e)
, button = ['Ok']
, defaultButton = 'Ok'
, cancelButton = 'Ok'
, dismissString = 'Ok')
return
else:
destpath = amu.getCheckoutDest(toCheckout)
toOpen = os.path.join(destpath, self.get_filename(toCheckout)+'.mb')
# open the file
if os.path.exists(toOpen):
cmd.file(toOpen, force=True, open=True)#, loadReferenceDepth="none")
else:
# create new file
cmd.file(force=True, new=True)
cmd.file(rename=toOpen)
cmd.file(save=True, force=True)
self.close_dialog()
开发者ID:andrewRasmussen,项目名称:ramshorn-tools,代码行数:33,代码来源:maya_checkout.py
示例4: saveFileToPublish
def saveFileToPublish(self):
self.currentFilePath = cmds.file(q=1, sn=1)
if self.currentFilePath:
if '/work/' in self.currentFilePath:
self.baseName = os.path.basename(self.currentFilePath)
self.publishPath = self.currentFilePath.split(self.baseName)[0].replace('/work/', '/publish/')
self.publishFilePath = os.path.join(self.publishPath, self.baseName)
if os.listdir(self.publishPath):
fileName = sorted(os.listdir(self.publishPath))[-1].replace('.ma', '.mb')
newPublishFilePath = os.path.join(self.publishPath, fileName)
curVersion = os.path.splitext(fileName)[0].split('.v')[-1]
newVersion = int(curVersion) + 1
newVersionStr = '.v%03d' % newVersion
self.publishFilePath = newPublishFilePath.replace('.v%03d' % int(curVersion), newVersionStr)
cmds.file(f=1, save=1)
cmds.file(rename=self.publishFilePath)
cmds.file(f=1, save=1, type = 'mayaBinary')
cmds.file(self.currentFilePath, f=1, open=1)
return self.publishFilePath
else:
fileName = self.baseName.replace('.ma', '.mb')
newPublishFilePath = os.path.join(self.publishPath, fileName)
self.publishFilePath = newPublishFilePath
cmds.file(f=1, save=1)
cmds.file(rename=self.publishFilePath)
cmds.file(f=1, save=1, type = 'mayaBinary')
cmds.file(self.currentFilePath, f=1, open=1)
return self.publishFilePath
else:
cmds.confirmDialog(m="File is not in work directory.. Kindly save your file in work directory and run this script", b="Ok")
else:
cmds.warning('Cannot find proper file. Please save our file and proceed....')
开发者ID:vipul-rathod,项目名称:AppleTree,代码行数:32,代码来源:fxPublishOffline.py
示例5: getSelection
def getSelection(self):
rootNodes = cmds.ls(sl=True, type='transform')
if rootNodes is None or len(rootNodes) < 1:
cmds.confirmDialog(t='Error', b=['OK'],
m='Please select one or more transform nodes.')
return None
else: return rootNodes
开发者ID:chuckbruno,项目名称:Python_scripts,代码行数:7,代码来源:poseMachine_03.py
示例6: mkIngestionDir
def mkIngestionDir(source,type):
mkFile = source
filename =source.split("/")
filename = filename[-1]
mkSource =source.split("/")
mkSource = mkSource[-1]
mkSource = mkSource.replace( type, "" )
mkFolder =source.split("/")
mkFolder.pop(-1)
mkFolder = "/".join(mkFolder)
mkFolder=mkFolder+"/"+mkSource
if os.path.exists( mkFolder ) == False:
os.makedirs( mkFolder )
copycmd = 'sysFile -copy'+' '+'"'+mkFolder+'/'+ filename +'"'+' ' + '"'+ mkFile+'"'+';'
mel.eval (copycmd)
dst = "Q:/Tools/Nearline/ingestion/3dModels"
delcmd = 'sysFile -delete'+' "'+mkFile+'";'
mel.eval (delcmd)
createdirCmd = 'sysFile -makeDir'+' '+'"'+dst+'/' +mkSource+'/"'
mel.eval(createdirCmd)
cpyDepotCmd = 'sysFile -mov'+' '+'"'+dst+'/' +mkSource+'/'+filename +'"'+' ' + '"'+mkFolder+'/'+ filename +'"'+';'
mel.eval (cpyDepotCmd)
print "copied "+filename+" to depot"
removeEmptydir = 'sysFile -removeEmptyDir'+' '+'"'+mkFolder+'/";'
mel.eval (removeEmptydir)
cmds.confirmDialog(m=filename+" ready for upload", cb = "cancel")
return mkFolder
开发者ID:ghost3d,项目名称:MayaTools,代码行数:27,代码来源:mkSaveToDepotVray.py
示例7: exportRig
def exportRig(self):
""" will export SH and Geo found in the geo folder """
# rig and geo should not be referenced
# find SH, delete constraints, parent to world
# find geo folder parent to world
# select SH and geo folder and export as fbx to fbx folder
pymelLogger.debug( 'Starting rig export' )
export = 0
for rig in self.rootList:
if cmds.objExists(rig):
# check if geo folder also exists
if cmds.objExists(self.geo):
self._delConstraints(rig)
cmds.parent(rig, w=1)
cmds.parent(self.geo, w=1)
cmds.select(rig,self.geo, r=1)
#print rig, self.geo
if self._fbxExport( 2 ):
cmds.confirmDialog(m='FBX Rig Exported', button='Ok')
pymelLogger.debug( 'Finished rig export' )
export = 1
break
else:
pymelLogger.error( 'No geo folder has been found' )
if export == 0 : pymelLogger.error( 'No Rig Exported. Note: Referenced Rigs Will Not Export' )
开发者ID:Mauricio3000,项目名称:MSH_Maya,代码行数:25,代码来源:Export.py
示例8: cacheFluidsToCTemp
def cacheFluidsToCTemp():
if cmds.objExists(CONST.FOAM_FLUID_SHAPENODE) and cmds.objExists(CONST.WAKE_FLUID_SHAPENODE):
## Get default non-cached wake and foam
fluidsToCache = []
for cache in [CONST.FOAM_FLUID_SHAPENODE, CONST.WAKE_FLUID_SHAPENODE]:
fluidConnection = cmds.listConnections(cache, type = 'cacheFile') or cmds.listConnections(cache, type = 'cacheBlend')
if fluidConnection:
if cmds.nodeType(fluidConnection[0]) == 'cacheFile' or cmds.nodeType(fluidConnection[0]) == 'cacheBlend':
cmds.confirmDialog(title = 'CACHE FLUIDS', message = 'Cache already exist for "%s". You should cleanup your caches if you want to re-cache a newer one!' % cache, button = 'OK')
else:
fluidsToCache.append(cache)
else:
fluidsToCache.append(cache)
## Cache em fluids at one go to save time
if fluidsToCache:
cachePath = _getPathFromSceneName()
if cachePath:
if os.path.exists(cachePath):
_cacheWake(cachepath = cachePath, fluids = fluidsToCache)
## Set time to min
[cmds.currentTime( cmds.playbackOptions(q = True, min = True) ) for x in range(2)]
else:
cmds.confirmDialog(title = 'CACHE FLUIDS', message = 'Both "%s" and "%s" fluids don\'t exist in your scene!' % (CONST.FOAM_FLUID_SHAPENODE, CONST.WAKE_FLUID_SHAPENODE), button = 'OK')
开发者ID:vipul-rathod,项目名称:lsapipeline,代码行数:25,代码来源:fluidCaches.py
示例9: GetGroupName
def GetGroupName(self):
#Check to see if the name is saved with the file
if cmds.objExists("CMSettings"):
ScenePrepClass.GroupName = cmds.getAttr("CMSettings.ModelName")
if cmds.objExists(ScenePrepClass.GroupName):
print "Group name from save"
return 1
#Check to see if the model is already grouped then use that name#
if self.SelectedObjectsAreGrouped() != "":
if cmds.textField("NameTextField",query = True, text = True) != "":
#Rename the group if a name has been provided
cmds.rename(ScenePrepClass.GroupName, cmds.textField("NameTextField",query = True, text = True))
#Replace the name in cursel
for x in range(len(ScenePrepClass.Cursel)):
if ScenePrepClass.Cursel[x] == ScenePrepClass.GroupName:
ScenePrepClass.Cursel[x] = cmds.textField("NameTextField",query = True, text = True)
#
ScenePrepClass.GroupName = cmds.textField("NameTextField",query = True, text = True)
print "Group name from model"
return 1
#otherwise check the textfield
if cmds.textField("NameTextField",query = True, text = True) != "":
ScenePrepClass.GroupName = cmds.textField("NameTextField",query = True, text = True)
print "Group name from field"
if ScenePrepClass.GroupName == "":
cmds.confirmDialog(m = "Please enter a name for the model")
return 0
开发者ID:Kif11,项目名称:turbosquid_maya_publisher,代码行数:30,代码来源:ScenePrepFile.py
示例10: runTestCases
def runTestCases( testCases=TEST_CASES ):
thisPath = Path( __file__ ).up()
testResults = TestResult()
for ATestCase in testCases:
testCase = ATestCase()
testCase.run( testResults )
#force a new scene
cmd.file( new=True, f=True )
OK = 'Ok'
BUTTONS = (OK,)
if testResults.errors:
print '------------- THE FOLLOWING ERRORS OCCURRED -------------'
for error in testResults.errors:
print error[0]
print error[1]
print '--------------------------'
cmd.confirmDialog( t='TEST ERRORS OCCURRED!', m='Errors occurred running the tests - see the script editor for details!', b=BUTTONS, db=OK )
else:
print '------------- %d TESTS WERE RUN SUCCESSFULLY -------------' % len( testCases )
cmd.confirmDialog( t='SUCCESS!', m='All tests were successful!', b=BUTTONS, db=OK )
return testResults
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:26,代码来源:devTest.py
示例11: creatStereo
def creatStereo():
camL = mc.ls(sl=1)
if camL == []:
mc.confirmDialog(title="Missing", message="Please select a camera!", button=["Ok"])
return
cam = camL[0]
camShape = mc.listRelatives(cam, s=1)[0]
FL = mc.camera(cam, q=1, fl=1)
NCP = mc.camera(cam, q=1, ncp=1)
FCP = mc.camera(cam, q=1, fcp=1)
cam3d = maya.app.stereo.stereoCameraRig.createStereoCameraRig()
mc.parent(cam3d[0], cam)
mc.setAttr(cam3d[0] + ".translate", 0, 0, 0, lock=1)
mc.setAttr(cam3d[0] + ".rotate", 0, 0, 0, lock=1)
mc.setAttr(cam3d[0] + ".scale", 1, 1, 1, lock=1)
cam3dShape = mc.listRelatives(cam3d[0], s=1)[0]
mc.connectControl("interaxialSleder", stereoShape + ".interaxialSeparation")
mc.connectControl("zeroSleder", stereoShape + ".zeroParallax")
mc.setAttr(cam3dShape + ".focalLength", FL)
mc.setAttr(cam3dShape + ".nearClipPlane", NCP)
mc.setAttr(cam3dShape + ".farClipPlane", FCP)
mc.setAttr(cam3dShape + ".zeroParallaxPlane", 1)
mc.setAttr(cam3dShape + ".safeViewingVolume", 1)
for i in cam3d:
mc.rename(i, cam + "_" + i)
camListStereo = mc.ls(type="stereoRigTransform")
if camListStereo == []:
mc.floatSliderGrp(interaxialSleder, e=1, enable=False)
mc.floatSliderGrp(zeroSleder, e=1, enable=False)
else:
stereoShape = mc.listRelatives(camListStereo[0], s=1)[0]
mc.floatSliderGrp(interaxialSleder, e=1, enable=True)
mc.floatSliderGrp(zeroSleder, e=1, enable=True)
mc.connectControl(interaxialSleder, cam3dShape + ".interaxialSeparation")
mc.connectControl(zeroSleder, cam3dShape + ".zeroParallax")
开发者ID:chuckbruno,项目名称:Python_scripts,代码行数:35,代码来源:stereoPlayblast_new_01.py
示例12: Pose_rtn
def Pose_rtn(name,*args):
lst=mc.ls(sl=1)
if lst==[]:
mc.confirmDialog (title='About' ,message= 'Nothing is selected',ma='center', button=['OK'] ,defaultButton='Yes')
else:
files=open(name,'r')
nextLine=files.readline()
sel_obj = mc.ls(sl=1)
char = sel_obj[0].split(':')
while (len( nextLine ) > 0 ):
splitter= nextLine.split(' ')
if splitter[0]=='obj':
obj_name= splitter[1].strip()
else:
attr = splitter[0]
value= splitter[1].strip()
if len(char)==1:
added=char[0]+ "." + attr
else:
added= (char[0] + ":" + obj_name + "." + attr)
setA = "mc.setAttr('"+added+"',"+ value+')'
try:
eval(setA)
except RuntimeError:
pass
nextLine=files.readline()
files.close()
print "Pose changed"
开发者ID:sid2364,项目名称:Maya_Python,代码行数:28,代码来源:SR_AnimPoseLib.py
示例13: deletetab
def deletetab(*args):
alltabs = mc.tabLayout ('tabs',q=1,st=1)
chktabs = mc.tabLayout ('Animation',q=1,st=1)
chktabs1= mc.tabLayout ('Poses',q=1,st=1)
if alltabs == 'Animation':
seltab = mc.tabLayout('Animation',q=1,st=1)
mc.deleteUI(seltab)
Del_tab=savepathini+'Savepose/Animation/'+seltab
Del1_in=Del_tab+'/'
list_in=mc.getFileList(fld=Del1_in)
for i in range(len(list_in)):
mc.sysFile(Del1_in+'/'+list_in[i],delete=1)
mc.sysFile(Del_tab,red=1)
if chktabs=='':
mc.confirmDialog (title='Error',message='No tabs to delete', button='OK',defaultButton='Yes')
# else :
# return
else :
seltab = mc.tabLayout('Poses',q=1,st=1)
mc.deleteUI(seltab)
Del_tab=savepathini+'Savepose/Poses/'+seltab
Del1_in=Del_tab+'/'
list_in=mc.getFileList(fld=Del1_in)
for i in range(len(list_in)):
mc.sysFile(Del1_in+'/'+list_in[i],delete=1)
mc.sysFile(Del_tab,red=1)
if chktabs1=='':
mc.confirmDialog (title='Error',message='No tabs to delete', button='OK',defaultButton='Yes')
else :
return
开发者ID:sid2364,项目名称:Maya_Python,代码行数:30,代码来源:SR_AnimPoseLib.py
示例14: Newtab
def Newtab(*args):
sel_tab = mc.shelfTabLayout('tabs',q=1,st=1)
crnt_tab= mc.shelfTabLayout(sel_tab,q=1,ca=1)
Newtab = mc.promptDialog(
title='Create New Tab',
message='New Tab Name:',
button=['OK', 'Cancel'],
defaultButton='OK',
cancelButton='Cancel',
dismissString='Cancel')
if Newtab == 'OK':
n_text = mc.promptDialog(query=True, text=True)
if n_text == '':
mc.confirmDialog (title='Error' ,message= 'Sorry, The name entered is not valid', button=['OK'] ,defaultButton='Yes')
else:
if crnt_tab:
for each in crnt_tab:
if each == n_text:
mc.confirmDialog (title='Error' ,message= 'Sorry, The name entered is already exists', button=['OK'] ,defaultButton='Yes')
return
#else:
if sel_tab == 'Animation':
Nw_tab=savepathini+'Savepose/Animation/'+n_text+'/'
mc.shelfLayout(n_text,w=450,h=200,bgc=(0.3,0.3,0.3),p=Animation)
mc.sysFile(Nw_tab, makeDir=True )
else:
mc.shelfLayout(n_text,w=450,h=200,bgc=(0.3,0.3,0.3),p=Poses)
Nw_tab=savepathini+'Savepose/Poses/'+n_text+'/'
mc.sysFile(Nw_tab, makeDir=True )
mc.shelfTabLayout(sel_tab,e=1,st=n_text)
开发者ID:sid2364,项目名称:Maya_Python,代码行数:31,代码来源:SR_AnimPoseLib.py
示例15: drawError
def drawError(self,errormsg=""):
""" Draw a error message dialog
@type errormsg: string
@param errormsg: the messag to display
"""
cmds.confirmDialog(title='ERROR:', message=errormsg, button=['OK'],
defaultButton='OK')
开发者ID:gj210,项目名称:upy,代码行数:7,代码来源:mayaUI.py
示例16: CreateHydraulicRig
def CreateHydraulicRig(upDir, *args):
selection = cmds.ls(sl=True)
if len(selection) != 3:
cmds.confirmDialog(icon = "warning!!", title = "Hydraulic Rig Tool", message = "You must select exactly 3 objects. Top of hydraulic, bottom of hydraulic, and the up vector.")
return
else:
hyd_start_01_anim = selection[0]
hyd_start_02_anim = selection[1]
upObject = selection[2]
hyd_start_01 = hyd_start_01_anim.rpartition("_")[0]
hyd_start_02 = hyd_start_02_anim.rpartition("_")[0]
# Create a rig for the lower arm extra hydraulic piston.
cmds.delete("driver_"+hyd_start_01+"_parentConstraint1")
robo_lowarm_pistonrod_01_anim_sub = cmds.group(em=True, name=hyd_start_01_anim+"_sub", parent=hyd_start_01_anim)
const = cmds.parentConstraint(hyd_start_01_anim, robo_lowarm_pistonrod_01_anim_sub, weight=1, mo=False)
cmds.delete(const)
const = cmds.parentConstraint(robo_lowarm_pistonrod_01_anim_sub, "driver_"+hyd_start_01, weight=1, mo=True)
cmds.delete("driver_"+hyd_start_02+"_parentConstraint1")
robo_lowarm_pistonrod_02_anim_sub = cmds.group(em=True, name=hyd_start_02_anim+"_sub", parent=hyd_start_02_anim)
const = cmds.parentConstraint(hyd_start_02_anim, robo_lowarm_pistonrod_02_anim_sub, weight=1, mo=False)
cmds.delete(const)
const = cmds.parentConstraint(robo_lowarm_pistonrod_02_anim_sub, "driver_"+hyd_start_02, weight=1, mo=True)
# Hook up the hydraulics for the lowerarm piston.
const1 = cmds.aimConstraint(robo_lowarm_pistonrod_01_anim_sub, robo_lowarm_pistonrod_02_anim_sub, weight=1, mo=True, aimVector=(-1, 0, 0), upVector=(0, 0, upDir), worldUpType="object", worldUpVector=(0, 0, -1), worldUpObject=upObject)
const2 = cmds.aimConstraint(robo_lowarm_pistonrod_02_anim_sub, robo_lowarm_pistonrod_01_anim_sub, weight=1, mo=True, aimVector=(1, 0, 0), upVector=(0, 0, upDir), worldUpType="object", worldUpVector=(0, 0, -1), worldUpObject=upObject)
cmds.select(const1, const2)
开发者ID:AndyHuang7601,项目名称:EpicGames-UnrealEngine,代码行数:32,代码来源:ART_CreateHydraulicRigs.py
示例17: __init__
def __init__(self) :
# get the currently selected objects and make sure we have only one object
selected = OM.MSelectionList()
OM.MGlobal.getActiveSelectionList(selected)
self.selectedObjects = []
selected.getSelectionStrings(self.selectedObjects)
if len(self.selectedObjects) == 0 :
cmds.confirmDialog( title='No objects Selected', message='Select a Mesh Object', button=['Ok'], defaultButton='Ok', cancelButton='Ok', dismissString='Ok' )
elif len(self.selectedObjects) > 1 :
cmds.confirmDialog( title='Select One Object', message='Only One Mesh mat be exported at a time', button=['Ok'], defaultButton='Ok', cancelButton='Ok', dismissString='Ok' )
# now we have the correct criteria we can proceed with the export
else :
# get the start and end values for our UI sliders
anim=OMA.MAnimControl()
minTime=anim.minTime()
maxTime=anim.maxTime()
self.m_start=int(minTime.value())
self.m_end=int(maxTime.value())
# now we create a window ready to populate the components
self.m_window = cmds.window( title='NCCA Pointbake Export' )
# create a layout
cmds.columnLayout()
# create two sliders for start and end we also attach methods to be called when the slider
# changes
self.m_startSlider=cmds.intSliderGrp( changeCommand=self.startChanged,field=True, label='Start Frame', minValue=self.m_start, maxValue=self.m_end, fieldMinValue=self.m_start, fieldMaxValue=self.m_end, value=self.m_start )
self.m_endSlider=cmds.intSliderGrp( changeCommand=self.endChanged ,field=True, label='End Frame', minValue=self.m_start, maxValue=self.m_end, fieldMinValue=self.m_end, fieldMaxValue=self.m_end, value=self.m_end )
# create a button and add the method called when pressed
cmds.button( label='Export', command=self.export )
# finally show the window
cmds.showWindow( self.m_window )
开发者ID:NCCA,项目名称:NGL6Demos,代码行数:30,代码来源:NCCAPointBakeMayaExport.py
示例18: _createParentMaster
def _createParentMaster(obj, translation=True, rotation=True):
'''Crea i gruppi necessari per utilizzare il parent master.'''
# creo il parent handle e lo snap group dell'oggetto (aventi stesso pivot)
# un file referenziato genera eccezione
if cmds.referenceQuery(obj, inr=True) and (not ALLOW_REFERENCE_ROOT or cmds.listRelatives(obj, p=True)):
sys.stdout.write('Read-only hierarchy detected\n')
msg = 'Are you working with referenced files?\n\nZVPM can\'t group "%s" because it\'s in a read-only hierarchy.\n\n\nDo the following:\n\n- Open the referenced file.\n- Select this object, right-click on "Attach objects" button and "Create parent groups".\n- Save the file.' % obj
cmds.confirmDialog(title='Referenced file - ZV Parent Master', message=msg)
return False
piv = cmds.xform(obj, q=True, rp=True, ws=True)
cmds.group(obj, n=_getSnapGroup(obj))
cmds.xform(_getSnapGroup(obj), piv=piv, ws=True)
ph = cmds.group(_getSnapGroup(obj), n=_getParentHandle(obj))
cmds.xform(_getParentHandle(obj), piv=piv, ws=True)
# locca gli attributi non diponibili e quelli non richiesti
ts = set(['tx', 'ty', 'tz'])
rs = set(['rx', 'ry', 'rz'])
availAttrs = set(cmds.listAttr(obj, k=True, u=True, sn=True) or [])
attrsToLock = (ts | rs) - availAttrs
if not translation:
attrsToLock |= ts
if not rotation:
attrsToLock |= rs
for attr in attrsToLock:
cmds.setAttr('%s.%s' % (ph, attr), lock=True)
return True
开发者ID:jasperges,项目名称:ZvParentMaster,代码行数:32,代码来源:ZvParentMaster.py
示例19: initUI
def initUI(self):
# self.setMinimumSize(200, 100)
self.ui = ui.loadUiWidgetFromPyFile(__file__, parent=self)
# layout
self.setLayout(QtGui.QVBoxLayout())
self.layout().addWidget(self.ui)
self.layout().setSpacing(0)
self.layout().setContentsMargins(2, 2, 2, 2)
# fill UI info
isValid = self.isValidContext()
if isValid:
self.ui.cb_imagePlanes.addItems(shader.getAllSceneImagePlanes())
else:
self.ui.setEnabled(False)
cmds.confirmDialog(t="Alert", message="There are no ImagePlanes in the scene, there must be one at least.", button=["OK"], icon="warning")
# add signals to the ui elements
self.ui.pb_bakeImagePlane.clicked.connect(self.bakeImagePlane)
self.ui.pb_useBackgroundShader.clicked.connect(self.applyUseBackgroundShader)
self.ui.pb_lambertProjection.clicked.connect(self.applyLambertShader)
self.ui.pb_surfaceShader.clicked.connect(self.applySurfaceShader)
self.ui.pb_applyGreenScreenShader.clicked.connect(self.applyGreenScreenShader)
self.ui.pb_applyGreenScreenShaderFx.clicked.connect(self.applyGreenScreenShaderFx)
self.ui.pb_applyDefaultShader.clicked.connect(self.applyDefaultShader)
开发者ID:esernaalonso,项目名称:dev,代码行数:27,代码来源:projectionManager.py
示例20: msgWin
def msgWin(title = 'test', msg = 'This is a test message??', silent = False):
if silent== "disabled":
pass
elif silent == True:
print msg
else:
mc.confirmDialog(title = title, message = msg, button = ['OK'], defaultButton = 'OK', cancelButton = 'OK', dismissString = 'OK')
开发者ID:sid2364,项目名称:Maya_Python,代码行数:7,代码来源:pipeUtilities.py
注:本文中的maya.cmds.confirmDialog函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论