本文整理汇总了Python中ngSkinTools.utils.Utils.isVertexSelectionAvailable方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.isVertexSelectionAvailable方法的具体用法?Python Utils.isVertexSelectionAvailable怎么用?Python Utils.isVertexSelectionAvailable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ngSkinTools.utils.Utils
的用法示例。
在下文中一共展示了Utils.isVertexSelectionAvailable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: listFromSelection
# 需要导入模块: from ngSkinTools.utils import Utils [as 别名]
# 或者: from ngSkinTools.utils.Utils import isVertexSelectionAvailable [as 别名]
def listFromSelection(self):
'''
list influences based on current vertex selection
'''
includeWeightingInfo = True
if not Utils.isVertexSelectionAvailable():
self.setDisplayedItems([])
return
# TODO: this will result in error when plugin is not loaded (eat the error or warn about plugin not loaded)
options = {}
method = self.getListingMethod()
if method==self.LIST_METHOD_CLOSEST_JOINT:
options['listByClosestJoint'] = True
elif method==self.LIST_METHOD_CONTAINED_WEIGHTS:
options['listByWeights'] = True
# options['sortbyTotalWeights'] = True
# options['includeWeightingInfo'] = includeWeightingInfo
items = cmds.ngListInfluences(**options)
if not includeWeightingInfo:
self.setDisplayedItems(items)
return
items,column2 = self.breakToColumns(items, 2)
# for weight listing, display weighting in percentage
if method==self.LIST_METHOD_CONTAINED_WEIGHTS:
column2 = map(lambda a: "%11.2f%%" % (float(a)*100),column2)
# for closest joint, just round float a bit
if method==self.LIST_METHOD_CLOSEST_JOINT:
column2 = map(lambda a: "%11.2f" % float(a),column2)
self.setDisplayedItems(items,column2)