本文整理匯總了Python中ngSkinTools.utils.Utils.mel方法的典型用法代碼示例。如果您正苦於以下問題:Python Utils.mel方法的具體用法?Python Utils.mel怎麽用?Python Utils.mel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ngSkinTools.utils.Utils
的用法示例。
在下文中一共展示了Utils.mel方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: selectPaintWeightsInfluence
# 需要導入模塊: from ngSkinTools.utils import Utils [as 別名]
# 或者: from ngSkinTools.utils.Utils import mel [as 別名]
def selectPaintWeightsInfluence(self,infl):
'''
tries to select influence (provided as string) in current maya's paint weights context and UI
if skin paint context is not available, nothing happens
'''
if not Utils.isCurrentlyPaintingWeights():
return
# influence name can come in any form ('joint3', 'joint2|joint3', 'joint1|joint2|joint3')
# get the absolute shortest possible (but still unique) and longest
try:
longName = cmds.ls(infl,l=True)[0]
shortName = cmds.ls(longName,l=False)[0]
log.info("selecting in paint weights: influence %s" % str(infl))
# try to work around with the mess in the earlier versions of
# maya's paint weights UI:
if Utils.getMayaVersion()<Utils.MAYA2011:
itemName = Utils.mel('artAttrSkinShortName("%s")'%shortName)
Utils.mel('artSkinSelectInfluence("artAttrSkinPaintCtx","%s","%s");' % (shortName,itemName));
else:
Utils.mel('artSkinSelectInfluence("artAttrSkinPaintCtx","%s");' % shortName);
# show paint weights interface
cmds.toolPropertyWindow()
except:
# problems listing given influence.. just die here
Utils.displayError('problem selecting influence %s' % infl)