Or:
from pymel.core import *
objs = ls(sl=1)
for obj in objs:
skinClusterNode = obj.history(type="skinCluster")[0]
blendShapeNode = obj.history(type="blendShape")[0]
print "\n%s:\n\tskinCluster is %s.\n\tblendShapeNode is %s." %
(obj, skinClusterNode, blendShapeNode)
output
pSphere1:
skinCluster is skinCluster1.
blendShapeNode is blendShape1.
On 8月13日, 上午5时49分, Alan Fregtman <[email protected]> wrote:
> Or:
>
> import pymel.core as pm
>
> sel = pm.ls(sl=1)
> geo = sel[0]
> hist = pm.listHistory(geo, pdo=1,il=2)
> skinClusters = [h for h in hist if pm.nodeType(h) == "skinCluster"]
> blendShapeNodes = [h for h in hist if pm.nodeType(h) == "blendshape"]
>
>
>
>
>
>
>
> On Thu, Aug 12, 2010 at 4:58 PM, Chad Vernon <[email protected]> wrote:
> > I'm not sure I understand. Can you do some like this:
>
> > sel = mc.ls(sl=True)
> > history = mc.listHistory(sel[0[)
> > for node in history:
> > print node
> > nodeType = mc.nodeType(node)
> > if nodeType == 'skinCluster':
> > skinCluster = node
> > elif nodeType == 'blendshape':
> > blendshape = node
>
> > 2010/8/12 Vitor Lôbo Ramos <[email protected]>
>
> >> But I need to know it in specific.So I can apply a variable upon the
> >> information obtained.
>
> >> exemple:
>
> >> sel = mc.ls(sl=True)
> >> print sel
>
> >> mc.rename(sel,'test_one')
>
> >> Now I want to apply commands to other objects identified .... I think
> >> listHistory () does not allow me that.
>
> >> On 12 ago, 17:11, Chad Vernon <[email protected]> wrote:
> >> > I think you are looking for the mc.listHistory() command.
>
> >> > Chad
>
> >> > 2010/8/12 Vitor Lôbo Ramos <[email protected]>
>
> >> > > Good afternoon
>
> >> > > How to solve this issue?
>
> >> > > Suppose I have created one with a polyCube blendShapes and skin in a
> >> > > joint.
>
> >> > > Now I want the script editor tell me who is the polyCube, but also the
> >> > > blendShape and skincluster.
>
> >> > > Who is the polyCube?
>
> >> > > import maya.cmds as mc
>
> >> > > sel = mc.ls(sl=True)
> >> > > print sel
>
> >> > > print sel
> >> > > [u'boxone']
>
> >> > > How to make python, script editor tell me who is the skincluster and
> >> > > blendShape (already created)?
>
> >> > > --
> >> > >http://groups.google.com/group/python_inside_maya
>
> >> --
> >>http://groups.google.com/group/python_inside_maya
>
> > --
> >http://groups.google.com/group/python_inside_maya
--
http://groups.google.com/group/python_inside_maya