def reset(): ''' Removes and restores the original attribute state of the selected channelbox attributes. If no attributes are selected, it operates on the entire object ''' selAttrs = selectedAttributes.getChannelBox(animatableOnly=0) for attr in selAttrs: resetAttributeState(attr, 1, 1) selAttrs = selectedAttributes.getChannelBox(selectedOnly=1) if not selAttrs: for object in cmd.ls(sl=1): if object not in selAttrs: resetNodeState(object, 1, 1)
def lockHideSelected(lock=True, hide=True): ''' Locks and/or hides the attributes selected in the channelBox. ''' if not lock: lock = -1 if not hide: hide = -1 selAttrs = selectedAttributes.getChannelBox(animatableOnly=0) for attr in selAttrs: lockHideAttribute(attr, lock=lock, hide=hide)
def syncGraphEditor(): """Syncs the attributes selected in the channelBox to those in the graphEditor. I don't know of any way to select channelBox attributes, so I have not been able to implement the equivalent syncChannelBox.""" # Get channelbox attributes attributes = selectedAttributes.getChannelBox(expandObjects=False) # Clear graph editor attributes selectionConnection = selectedAttributes.getSelectionConnection() cmd.selectionConnection(selectionConnection, e=1, clr=1) # Select channelbox attributes in graph editor for attr in attributes: cmd.selectionConnection(selectionConnection, edit=True, select=attr)