If you have a list of material attributes like this:
mats = ['material1.color', 'material2.color']
Then you can loop over it and disconnect like this:
for mat in mats:
conns = cmds.listConnections(mat, p=True) or []
for conn in conns:
cmds.disconnectAttr(conn, mat)
If I missed your question, can you post an example of what you have so far so I
can see what is not working?
On Dec 11, 2012, at 5:51 AM, Daz wrote:
> Heya
>
> Right, that do gives me what I want thanks ! I had a feeling its one of
> settings I just failed to understand it properly...
>
> Anyway since I'm writing here got 1 more question.
>
> I have a list of materials and then a list of specific connections to those
> materials.
>
> Is there a way to disconnect those connection from those materials?
>
> My test fail somehow because(I think) every time I go through loop I end up
> trying to disconnect wrong nodes from wrong materials, since it goes one by
> one over list...
>
> Not sure if I can match up list somehow or tell it to pick 1 mat, get its
> connections, break them, move to next node
>
> Is there a way to do it ? Must be I guess I just didn't find out the proper
> command or how to name it...
>
> Thanks, bye.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
>
>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].