Hey!
If you select an object in Maya and highlight an attribute in the channel box, key ticks will be displayed on the timeline only for that attribute. I'd like to achieve the same result with a script (i.e. not needing to highlight the attribute in the channel box), but I can't find any way to do it. I can select the appropriate animation node and see just those key ticks, but I want to retain control of the object itself in the viewport at the same time.
Does anyone know how to achieve this?
Thanks!
Solved! Go to Solution.
Hey!
If you select an object in Maya and highlight an attribute in the channel box, key ticks will be displayed on the timeline only for that attribute. I'd like to achieve the same result with a script (i.e. not needing to highlight the attribute in the channel box), but I can't find any way to do it. I can select the appropriate animation node and see just those key ticks, but I want to retain control of the object itself in the viewport at the same time.
Does anyone know how to achieve this?
Thanks!
Solved! Go to Solution.
Solved by Kahylan. Go to Solution.
Hi!
This is a python script that highlights an attribute by name in the channelbox:
import maya.cmds as mc
def selChannelInBox(c = ""):
sel = mc.ls(selection = True)[-1]
mc.channelBox("mainChannelBox", e = True, s ="{0}.{1}".format(sel, c))
selChannelInBox(c = "ty")
I hope this helps!
Hi!
This is a python script that highlights an attribute by name in the channelbox:
import maya.cmds as mc
def selChannelInBox(c = ""):
sel = mc.ls(selection = True)[-1]
mc.channelBox("mainChannelBox", e = True, s ="{0}.{1}".format(sel, c))
selChannelInBox(c = "ty")
I hope this helps!
Thanks so much for this! It's exactly what I was looking for! 🙂
Thanks so much for this! It's exactly what I was looking for! 🙂
Actually, could anyone explain how the "s" flag in channelBox() works? It isn't mentioned in the documentation for some reason! @Kahylan
I'm trying to work out how to select multiple channels.
Actually, could anyone explain how the "s" flag in channelBox() works? It isn't mentioned in the documentation for some reason! @Kahylan
I'm trying to work out how to select multiple channels.
The select Flag was introduced with the interface change from Maya 2015 to 2016, so it's not in the 2011 doc that first shows up on google.
https://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/CommandsPython/channelBox.html
To select multiple attributes you just need to insert a list of strings with attribtue names instead of a single attribute name in the s flag
The select Flag was introduced with the interface change from Maya 2015 to 2016, so it's not in the 2011 doc that first shows up on google.
https://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/CommandsPython/channelBox.html
To select multiple attributes you just need to insert a list of strings with attribtue names instead of a single attribute name in the s flag
Hi,
The -s/-select flag selects the attribute in the channel box.
Ooops, I see @Kahylan has already answered. What they said! 🙂
Hi,
The -s/-select flag selects the attribute in the channel box.
Ooops, I see @Kahylan has already answered. What they said! 🙂
Can't find what you're looking for? Ask the community or share your knowledge.