Python: Rubik’s cube

I’m far from a good coder. But I’m starting to love Python more and more. I made this Rubik’s cube generator with Python in Maya. I had a ton of fun making this. But also, very frustrating. Everything works proper, except if I animated the rotations. If two axis of a cube have keys, the rotation and placement will be meshed up. I can’t figure this out for now, but will have another try later.

software used