2

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.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
MCoo k
  • 21
  • 3

2 Answers2

1

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)
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
0

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

DrWeeny
  • 2,487
  • 1
  • 14
  • 17