Quantcast
Channel: mel wiki
Viewing all articles
Browse latest Browse all 610

How can I deselect highlighted channels in the Channel Box?

$
0
0
Had an animator request a way to deselect any highlighted channels in the channel box: I could find no way via the channelBox command to do this. The docs list it having a -select flag, but when you try to run it, the command says it's unsupported.

I came up with the below hack: You can't simply deselect\reselect the current nodes via code to clear the channel box highlighting (but it works doing it by hand): Maya will keep the channels highlighted. But by running an evalDeferred on the reselect, it'll clear the highlighting.
# Deselect the highlighted channels in the Channel Box
import maya.cmds as mc

reselectMe = []

def doReselect():
    global reselectMe
    if reselectMe:
        mc.select(reselectMe, replace=True)

def deselChannelBox():
    global reselectMe
    reselectMe = mc.ls(selection=True)
    mc.select(clear=True)
    mc.evalDeferred(doReselect)
    
deselChannelBox()

Viewing all articles
Browse latest Browse all 610

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>