Reputation: 21
I am looking for a way to select a channel in Maya ( ex, Translate Y or Rotate Z or something like that ) instead of manually selecting a channel by using a mouse click-in attribute editor.
Does anyone know a script that allows me to do so?
Thank you very much.
Upvotes: 2
Views: 1047
Reputation: 2512
In addition of what say Andy, from my knowledge, you cannot find that. Im not sure what kind of manipulation you are trying to do but an alternative to setting a value with cmds.setAttr You can also find what is selected inside the channelBox with :
from maya import cmds, mel
gChannelBoxName = mel.eval('$temp=$gChannelBoxName')
nameObject = cmds.channelBox(gChannelBoxName, q=1, hol=1) # a lot of flags exists depending of what you are looking for
https://download.autodesk.com/us/maya/2009help/commandspython/channelBox.html
Upvotes: 0
Reputation: 58103
As far as I know, there's no command allowing you select a channel in Channel Box or in Attribute Editor (you should check Echo All Commands in Script Editor to test it).
You are just allowed to directly set (without selection) a value using this MEL command:
setAttr "pSphere1.translateY" 12 ;
or this way using Python command:
import maya.cmds as cmds
cmds.setAttr('pSphere1.translateY', 12)
Upvotes: 1