本文整理汇总了Python中pymel.core.confirmDialog函数的典型用法代码示例。如果您正苦于以下问题:Python confirmDialog函数的具体用法?Python confirmDialog怎么用?Python confirmDialog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了confirmDialog函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setColor
def setColor(color, *args):
# Get current AOV name
aov = pc.radioButtonGrp(uiWidgets['aovs'], q=1, select=1)
if aov == 1:
aovName = 'mtoa_constant_rgbMask'
elif aov == 2:
aovName = 'mtoa_constant_rgbMask1'
elif aov == 3:
aovName = 'mtoa_constant_rgbMask2'
elif aov == 4:
aovName = 'mtoa_constant_rgbMask3'
if aovName is None:
raise Exception('Error while determining which AOV to focus on.')
print "AOV Name: %s" % aovName
listSel = pc.ls(sl=1)
if len(listSel) == 0:
pc.confirmDialog(t="Error", message="Nothing selected.", icon='critical')
else:
for sel in listSel:
recursiveAssign(aovName, sel, color)
开发者ID:ma55acre,项目名称:MayaDev,代码行数:26,代码来源:arnold_ids.py
示例2: initGeometry
def initGeometry(self):
selection = m.ls(sl=True)
meshes = m.ls(
selection=True,
long=True,
dagObjects=True,
allPaths=True,
type='mesh',
noIntermediate=True
)
if meshes:
for mesh in meshes:
transform = com.getParent(mesh)
if transform:
self.backupers.append(backuper.Backuper(mesh, transform))
m.polyNormalPerVertex(mesh, ufn=True)
m.polySoftEdge(transform, a=180, ch=False)
geomProcessor = geom_processor.GeomProcessor(mesh)
geomProcessor.params = Parameters
self.processors.append(geomProcessor)
else:
pm.confirmDialog(
title='Error',
message='Invalid selection. Select at least one mesh.',
button=['OK'],
defaultButton='OK',
icon='critical'
)
return
m.select(selection, r=True)
开发者ID:Italic-,项目名称:maya-prefs,代码行数:33,代码来源:ui.py
示例3: replaceL2H
def replaceL2H(fr, to):
#把参考文件的低模, 替换成高模
#
#把字段f替换成t
#
#列出所有参考文件,存到以namespace为key的字典中
refs = pm.system.getReferences()
noH = []
for key, value in refs.items():
name_space = key
fileRef = value
#列出参考文件的路径和文件名
file_path = fileRef.path
file_name = file_path.name
#将带'_l_'标示的低模, 替换成带'_h_'标示的高模
if fr in file_name:
hf = file_name.replace(fr, to)
hd = file_path.replace(fr, to)
dir = pm.Path(file_path).dirname()
#如果服务器上有高模文件就进行替换, 没有就加入到一个列表里以便弹窗报错
if hf in [f.name for f in dir.files()]:
fileRef.replaceWith(hd)
else :
noH.append(file_path)
if noH :
pm.confirmDialog( title=u'提示', message='\n'.join(noH) + u'\n 没有"_h_"文件', button=[u'确认'])
else:
pm.confirmDialog( title=u'提示', message=u'完成', button=[u'确认'])
开发者ID:TianD,项目名称:TianD_KX_TOOL,代码行数:29,代码来源:ReplaceReference.py
示例4: doIDShdNetwork
def doIDShdNetwork(*args):
## check if the shading network is existing
shdName = 'idSetup'
if( len( pm.ls(shdName + "_SHD") ) ) != 0:
pm.confirmDialog(t="Warning", message="The shader has been existed!", icon='warning')
return 0
# aiUserDataColor
dataColor = pm.shadingNode('aiUserDataColor', asUtility=True, name=shdName+'DataColor')
dataColor.colorAttrName.set('idcolor')
# aiUserDataString
dataString = pm.shadingNode('aiUserDataString', asUtility=True, name=shdName+'DataString')
dataString.stringAttrName.set('Id')
# aiWriteColor
writeColor = pm.shadingNode('aiWriteColor', asUtility=True, name=shdName+'WriteColor')
# aiUtility
aiIDShd = pm.shadingNode('aiUtility', asShader=True, name=shdName+'_SHD')
aiIDShd.shadeMode.set(2)
# connections
dataColor.outColor >> writeColor.input
dataString.outValue >> writeColor.aovName
writeColor.outColor >> aiIDShd.color
开发者ID:nadibeu,项目名称:arnoldDev,代码行数:27,代码来源:arnold_id_assign_v004b.py
示例5: check_overlapping
def check_overlapping(anim_curves, choice, current_time, offset_val):
for anim_curve in anim_curves:
key_cnt = anim_curve.numKeys()
message = 'Some Keys are overlapping within Offset Value\n'
message += 'Do you want continue on Moving other Keys ?\n'
for i in range(0, key_cnt):
key_time = anim_curve.getTime(i)
if choice == 'forward':
if key_time <= current_time + offset_val:
range_dialog = pm.confirmDialog(title='Error',
message=message,
button=['Yes', 'No'],
cancelButton='No',
dismissString='No')
if range_dialog == 'Yes':
return 1
else:
raise RuntimeError('Move Keys process interrupted by User.')
if choice == 'back':
if key_time >= current_time + offset_val:
range_dialog = pm.confirmDialog(title='Error',
message=message,
button=['Yes', 'No'],
cancelButton='No',
dismissString='No')
if range_dialog == 'Yes':
return 1
else:
raise RuntimeError('Move Keys process interrupted by User.')
开发者ID:eoyilmaz,项目名称:anima,代码行数:30,代码来源:previs.py
示例6: __init__
def __init__(self):
self.name = "MusterSubmitClass"
self.widgets = {}
self.pools = []
self.userPass = {}
self.renderers = []
self.cameras = pm.ls(ca = True)
self.scene = pm.sceneName()
self.priority = self.__class__.defaults['priority']
self.childrenTabs = []
self.startFrame = pm.SCENE.defaultRenderGlobals.startFrame.get()
self.endFrame = pm.SCENE.defaultRenderGlobals.endFrame.get()
self.mustertool = None
self._saveUser = None
self._saveRenderer = None
self._savePool = None
self.fileInfo = PT.PRAFileInfo(self.scene)
try:
self.output = os.path.join(self.__class__.renderDrive, self.fileInfo.getProject(), self.fileInfo.getEpShotName()).replace("\\","/")
except TypeError: #file info returned None
self.output = ''
try:
self._getData() #this bit is slow. use threadding maybe?
except:
pm.confirmDialog(title = "Confirm", Message = "Error connecting to muster database / executable. Speak to your IT helpdesk. \nContinuing using Demo mode", buttonm = ['OK'] )
开发者ID:jessedenton,项目名称:musterSubmit,代码行数:30,代码来源:musterUI.py
示例7: populateList
def populateList():
# Get shader type
shaderSel = pc.radioButtonGrp(uiWidgets['shaderType'], q=1, select=1)
if shaderSel == 1:
shaderType = 'lambert'
elif shaderSel == 2:
shaderType = 'blinn'
elif shaderSel == 3:
shaderType = 'phong'
# Get shader prefix
shaderPrefix = pc.textField(uiWidgets['shadersPrefix'], q=1, text=1)
if len(shaderPrefix) == 0:
listShaders = pc.ls(exactType=shaderType)
else:
listShaders = pc.ls(shaderPrefix+'*', exactType=shaderType)
if len(listShaders) == 0:
pc.confirmDialog(t="Error", message="No shaders fitting the given paramaters has been found.", icon='critical')
exit(1)
elif len(listShaders) > 0:
pc.confirmDialog(t="Shaders found", message=str(len(listShaders))+" shader(s) found. Click confirm to continue.")
else:
exit("Unknown error.")
# for info in infos.keys():
# print "#######################"
# print "### Shader: '%s'" % info
# print " - Found %s shape(s)" % len(infos[info])
# print "Shapes list: %s " % infos[info]
return listShaders
开发者ID:ma55acre,项目名称:MayaDev,代码行数:34,代码来源:render_mayashdtoaistd.py
示例8: doSaveAOVData
def doSaveAOVData(*args):
color_tag = [ ['obj_R',(1, 0, 0)], ['obj_G', (0, 1, 0)], ['obj_B', (0, 0, 1)], ['obj_W', (1, 1, 1)] ]
sceneAOVs = aovs.AOVInterface().getAOVNodes(names=True)
#// collect custom id AOVs
id_aov_sets = [ ( name, node ) for name, node in sceneAOVs if( name.find('id_') == 0 and node.hasAttr('isID') ) ]
aov_info = str()
for aov_name, aov_node in id_aov_sets:
aov_info += '\n'
for cl_attr, cl_val in color_tag:
# print '%s: %s, %s' % (aov_name, cl_attr, cl_val)
list_obj = pm.PyNode( aov_node + "." + cl_attr ).get().split(';')[:-1]
#// convert to a list to save out as a file
aov_info += ( aov_name + '.' + cl_attr + '--' + ';'.join(list_obj) + '\n' )
#// write to file
if( outputAOVLists(aov_info) == 0 ):
pm.confirmDialog( t='Cancel!', message='Svaing is cancel!', b=['OK'], icon='information' )
return 0
pm.confirmDialog( t='Save Complete!', message='Save AOVs Info is done!', b=['OK'], icon='information' )
return 1
开发者ID:kzchen,项目名称:Arnold_techAOV,代码行数:27,代码来源:arnoldTechAOV_v36.py
示例9: setButtonPress
def setButtonPress(self, *args):
"""Sets the plane we'll be snapping to from the three selected vertices
Called by "set plane" button
"""
sel = pm.ls(selection=1, flatten=1)
if len(sel) ==3:
self.cleanUp()
pos1 = sel[0].getPosition()
pos2 = sel[1].getPosition()
pos3 = sel[2].getPosition()
vct1 = pos2-pos1
vct2 = pos3-pos1
# ^ is owerwritten to perform a cross product
self.normal = vct1 ^ vct2
self.normal.normalize()
self.position = pos1
pm.select(sel)
layerObj = pm.createDisplayLayer(name=self.layername, empty=1)
for i, vtx in enumerate(sel):
annotation = pm.annotate(vtx, tx="V%d" % (i+1), p=vtx.getPosition(space="world") )
annotation.setAttr("overrideEnabled", 1)
annotation.setAttr("overrideColor", 17)
annTrans = annotation.getParent()
annTrans.rename("annotateVts%d" % (i+1))
layerObj.addMembers(annTrans)
layerObj.addMembers(annotation)
layerObj.setAttr("displayType", 1)
else:
pm.confirmDialog(message="Please select exactly 3 vertices", title="Error", button="OK",
defaultButton="OK", dismissString="OK", cancelButton="OK")
开发者ID:RokasR3D,项目名称:WorkSamples,代码行数:32,代码来源:flattenVertices.py
示例10: replaceString
def replaceString(*args):
fileNodes = pc.ls(exactType='file')
# Get the search string
searchString = pc.textField(uiWidgets['searchField'], q=1, text=1)
# Get the replace string
replaceString = pc.textField(uiWidgets['replaceField'], q=1, text=1)
if len(searchString) == 0 or len(replaceString) == 0:
pc.confirmDialog(t="Error", message="Either the search or the replace string is empty. Try again.", icon='critical')
exit(1)
fileModified = 0
for node in fileNodes:
filePath = str(node.fileTextureName.get())
print "Found a file node: %s" % node
print "Current path is: %s" % filePath
if str(searchString) in filePath:
print "Found an occurence of the search string."
print type(filePath)
newFilePath = filePath.replace(searchString,replaceString)
print "Setting new path to: %s" % newFilePath
node.fileTextureName.set(newFilePath)
fileModified += 1
pc.confirmDialog(t="Success", message=str(fileModified)+" file(s) has been modified.")
开发者ID:ma55acre,项目名称:MayaDev,代码行数:32,代码来源:texture_searchreplace.py
示例11: delGroupId
def delGroupId():
model = MODELIntercept()
model.modelHistory()
for name in model.historyResult:
shape = pm.PyNode(name)
historyLst = shape.listHistory()
if len(historyLst) == 1 and historyLst[0] == shape:
pass
else :
sg = [h for h in historyLst if h.type() == "shadingEngine"]
if len(sg) == 1:
shaderLst = sg[0].surfaceShader.inputs()
if shaderLst:
try:
outAttrLst = shape.outputs(type = "shadingEngine", c = 1, p = 1)
osattr = outAttrLst[0][0]
odattr = outAttrLst[0][1]
newattr = pm.PyNode(".".join(osattr.name().split(".")[:-1]))
newattr >> odattr
except:
pass
inAttrLst = shape.inputs(type = "shadingEngine", c = 1, p = 1)
isattr = inAttrLst[0][1]
idattr = inAttrLst[0][0]
isattr // idattr
groupID = [g for g in historyLst if g.type() == "groupId"]
pm.delete(groupID)
pm.confirmDialog( title=u'提示', message=u'groupId清理完成', button=['OK'], defaultButton='OK')
开发者ID:TianD,项目名称:TianD_KX_TOOL,代码行数:34,代码来源:deleteGroupId.py
示例12: simpleWarning
def simpleWarning(message, icon='information'):
pm.confirmDialog(
icon=icon,
title=SCRIPT_NAME,
message=message,
button=['Ok']
)
开发者ID:Italic-,项目名称:maya-prefs,代码行数:7,代码来源:fx_reorient.py
示例13: _prep
def _prep(self,args):
basename=self.inputName.getText()
nparticle=pm.ls(sl=True)[0]
if not pm.objExists(self.inputBar.getText()):
pm.error ('GEO plane doesn\'t exist')
geo = pm.PyNode(self.inputBar.getText())
if not isinstance(nparticle.getShape(), pm.nt.NParticle):
pm.error('Your selection is not an nParticle object')
#create an instancer
tempCube=pm.polyCube(n='temp_iinst_GEO',w=.01,h=.01,d=.01,ch=0)
self.instancer=pm.PyNode(pm.particleInstancer(nparticle,name=(nparticle.name().replace('_NPARTICLE','_INSTANCER')),addObject=True,object=tempCube[0],cycleStep=1,cycleStepUnits='Frames',levelOfDetail='Geometry',rotationUnits='Degrees',rotationOrder='XYZ',position='worldPosition',rotation='rotPP',scale='scalePP',objectIndex='indexPP'))
pm.delete(tempCube)
#group the nparticle + instancer
group=pm.group(n=(nparticle.name().replace('_NPATICLE','_lodA_GRP')))
nparticle.setParent(group)
self.instancer.setParent(group)
#nCache itR
if not pm.objExists( nparticle.name().replace('_NPARTICLE','_NUCLEUS') ):
pm.error('Nucleus doesn\'t exist!')
nucleus = nparticle.name().replace('_NPARTICLE','_NUCLEUS')
#delete everything unnecessary that might cause issues
print geo, nucleus
print 'issue?'
pm.delete(geo, nucleus)
print 'issue?'
pm.select(nparticle)
mm.eval('performCreateNclothCache 1 \"add\";')
pm.confirmDialog(m='WARNING, DO NOT SAVE AFTER THIS STEP',t='DONT SAVE!')
开发者ID:AndresMWeber,项目名称:aw,代码行数:32,代码来源:aw_scatterParticle.py
示例14: error_gui
def error_gui(message):
"""Simple gui for displaying errors
"""
pm.confirmDialog(
title=str('gozbruh Error:'),
message='\n' + str(message),
button=['Ok'])
开发者ID:LumaPictures,项目名称:gozbruh,代码行数:7,代码来源:mayagui.py
示例15: doAddAOVAttr
def doAddAOVAttr(*args):
if( ( isSelEmpty() and isObjType() ) == False ):
return 0
aovName = pm.textFieldButtonGrp( 'txtBtnAddAttr', query=True, text=True )
if( len(aovName) == 0 ):
pm.confirmDialog( t='warning', message='AOV name field is empty!', icon='warning' )
return 0
for obj in sel:
if( not( obj.hasAttr(prefixAOV+'Id') ) ):
addUserAttr( obj, 'string' )
# add AOV name as Attribute
pm.PyNode( obj + '.' + prefixAOV + 'Id' ).set( 'id_'+aovName )
# skip loop if the input textfield is empty
if( len(aovName) == 0 ): continue
# add AOV render pass
# check if AOV already existing
if( len( pm.ls('aiAOV_id_'+aovName) ) == 0 ):
addAOV( aovName )
return 1
开发者ID:nadibeu,项目名称:arnoldDev,代码行数:25,代码来源:arnold_id_assign_v004b.py
示例16: checkAndLoadPlugin
def checkAndLoadPlugin(pluginName):
""" Checks and loads plugin with GUI dialogs """
if pm.pluginInfo(pluginName, query=True, loaded=True) == False:
ans = pm.confirmDialog(
title="Warning!!!",
message="%s not loaded,,, \n Do you wish to load it now?" % pluginName,
button=["YES", "NO"],
defaultButton="YES",
dismissString="NO",
)
if ans == "YES":
try:
pm.loadPlugin(pluginName)
return True
except RuntimeError:
pm.warning("%s plugin not found in path!" % pluginName)
pm.confirmDialog(
title="Warning!!!",
message="%s plugin not found!" % pluginName,
button=["OK"],
defaultButton="OK",
dismissString="OK",
)
return False # TODO : Raise Plugin Not Found Error!
if ans == "NO":
return False
开发者ID:atvKumar,项目名称:mkUtils,代码行数:26,代码来源:mkUtils.py
示例17: check_shot_attributes
def check_shot_attributes(self):
"""check some of mandatory attributes
"""
shots_with_bad_attrs = []
attrs = {
'scale': 1.0,
'preHold': 0.0,
'postHold': 0.0
}
shots = self.shot_list
for shot in shots:
for item in attrs.iteritems():
value = shot.getAttr(item[0])
if value != item[1]:
shots_with_bad_attrs.append([shot, item[0], value, item[1]])
if shots_with_bad_attrs:
message = 'Shots below have restricted values for shot attrs:\r\n'
message += '\r'
for info in shots_with_bad_attrs:
message += '[ %s ] - %s | su an %s -> %s olmali\n' % (info[0], info[1], info[2], info[3])
pm.confirmDialog(title='Error', message=message, button='OK')
raise RuntimeError('There Are restricted values in Shot Nodes.')
开发者ID:eoyilmaz,项目名称:anima,代码行数:25,代码来源:previs.py
示例18: ui_badSelectionWarning
def ui_badSelectionWarning(self):
pm.confirmDialog(
title='Error',
message='Invalid selection.\nSelect at least one polygon and press "' + UI_APPLY_BUTTON_STRING + '".',
button=['OK'],
defaultButton='OK',
icon='critical'
)
开发者ID:Italic-,项目名称:maya-prefs,代码行数:8,代码来源:fx_grow_selection_by_edge_angle.py
示例19: createRig
def createRig(self):
pm.currentTime(0, e=True)
global sel_objects
sel_objects = pm.ls(sl=True, tr=True)
if sel_objects == []:
print '\n# Error: Please select an object first'
pm.confirmDialog(title = 'Error: Nothing Selected',
m = 'Please select an object to create the light rig around.',
button = 'Ok',
db = 'Ok')
self.close()
gui(dock=False)
else:
global light_name
light_name = 'light1'
name_request = pm.promptDialog(
t='Light Name',
m='Enter Your New Light\'s Name',
ma='left',
tx='Ex: key_light',
st='text',
b=['Ok', 'Cancel'],
db='Ok',
cb='Cancel',
ds='Cancel')
if name_request == 'Ok':
light_name = pm.promptDialog(query=True, text=True)
global sel_center
sel_center = command.averageCoords(sel_objects)
global rigOrbit, rigInterv, rigLight
rigOrbit = pm.group(n='olp_orbitsGrp1', em=True)
rigInterv = pm.group(n='olp_intervalsGrp1', em=True)
rigLight = self.createLight(sel_center)
self.setExpression()
pm.createRenderLayer([sel_objects, rigOrbit, rigInterv, rigLight], noRecurse=True, name='{0}_layer'.format(light_name))
self.createVis()
pm.xform(rigOrbit, a=True, t=sel_center)
pm.xform(rigInterv, a=True, t=sel_center)
pm.parent(rigLight, rigInterv)
pm.parent(rigInterv, rigOrbit)
pm.select(sel_objects, r=True)
# GUI Components enable/disable
self.enableDisable_component(self.createRig_btn, enabled=False)
self.enableDisable_component(self.deleteRig_btn, enabled=True)
self.enableDisable_component(self.distance_label, enabled=True)
self.enableDisable_component(self.distance_float, enabled=True)
self.enableDisable_component(self.orbit_label, enabled=True)
self.enableDisable_component(self.orbit_int, enabled=True)
self.enableDisable_component(self.interv_label, enabled=True)
self.enableDisable_component(self.interv_int, enabled=True)
self.enableDisable_component(self.showVis_ckbx, enabled=True)
开发者ID:Huston94,项目名称:Orbital_Light_Previewer,代码行数:58,代码来源:orbitLights_UI.py
示例20: move_all_keys
def move_all_keys(choice):
offset_val = offset_intfield.getValue()
if offset_val < 1:
raise RuntimeError('Enter an Offset Value greater than 0.')
if choice == 'back':
offset_val = offset_intfield.getValue() * -1
unlock_val = unlock_state.getValue1()
current_time = pm.currentTime()
anim_curves = pm.ls(type='animCurve')
non_moved_curves = []
if choice == 'back':
check_overlapping(anim_curves, choice, current_time, offset_val)
for anim_curve in anim_curves:
try:
if unlock_val is True and anim_curve.isLocked():
anim_curve.setLocked(0)
key_cnt = anim_curve.numKeys()
for i in range(1, key_cnt + 1):
if choice == 'forward':
ind = key_cnt - i
if choice == 'back':
ind = i - 1
if anim_curve.getTime(ind) >= current_time:
pm.keyframe(anim_curve,
index=ind,
iub=False,
animation='objects',
relative=True,
option='move',
tc=offset_val
)
except:
if anim_curve not in non_moved_curves:
non_moved_curves.append(anim_curve)
continue
if not non_moved_curves:
pm.confirmDialog(title='Info', message='Keys Moved Successfully.', button='OK')
else:
message = 'Anim Curves can NOT be moved:\r\n'
message += '\r'
for i in range(0, len(non_moved_curves)):
message += '%s\n' % non_moved_curves[i]
if i > 30:
message += '+ More...\n'
break
print non_moved_curves
pm.confirmDialog(title='Error', message=message, button='OK')
开发者ID:eoyilmaz,项目名称:anima,代码行数:58,代码来源:previs.py
注:本文中的pymel.core.confirmDialog函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论