I was excited to start teaching at VFS, through some bumps in the beginning, I’m hoping that I’ve got them talking about rigging a panther to start. One of the students have asked about rigging a transformers. So I’ve got in my mind a transforming object, and so I’ve made this:

I hope this will inspire the students to create content for their social network with, and that rigging can be helpful in achieving that.
This is a simple effect based on a 0 to 1 driver to distance translation:

And then offsetting the set driven key-frame animation through code as there are 1000 cubes and their respective joints that needed to be moved in this digital choreography:

This was a simple exercise in testing my assumption on how Maya could handle 1000 skinned objects in a scene. And then also testing assumptions on how differently the MEL scripts performs against Python script on selecting and changing key-frames.
Verdict? selectKey is handled differently!
The math operation is rather simple: count the iterated index against the total size of the list of cubes.
This results in a very heavy scene proving once again that when dealing with high count of skinned objects in a scene, even with the newest Maya version 2024 is still spotty at best!
#...assumption: idx, jnt_length, and jnt_name variables are set beforehanddigit = (idx/jnt_length) /1
print(f"{jnt_name}: {digit}")
#...translationmel.eval(f"selectKey -k -f 1 {jnt_name}_translateX ;");
cmds.keyframe(animation='keys', option='over', absolute=True, floatChange=digit);
mel.eval(f"selectKey -k -f 1 {jnt_name}_translateY ;");
cmds.keyframe(animation='keys', option='over',absolute=True, floatChange=digit);
mel.eval(f"selectKey -k -f 1 {jnt_name}_translateZ ;");
cmds.keyframe(animation='keys', option='over', absolute=True, floatChange=digit);
#...scalemel.eval(f"selectKey -k -f 1 {jnt_name}_scaleX ;");
cmds.keyframe(animation='keys', option='over', absolute=True, floatChange=digit);
mel.eval(f"selectKey -k -f 1 {jnt_name}_scaleY ;");
cmds.keyframe(animation='keys', option='over',absolute=True, floatChange=digit);
mel.eval(f"selectKey -k -f 1 {jnt_name}_scaleZ ;");
cmds.keyframe(animation='keys', option='over', absolute=True, floatChange=digit);
For your consideration, I’ve included the zipped file here: