def USVZ():
inputs = cmds.listConnections('.userVectorZ', source=True, destination=False, plugs=True)
if inputs:
input = inputs[0]
cmds.disconnectAttr(input,'.userVectorZ')
Now the code can only process a single object. I want to process all the objects I selected. How should I modify them?
def USVZ():
inputs = cmds.listConnections('.userVectorZ', source=True, destination=False, plugs=True)
if inputs:
input = inputs[0]
cmds.disconnectAttr(input,'.userVectorZ')
Now the code can only process a single object. I want to process all the objects I selected. How should I modify them?
Hi!
This should do the trick:
def USVZ():
inputs = cmds.listConnections('.userVectorZ', source=True, destination=False, plugs=True)
if inputs:
for input in inputs:
cmds.disconnectAttr(input,'.userVectorZ')
I hope it helps!
Hi!
This should do the trick:
def USVZ():
inputs = cmds.listConnections('.userVectorZ', source=True, destination=False, plugs=True)
if inputs:
for input in inputs:
cmds.disconnectAttr(input,'.userVectorZ')
I hope it helps!
I guess this is what you want then:
def USVZ():
objects = cmds.ls(sl = True, dag = True)
for o in objects:
inputs = cmds.listConnections('{0}.userVectorZ'.format(o), source=True, destination=False, plugs=True)
if inputs:
for i in inputs:
cmds.disconnectAttr(i,'{0}.userVectorZ'.format(o))
I guess this is what you want then:
def USVZ():
objects = cmds.ls(sl = True, dag = True)
for o in objects:
inputs = cmds.listConnections('{0}.userVectorZ'.format(o), source=True, destination=False, plugs=True)
if inputs:
for i in inputs:
cmds.disconnectAttr(i,'{0}.userVectorZ'.format(o))
Can't find what you're looking for? Ask the community or share your knowledge.