I'm a newbie on Maya programming.
I'm trying to make a script to check and template/untemplate a channel.
I have a transform node opened in graph editor called 'SKEL01_002:main_C_001_CTRL'. Then I select 'TranslateX', and still in graph editor I go to CURVES --> TEMPLATE CHANNEL
I can list the Curves with:
listening with echo all command, you see it prompt :
doTemplateChannel graphEditor1FromOutliner 1;
whatIs doTemplateChannel; , you can see it prompt the mel procedure : // Result: Mel procedure found in:
finding the proc, you can read another obscur proc called : expandSelectionConnectionAsArray
doing a whatIS, you find :
cmds.selectionConnection('graphEditor1FromOutliner' , q=1, object=1) # Result: [u'pSphere1.translateX'] #
returning to the doTemplateChannel.mel, the command to find the animCurve node is :
cmds.listConnections('pSphere1.translateX', type='animCurve') # Result: [u'pSphere1_translateX'] #
And at the end, the command to template/untemplate :
cmds.setAttr( 'pSphere1_translateX.ktv', l = 1) # use 1 to lock and 0 to unlock
I hope it will help you ton find all next command that are not prompted ^^