little weak...

shps = mc_.listRelatives(s=True, ni=True)
for sh in shps:
    scs = mc_.ls(type='skinCluster')
    for sc in scs:
        mesh = mc_.skinCluster(sc, q=True, g=True)
        if mesh[0] == sh:
            relatedSkinCluster = sc
            print relatedSkinCluster

Better.

On Wed, Feb 2, 2011 at 11:36 PM, Ted Charlton <[email protected]>wrote:

> shps = mc_.listRelatives(s=True, ni=True)
> for sh in shps:
>     scs = mc_.ls(type='skinCluster')
>     for sc in scs:
>         mesh = mc_.skinCluster(sc, q=True, g=True)
>         if mesh[0] == shps[0]:
>             relatedSkinCluster = sc
>             print relatedSkinCluster
>
> GVOK,
>
> Maybe this can help.
> Cheers.
>
>
> On Wed, Feb 2, 2011 at 10:52 PM, Gerard van Ommen Kloeke <
> [email protected]> wrote:
>
>>  I'll probably go that route due to time and experience, but I will write
>> something in py eventually (and post)
>> Thanks for the help
>>
>> You can run mel from python:
>> import maya.mel as mel
>> mel.eval('findRelatedSkinCluster '+name_of_mesh)
>>
>> On Thu, Feb 3, 2011 at 9:41 AM, GerardVOK <[email protected]> wrote:
>>
>>> Hi. I am looking for a way to determine the skinCluster that is
>>> related to a mesh. Maya came with a "findRelatedSkinCluster" mel
>>> script, but doesnt have this as a py script. I will end up writing my
>>> own procedure but unlike my Mel experience, I am very new to python
>>> and this will take some time. I guess I could always run the mel
>>> script in the python script but that just seems dirty..
>>>
>>> If there is anyone out there who may have a solution, I would
>>> appreciate your help.
>>>
>>> Thanks
>>> Gerard Van Ommen
>>> Australia
>>>
>>> --
>>> 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

Reply via email to