Break connections in Maya Python?

Break connections in Maya Python?

Anonymous
Not applicable
4,216 Views
2 Replies
Message 1 of 3

Break connections in Maya Python?

Anonymous
Not applicable

Hi all,

 

I am Keyframing animations using a python generated User Interface.  I would like to add a function to break connections from a selected item, but I have been unable to manage this task.

 

I would appreciate any input.  I have been trying to either use listConnections to inform disconnectAttr, but the names of the attributes don't seem to match. (listed connections = objectName_translateX, objectName_translateY, objectName_translateZ)

 

If I break connections manually, it shows the attributes as objectName.tx, objectName.ty, objectName.tz.  I tried storing these names and passing them into the disconnectAttr command, but it didn't recognize those names either. 

 

I also tried the names that are given when you manipulate the translateX, Y, or Z.  This name shows as objectName.translateX, Y, or Z.

 

Thank you in advance for the help.  It doesn't seem to be a hard problem since I already have the name and Keyframe information in the script.  I just can't figure out what information is required to break the connection.

0 Likes
4,217 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

Yay! I got it... and as I thought, it was simple.

 

In case any viewers are interested, here is the solution:

 

cmds.cutKey('objectName', time = (domain start, domain end), clear = True)

 

This breaks all keyframes within the specified domain for the specified object.  

 

 

Cheers,

Jake

 

 

0 Likes
Message 3 of 3

Anonymous
Not applicable

Moderator or similar, how about moving this to the Maya subforum...

 

/Matte

0 Likes