Hey there,
I'm trying to write a simple script in MEL, at least I hope it's simple, to select a series of joints, toggle select the translate and rotate attributes from the channel box, and then bake simulation (because I want the simulation to only bake those attributes). Does anyone know how to grab those attributes from the channel box? Or a way around that?
Thanks in advance
*edit*
At the current moment I'm grabbing all the values I don't want and locking them, which would work fine. Still curious about the channel box thing though, might be useful for other scripts.
Replies
As far as I know, there is no way via MEL commands to highlight a channel within the Channel Box.
However, if want to always key a specific channel, you can do that without having to highlight anything. You can use [object name] + .tx, .ty, .tz, .rx, .ry, .rz, .sx, .sy, .sz for creating keyframes. So, setKeyframe "joint1.rx"; will key that channel without having to do anything with the Channel Box. Also select "joint1.rx"; should select the actual channel, but will not highlight in the Channel Box.
Are you just trying to avoid baking keyframes to channels that have no animation data?
Basically when I bake the simulation I want to make sure it doesn't bake anything into scale for the bones, or try to bake any other channels other than translation and rotation, and I want to do this despite what the animator's current settings are for bakeSim. I have a decent setup right now that grabs the skin bones and bakes them with an arg list, was just curious about the channel box thing for future reference.
Other way to do it is just write down the settings and steps and make them do that, but I thought I'd be nice and set up some kind of automated solution so they can just finish the animation, hit the "bake dat shit" button, and have it bring up the export dialogue with the right fbx settings.
I use Python, but I get nothing when I run
mc.channelBox('mainChannelBox', e=1, select='translateX')selection = mc.channelBox('mainChannelBox', q=1, selectedMainAttributes=1)print selection
Can anyone see what I'm doing wrong? Thanks a lot