PDA

View Full Version : channelBoxCommand in python?


StefanA
09-14-2009, 08:38 AM
Hi All,

I'm trying to figure out how to use the 'channelBoxCommand' under python. Reason being that I want to minimize the undo stack with having it just be 1 undo as it is when you do it manually (and if you exectute it with Mel).

Mel example that gives you just 1 undo
channelBoxCommand -key;
setKeyframe "pCube1.tx";
setKeyframe "pCube1.ty";
setKeyframe "pCube1.tz";

my first attemp was
import maya.cmds as c
c.channelBoxCommand(key=True, setKeyframe=["pCube1.tx","pCube1.ty","pCube1.tz"])
so that didn't work since channelBoxCommand doesn actually exist under python :)

Anyhow, any takers?

regards
stefan andersson

s0ke
09-14-2009, 04:19 PM
c.channelBox( 'your code' )

StefanA
09-15-2009, 11:43 AM
channelBox and channelBoxCommand isn't really the same thing. But I've solved it.

import maya.mel as mel
mel.eval('channelBoxCommand -key; %s' % command)

and the 'command is the objects and channels you key. The tool I've written can be downloaded here http://sanders3d.blogspot.com/

CGTalk Moderation
09-15-2009, 11:43 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.