View Full Version : Connect Attribute

08 August 2012, 02:03 PM
Hello everybody.
I try to write a script to replace objects which had been connected, so i run a test, with 4 locator : loc01,loc02,loc03,loc04. Loc2 pointConstraint by Loc1 and loc3 pointConstraint by loc2. I want to replace loc2 with loc4. So

def listConnect(srcObj,tarObj):
...outAttrs = srcObj.listConnections(source=False,connections=True,sourceFirst=True,plugs=True)
...inAttrs = srcObj.listConnections(source=True,connections=True,sourceFirst=True,plugs=True)

...for attrIn, attrOut in outAttrs:'%s.','%s.',attrOut.replace('%s.','%s.',f=True)

...for attrOut, attrIn in inAttrs:'%s.','%s.',attrIn.replace('%s.','%s.',f=True)
srcObj = pm.PyNode('locator2')
tarObj = pm.PyNode('locator4')

And it gave me a crash right away.
Anything would help, thanks

08 August 2012, 03:09 PM
Sorry, my mistake, after a few more check. It was only my type error. ^^

CGTalk Moderation
08 August 2012, 03:09 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.