本文整理汇总了Python中maya.cmds.listHistory函数的典型用法代码示例。如果您正苦于以下问题:Python listHistory函数的具体用法?Python listHistory怎么用?Python listHistory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了listHistory函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: FilterNodeType
def FilterNodeType(self, type):
'''
返回所选择物体的shader,也可以直接选择shader
'''
outputNodeList = []
for input in self.sl :
inputType = cmds.nodeType(input)
if inputType == type:
outputNodeList.append(input)
elif inputType == 'transform' or inputType == "mesh" or inputType == "nurbsSurface" :
shapeList = cmds.listRelatives(input, ad=1, pa=1, type='surfaceShape')
shapeList = sorted(set(shapeList), key=shapeList.index) #去除列表中的重复元素
for shape in shapeList:
sg = cmds.listConnections(shape, type='shadingEngine')
if sg[0] != 'initialShadingGroup' and len(sg):
shadingNetwork = cmds.listHistory(sg[0], pdo=1)
if len(shadingNetwork):
for outputNode in shadingNetwork:
if cmds.nodeType(outputNode) == type:
outputNodeList.append(outputNode)
else:
shadingNetwork = cmds.listHistory(input, pdo=1)
if len(shadingNetwork):
for outputNode in shadingNetwork:
if cmds.nodeType(outputNode) == type:
outputNodeList.append(outputNode)
self.outputNodeList = sorted(set(outputNodeList), key=outputNodeList.index)
开发者ID:wildparky,项目名称:spielenPipeline,代码行数:28,代码来源:Shader.py
示例2: copyWeight
def copyWeight( first, second ):
hists = cmds.listHistory( first, pdo=1 )
skinNode = None
for hist in hists:
if cmds.nodeType( hist ) == 'skinCluster':
skinNode = hist
if not skinNode: return None
targetSkinNode = None
targetHists = cmds.listHistory( second, pdo=1 )
if targetHists:
for hist in targetHists:
if cmds.nodeType( hist ) == 'skinCluster':
targetSkinNode = hist
if not targetSkinNode:
bindObjs = cmds.listConnections( skinNode+'.matrix', s=1, d=0, type='joint' )
bindObjs.append( second )
print bindObjs
cmds.skinCluster( bindObjs, tsb=1 )
cmds.copySkinWeights( first, second, noMirror=True, surfaceAssociation='closestPoint', influenceAssociation ='oneToOne' )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:26,代码来源:cmdModel.py
示例3: findTypeInHistory
def findTypeInHistory(obj, type, future=False, past=True):
# This is translated from the mel procedure of the same name.
if past and future:
# In the case that the object type exists in both past and future
# find the one that is fewer connections away.
pasts = cmds.listHistory(obj, f=0, bf=1, af=1)
futures = cmds.listHistory(obj, f=1, bf=1, af=1)
pastObjs = cmds.ls(pasts, type=type)
futureObjs = cmds.ls(futures, type=type)
if len(pastObjs) > 0:
if len(futureObjs) > 0:
for i in range( min( len(pasts), len(futures) ) ):
if pasts[i] == pastObjs[0]:
return pastObjs[0]
if futures[i] == futureObjs[0]:
return futureObjs[0]
else:
return pastObjs[0]
elif len(futureObjs) > 0:
return futureObjs[0]
else:
if past:
hist = cmds.listHistory(obj, f=0, bf=1, af=1)
objs = cmds.ls(hist, type=type)
if len(objs) > 0:
return objs[0]
if future:
hist = cmds.listHistory(obj, f=1, bf=1, af=1)
objs = cmds.ls(hist, type=type)
if len(objs) > 0:
return objs[0]
return None
开发者ID:cgriders,项目名称:jcScripts,代码行数:34,代码来源:helper.py
示例4: meshesFromHistory
def meshesFromHistory(control):
'''
Return all visible meshes downstream from a given control.
'''
#try searching backward first for speed
meshes = []
allMeshes = mc.ls(type='mesh')
for mesh in allMeshes:
hist = mc.listHistory(mesh, allConnections=True)
if control in hist:
if isNodeVisible(mesh):
meshes.append(mesh)
if meshes:
return meshes
#if we didn't find any, search forward from control
#this takes a bit longer
hier = mc.listRelatives(control, ad=True, pa=True)
if not hier:
hier = [control]
else:
hier.append(control)
hist = mc.listHistory(hier, future=True, allFuture=True, allConnections=True)
hist = list(set(hist))
meshes = mc.ls(hist, type='mesh')
meshes = [x for x in meshes if isNodeVisible(x)]
return meshes
开发者ID:liudger,项目名称:ml_tools,代码行数:31,代码来源:ml_centerOfMass.py
示例5: isAffected
def isAffected(nodeAffected, nodeDriver):
driverFamily = cmds.ls(nodeDriver, dagObjects=True)
if nodeAffected in driverFamily: return True
nodeAffectedConnections = cmds.listHistory(nodeAffected)
if nodeDriver in nodeAffectedConnections: return True
steps1to3=set()
steps1to3.update(steps1and3)
step4=[]
for each in (cmds.ls(list(steps1to3),shapes=True)):
try:
step4.extend(cmds.listConnections(each+'.instObjGroups', t='shadingEngine', et=1))
except TypeError:
pass
steps1to3.update(step4)
steps1to4=set()
steps1to4.update(steps1to3)
steps1to4.update(step4)
step5=set(steps1to4)
step5.update(cmds.listHistory(list(steps1to4)))
print step5
开发者ID:Italic-,项目名称:maya-prefs,代码行数:27,代码来源:utilMod.py
示例6: getHIKCharacterNode_from_node
def getHIKCharacterNode_from_node(_node):
if type(_node) == str or type(_node) == unicode:
# namespace 확인
_namespace = getNamespace(_node)
_ls = []
if _namespace:
# namespace가 존재할경우
# 레퍼런스로 생각하고 namespace로 시작하는 HIKProperty2State 노드 찾음.
_ls = cmds.ls( _namespace+"*", type='HIKCharacterNode')
else:
# namespace가 존재하지 않을경우
# 임포트되었거나, 캐릭터 원본 파일
# listHistory 를 사용해서 찾음,
# 일일히 다 검색해야 해서, 다소 피드백이 느림.
_listHistory = cmds.listHistory(
_node,
#allFuture=True,
allConnections=True
)
_ls = cmds.ls( _listHistory, type='HIKCharacterNode')
# 찾은게 없으면 나감
if not _ls:
return
# 찾은게 있으면 등록
return _ls[0]
elif type(_node) == list:
_HIKCharacterNode = []
for _n in _node:
_namespace = getNamespace(_n)
_ls = []
if _namespace:
# namespace가 존재할경우
# 레퍼런스로 생각하고 namespace로 시작하는 HIKProperty2State 노드 찾음.
_ls = cmds.ls( _namespace+"*", type='HIKCharacterNode')
else:
# namespace가 존재하지 않을경우
# 임포트되었거나, 캐릭터 원본 파일
# listHistory 를 사용해서 찾음,
# 일일히 다 검색해야 해서, 다소 피드백이 느림.
_listHistory = cmds.listHistory(
_n,
#allFuture=True,
allConnections=True
)
_ls = cmds.ls( _listHistory, type='HIKCharacterNode')
# 찾은게 없으면 나감
if not _ls: return
for _i in _ls:
_HIKCharacterNode.append(_i)
return list(set(_HIKCharacterNode))
开发者ID:kyuhoChoi,项目名称:mayaTools,代码行数:58,代码来源:Gun_Tools.py
示例7: cmdSelectSgWobbleCurve
def cmdSelectSgWobbleCurve( *args ):
sgWobbleCurves = []
for hist in cmds.listHistory( cmds.ls( sl=1 ), pdo=1 ):
if cmds.nodeType( hist ) != 'wire': continue
targetCrv = cmds.listConnections( hist+'.deformedWire[0]' )
crvHists = cmds.listHistory( targetCrv, pdo=1 )
for crvHist in crvHists:
if cmds.nodeType( crvHist ) != 'sgWobbleCurve2': continue
sgWobbleCurves.append( crvHist )
if sgWobbleCurves: cmds.select( sgWobbleCurves )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:10,代码来源:sgBProject_coa.py
示例8: cmdSelectFollicle
def cmdSelectFollicle( *args ):
upObjects = []
for hist in cmds.listHistory( cmds.ls( sl=1 ), pdo=1 ):
if cmds.nodeType( hist ) != 'wire': continue
targetCrv = cmds.listConnections( hist+'.deformedWire[0]' )
crvHists = cmds.listHistory( targetCrv, pdo=1 )
for crvHist in crvHists:
if cmds.nodeType( crvHist ) != 'sgWobbleCurve2': continue
mm = cmds.listConnections( crvHist+'.aimMatrix' )[0]
upObj = cmds.listConnections( mm+'.matrixIn[0]' )[0]
upObjects.append( upObj )
if upObjects: cmds.select( upObjects )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:12,代码来源:sgBProject_coa.py
示例9: findTypeInHistory
def findTypeInHistory(obj, objType, future=False, past=False):
"""
returns the node of the specified type that is the closest traversal to the input object
:param obj: Object name
:type obj: str
:param objType: Object type list
:type objType: str | list
:param future: Future depth
:type future: bool
:param past: Past depth
:type past: bool
:return: Connected objType nodes
:rtype: list
"""
#// Test with list return instead of closest connected node
#// Replace return pastObjs with return pastObjs[0] etc
if past and future:
#// In the case that the object type exists in both past and future,
#// find the one that is fewer connections away.
pastList = mc.listHistory(obj, f=False, bf=True, af=True)
futureList = mc.listHistory(obj, f=True, bf=True, af=True)
pastObjs = mc.ls(pastList, type=objType)
futureObjs = mc.ls(futureList, type=objType)
if pastObjs:
if futureObjs:
mini = len(futureList)
if len(pastList) < mini:
mini = len(pastList)
for i in range(mini):
if pastList[i] in pastObjs:
return pastObjs
if futureList[i] in futureObjs:
return futureObjs
else:
return pastObjs
elif futureObjs:
return futureObjs
else:
if past:
hist = mc.listHistory(obj, f=False, bf=True, af=True)
objs = mc.ls(hist, type=objType)
if objs:
return objs
if future:
hist = mc.listHistory(obj, f=True, bf=True, af=True)
objs = mc.ls(hist, type=objType)
if objs:
return objs
开发者ID:snaress,项目名称:studio_dev,代码行数:49,代码来源:pUtil.py
示例10: renameHistoryNodes
def renameHistoryNodes(obj, nodeType, prefix='', suffix='', stripOldSuffix=True):
"""
Rename nodes in a specified objects history based on a given or derived prefix and suffix
@param obj: Object whose history nodes will be renamed
@type obj: str
@param nodeType: Node types to isolate for rename
@type nodeType: str or list
@param prefix: Name prefix for nodes. If empty, derive from object name
@type prefix: str
@param suffix: Name suffix for nodes. If empty, derive from node type
@type suffix: str
"""
# Check object
if not cmds.objExists(obj):
raise Exception('Object "' + obj + '" does not exist!')
# Check prefix
if not prefix:
if stripOldSuffix:
prefix = glTools.utils.stringUtils.stripSuffix(obj)
else:
prefix = obj
# Get object history
if nodeType.lower() == 'all':
nodeHist = cmds.ls(cmds.listHistory(obj))
else:
nodeHist = cmds.ls(cmds.listHistory(obj), type=nodeType)
nodeHist.sort()
# For each history node
nodeCount = len(nodeHist)
for n in range(nodeCount):
# Check suffix
if not suffix:
nodeSuffix = cmds.objectType(nodeHist[n])
else:
nodeSuffix = suffix
# Check index
if nodeCount > 1: nodeSuffix = glTools.utils.stringUtils.stringIndex(n, 1) + '_' + nodeSuffix
# Rename node
nodeHist[n] = cmds.rename(nodeHist[n], prefix + '_' + nodeSuffix)
# Return result
return nodeHist
开发者ID:bennymuller,项目名称:glTools,代码行数:48,代码来源:base.py
示例11: exportLights
def exportLights(self):
for light in self.lights:
hisObject = cmds.listHistory(light)
hisObject = hisObject[0]
exportName = light.replace(':', '_')
thisNodeType = cmds.nodeType(hisObject)
parameters = ['tx', 'ty', 'tz', 'rx', 'ry', 'rz', 'sx', 'sy', 'sz', 'cr', 'cg', 'cb', 'intensity', 'rotateOrder']
if thisNodeType == 'spotLight':
writeOutType = 'spot'
parameters.append('coneAngle')
parameters.append('penumbraAngle')
parameters.append('dropoff')
if thisNodeType == 'pointLight':
writeOutType = 'point'
if thisNodeType == 'directionalLight':
writeOutType = 'directional'
for i in range(self.startFrame, self.endFrame+1):
if thisNodeType == 'spotLight':
lightConeAngle = cmds.getAttr(hisObject + '.coneAngle',time=i)
lightPenumbraAngle = cmds.getAttr(hisObject + '.penumbraAngle',time=i)
lightDropoff = cmds.getAttr(hisObject + '.dropoff',time=i)
else:
lightConeAngle = 0
lightPenumbraAngle = 0
lightDropoff = 0
self.exportData(light, parameters, self.startFrame, self.endFrame+1, self.exportPath + exportName + '.fm2n')
print 'Saved data from: ' + light
开发者ID:vipul-rathod,项目名称:lsapipeline,代码行数:34,代码来源:FromMaya2Nuke.py
示例12: createFreeCameras
def createFreeCameras(self):
debug(app = None, method = 'FromMaya2Nuke.createFreeCameras', message = 'self.cameras: %s' % self.cameras, verbose = False)
for camera in self.cameras:
debug(app = None, method = 'FromMaya2Nuke.createFreeCameras', message = 'Processing camera: %s' % camera, verbose = False)
cmds.select(camera, r= True)
newCamera = cmds.duplicate( rr=True )
newCamera = newCamera[0]
debug(app = None, method = 'FromMaya2Nuke.createFreeCameras', message = 'newCamera: %s' % newCamera, verbose = False)
for attr in ['tx', 'ty', 'tz', 'rx', 'ry', 'rz', 'sx', 'sy', 'sz', 'v']:
cmds.setAttr(newCamera + "." + attr, lock=False)
hisObject = cmds.listHistory(newCamera)
for attr in ['hfa', 'vfa', 'fl', 'lsr', 'fs', 'fd', 'sa', 'coi']:
cmds.setAttr(hisObject[0] + "." + attr, lock=False)
parentNode = cmds.listRelatives(camera, p= True)
if parentNode != None:
cmds.parent( newCamera, world= True)
pointConst = cmds.pointConstraint( camera, newCamera )
orientConst = cmds.orientConstraint( camera, newCamera )
cmds.bakeResults( newCamera+'*', t=(self.startFrame, self.endFrame), simulation=True, sparseAnimCurveBake=False, shape=False)
debug(app = None, method = 'FromMaya2Nuke.createFreeCameras', message = 'newCamera %s baked successfully...' % newCamera, verbose = False)
cmds.delete(pointConst, orientConst, cn=True )
newCameraName = cmds.rename(newCamera, '%s_Cpy' % camera)
debug(app = None, method = 'FromMaya2Nuke.createFreeCameras', message = 'newCameraName: %s' % newCameraName, verbose = False)
self.newCameras.extend([newCameraName])
debug(app = None, method = 'FromMaya2Nuke.createFreeCameras', message = 'self.newCameras: %s' % self.newCameras, verbose = False)
开发者ID:vipul-rathod,项目名称:lsapipeline,代码行数:35,代码来源:FromMaya2Nuke.py
示例13: repair
def repair(self, instance):
"""Delete all intermediateObjects"""
intermediate_objects = self.list_intermediate_shapes(instance)
if intermediate_objects:
future = cmds.listHistory(intermediate_objects, future=True)
cmds.delete(future, ch=True)
cmds.delete(intermediate_objects)
开发者ID:yamahigashi,项目名称:pyblish-magenta,代码行数:7,代码来源:validate_no_intermediate_objects.py
示例14: mmSetBindDefault
def mmSetBindDefault( *args ):
sels = cmds.ls( sl=1 )
for sel in sels:
hists = cmds.listHistory( sel )
skinNode = None
for hist in hists:
if cmds.nodeType( hist ) == 'skinCluster':
skinNode = hist
break
fnSkinNode = om.MFnDependencyNode( baseFunctions.getMObject( skinNode ) )
plugMatrix = fnSkinNode.findPlug( 'matrix' )
plugBindPre = fnSkinNode.findPlug( 'bindPreMatrix' )
for i in range( plugMatrix.numElements() ):
loIndex = plugMatrix[i].logicalIndex()
oMtx = plugMatrix[i].asMObject()
mtxData = om.MFnMatrixData( oMtx )
mtx = mtxData.matrix()
invData = om.MFnMatrixData()
oInv = invData.create( mtx.inverse() )
plugBindPre.elementByLogicalIndex( loIndex ).setMObject( oInv )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:26,代码来源:cmdModel.py
示例15: findRelatedSkinCluster
def findRelatedSkinCluster(geometry):
'''
Return the skinCluster attached to the specified geometry
Args:
geometry (str): Geometry object/transform to query
Returns:
str
'''
# Check geometry
if not cmds.objExists(geometry):
om.MGlobal.displayError('Object '+geometry+' does not exist!')
return
# Check transform
if cmds.objectType(geometry) == 'transform':
try: geometry = cmds.listRelatives(geometry,s=True,ni=True,pa=True)[0]
except:
om.MGlobal.displayError('Object %s has no deformable geometry!' % geometry)
return
# Determine skinCluster
skin = mel.eval('findRelatedSkinCluster \"%s\"' % geometry)
if not skin:
skin = cmds.ls(cmds.listHistory(geometry, pdo=1, gl=1), type='skinCluster')
if skin: skin = skin[0]
if not skin: skin = None
# Return result
return skin
开发者ID:00christian00,项目名称:DeformationLearningSolver,代码行数:31,代码来源:utils.py
示例16: clampVertInfluenceCount
def clampVertInfluenceCount( geos=None ):
'''
'''
global kMAX_INF_PER_VERT
progressWindow = cmd.progressWindow
skinPercent = cmd.skinPercent
if geos is None:
geos = cmd.ls(sl=True)
for geo in geos:
skin = cmd.ls(cmd.listHistory(geo), type='skinCluster')[0]
verts = cmd.ls(cmd.polyListComponentConversion(geo, toVertex=True), fl=True)
inc = 100.0/len(verts)
progress = 0
for vert in verts:
progress += inc
progressWindow(e=True, progress=progress)
weightList = skinPercent(skin, vert, ib=1e-4, q=True, value=True)
if len(weightList) > kMAX_INF_PER_VERT:
jointList = skinPercent(skin, vert, ib=1e-4, q=True, transform=None)
sorted = zip(weightList, jointList)
sorted.sort()
#now clamp to the highest kMAX_INF_PER_VERT number of weights, and re-normalize
sorted = sorted[-kMAX_INF_PER_VERT:]
weightSum = sum([a for a, b in sorted])
t_values = [(b, a/weightSum) for a, b in sorted]
skinPercent(skin, vert, tv=t_values)
#turn in limiting in the skinCluster
cmd.setAttr('%s.maxInfluences' % skin, kMAX_INF_PER_VERT)
cmd.setAttr('%s.maintainMaxInfluences' % skin, 1)
开发者ID:creuter23,项目名称:fs-tech-artist,代码行数:35,代码来源:meshUtils.py
示例17: updateCondition
def updateCondition(self, *args ):
rootName = cmds.textField( self._rootField, q=1, tx=1 )
children = cmds.listRelatives( rootName, c=1, ad=1 )
angleDriverList = []
for child in children:
hists = cmds.listHistory( child )
for hist in hists:
if cmds.nodeType( hist ) == 'angleDriver':
if not hist in angleDriverList:
angleDriverList.append( hist )
onlyMoved = cmds.checkBox( self._showOnlyMovedCheck, q=1, v=1 )
showDrivers = []
minValue = cmds.floatField( self._smallerValueField, q=1, v=1 )
if onlyMoved:
for driver in angleDriverList:
angle1, angle2, angle3 = cmds.getAttr( driver+'.outDriver' )[0]
if math.fabs( angle1 ) > minValue or math.fabs( angle2 ) > minValue or math.fabs( angle3 ) > minValue:
showDrivers.append( driver )
else:
for driver in angleDriverList:
showDrivers.append( driver )
cmds.textScrollList( self._driverList, e=1, ra=1, a=showDrivers )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:32,代码来源:driverSetUi.py
示例18: __init__
def __init__(self, faceDriver_Crv='faceDriver_Crv'):
self.microList = ['Up_lip_2x', 'Up_lip_3x', 'Up_lip_4x', 'Up_lip_5x', 'Up_lip_6x', 'Up_lip_7x', 'Up_lip_8x', 'Up_lip_9x',
'Up_lip_10x', 'Up_lip_11x', 'Up_lip_12x', 'Up_lip_13x', 'Up_lip_14x', 'Up_lip_15x', 'Up_lip_16x', 'Dn_lip_3x',
'Dn_lip_4x', 'Dn_lip_5x', 'Dn_lip_6x', 'Dn_lip_7x', 'Dn_lip_8x', 'Dn_lip_9x', 'Dn_lip_10x', 'Dn_lip_11x', 'Dn_lip_12x',
'Dn_lip_13x', 'Dn_lip_14x', 'Dn_lip_15x', 'cheeks_1x', 'cheeks_2x', 'cheeks_3x', 'cheeks_4x', 'cheeks_5x', 'cheeks_6x',
'cheeks_7x', 'cheeks_8x', 'cheeks_9x', 'cheeks_10x', 'cheeks_11x', 'cheeks_12x', 'cheeks_13x', 'cheeks_14x', 'cheeks_15x',
'cheeks_16x', 'cheeks_17x', 'cheeks_18x', 'cheeks_19x', 'Lf_eye_1x', 'Lf_eye_2x', 'Lf_eye_3x', 'Lf_eye_4x', 'Lf_eye_5x',
'Lf_eye_6x', 'Lf_eye_7x', 'Lf_eye_8x', 'Rt_eye_1x', 'Rt_eye_2x', 'Rt_eye_3x', 'Rt_eye_4x', 'Rt_eye_5x', 'Rt_eye_6x',
'Rt_eye_7x', 'Rt_eye_8x', 'Up_lipLft_2x', 'Up_lipLft_3x', 'Up_lipLft_4x', 'Up_lipLft_5x', 'Up_lipLft_6x', 'Up_lipLft_7x', 'Up_lipLft_8x',
'Up_lipLft_9x', 'Up_lipLft_10x', 'Up_lipLft_11x', 'Up_lipLft_12x', 'Up_lipLft_13x', 'Up_lipLft_14x', 'Up_lipLft_15x', 'Up_lipLft_16x',
'Dn_lipLft_3x', 'Dn_lipLft_4x', 'Dn_lipLft_5x', 'Dn_lipLft_6x', 'Dn_lipLft_7x', 'Dn_lipLft_8x', 'Dn_lipLft_9x', 'Dn_lipLft_10x', 'Dn_lipLft_11x',
'Dn_lipLft_12x', 'Dn_lipLft_13x', 'Dn_lipLft_14x', 'Dn_lipLft_15x', 'cheeksLft_1x', 'cheeksLft_2x', 'cheeksLft_3x', 'cheeksLft_4x',
'cheeksLft_5x', 'cheeksLft_6x', 'cheeksLft_7x', 'cheeksLft_8x', 'cheeksLft_9x', 'cheeksLft_10x', 'cheeksLft_11x', 'cheeksLft_12x',
'cheeksLft_13x', 'cheeksLft_14x', 'cheeksLft_15x', 'cheeksLft_16x', 'cheeksLft_17x', 'cheeksLft_18x', 'cheeksLft_19x']
'''
self.meshList = ['Up_lipLoft_msh','cheekLoft_msh','Dn_lipLoft_msh','Lf_eyeLoft_msh','Rt_eyeLoft_msh',
'LfUp_eyeLidLoft_msh','LfDn_eyeLidLoft_msh','RtUp_eyeLidLoft_msh','RtDn_eyeLidLoft_msh']
self.curveList = ['Up_lip_Crv','Dn_lip_Crv','cheeks_Crv','Up_lipLft_Crv','Dn_lipLft_Crv','cheeksLft_Crv',
'Rt_eye','Lf_eye']
'''
self.faceDriver_Crv = faceDriver_Crv
self.skinCluster = cmds.ls(cmds.listHistory(faceDriver_Crv), type='skinCluster')[0]
self.cvList = []
self.cvCnt = cmds.getAttr(self.faceDriver_Crv + '.spans')
self.influenceDict = None
self.influenceInfoDict = {}
self.createCvList()
开发者ID:boochos,项目名称:work,代码行数:29,代码来源:atom_olSkoolFix_lib.py
示例19: cmdSelectCurve
def cmdSelectCurve( *args ):
sgCurves = []
for hist in cmds.listHistory( cmds.ls( sl=1 ), pdo=1 ):
if cmds.nodeType( hist ) != 'wire': continue
targetCrv = cmds.listConnections( hist+'.deformedWire[0]' )
sgCurves.append( targetCrv[0] )
if sgCurves: cmds.select( sgCurves )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:7,代码来源:sgBProject_coa.py
示例20: getDeformerList
def getDeformerList(geo='',regexFilter='',type='geometryFilter'):
'''
Return a list of deformer that match the input criteria.
You can list deformers connected to a geo specified geometry, by type and filter the result with a regex.
@param geo: Geometry name as string. Optional arg that will list deformers connected to geo.
@type geo: str
@param regexFilter: Regular Expression as string. Optional arg that will filter results
@type regexFilter: str
@param type: Deformer Type as string. Optional arg, only return deformers of specified type.
@type type: str
'''
deformers = []
# Check Geo
if geo:
inputShapes = []
# Get shapes
shapes = mc.listRelatives(geo, shapes=True, ni=True)
# Get input shapes
for shape in shapes: inputShapes.append( findInputShape(shape) )
# Get deformers by listing all future on input shapes
deformers = mc.ls(mc.listHistory(inputShapes, future=True, allFuture=True), type=type)
else:
deformers = mc.ls(type=type)
# Remove duplicate entries
deformers = list(set(deformers))
# Filter result if regexFilter
if regexFilter:
reFilter = re.compile(regexFilter)
return filter(reFilter.search, deformers)
# Return result
return deformers
开发者ID:RiggingDojoAdmin,项目名称:glTools,代码行数:34,代码来源:deformer.py
注:本文中的maya.cmds.listHistory函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论