- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I'm working on a python plugin for Maya and have recently stumbled in automating this particular function. Used when working with a mesh with multiple joints the normal (manual) flow is to shift select all bones, and then in the channel box select translate X, Y, Z & rotate X, Y, Z and right click -> Key selected. I do this across multiple keyframes.
There feels like lots of room for optimisation in this manual part so I've wanted to automate it in Python, but looking at the MEL that runs when the user does this manually it looks very bulky. (below is an example from the script editor)
As you can see I'd have to run this for every joint but also for each type of joint, so those in the image are the rotate Z's but there are the other rotates & translates as well.
I'm able to get and select all joints in Python but using a for loop I'm not sure how to distinguish between each type required to be get and set (.tx .ty .tz .rx .ry .rz). Any help on how to proceed would be greatly appreciated, thank you.
joint_t_r = [tx, ty, tz, rx, ry, rz]
for each keyframe
for each joint
for each in joint_t_r
select each, key joint
above is kind of what I'm after, I think ahah
Solved! Go to Solution.