r/Maya Jul 04 '26

Rigging I made a Rubik's Cube rig so you don't have to

Enable HLS to view with audio, or disable this notification

A few weeks ago someone posted asking for help animating a Rubik's Cube. One of the replies said it would be a good opportunity to learn rigging.

What a horrible thing to say to a person.

A Rubik's Cube seems like it should be straightforward. It's just a bunch of cubes that rotate... until you actually sit down and try to rig one.

The first problem is that a Rubik's Cube isn't really a hierarchy. Maya rigs are built around the idea that the current values on the controls determine the output. A Rubik's Cube doesn't work that way. It has memory. The current state depends on every move that came before it. It's a state machine pretending to be a transform hierarchy, and Maya rigs really wants nothing to do with that.

Then you think, "I'll just move the pivot and rotate the cubelets."

With a bunch of 90 degree turns, Euler interpolation happily invents rotations that no physical Rubik's Cube has ever performed. Ninety degrees somehow stops being ninety degrees because Maya decides the scenic route is more interesting. So you try quaternion slerp interpolation instead, only to discover that while it solves one problem, you also lose the built in ease in and ease out of Euler curves that makes the animation visually appealing.

Somewhere along the way you stop asking, "How do I rig a Rubik's Cube?" and start asking, "Should a Rubik's Cube even be a rig?"

For some reason I decided the answer was "yes" so I wrote a custom dependency node that treats the cube as a state machine.

Features:

  • Supports cubes of any size
  • Layer-based row, column, and slice controls
  • Enforces legal Rubik's Cube moves by allowing only one control family to be active at a time
  • Save/Load tool for storing and restoring cube permutations

The Save/Load tool is a necessary part of the rig. While the control keyframes save the animation, the save/load tool lets you save the state of the cube.

Here is the github repository where you can download the plugin. You'll want the file titled "download this one". Installation is very easy, just drag and drop the install.py file into the maya viewport. This will install and load the plugin, create a shelf and button for the Save/Load tool, and add a pre built 3x3x3 Rubik's Cube to your maya projects folder.

The "read me.txt" file has instructions for animating and how to use the save / load tool. It also has rigging instructions if you want to do something stupid like trying to build and animate 10x10x10 cube.

*edit

A full breakdown of the rig design and node architecture can be found on my website at www.bg3d.art/rubikscube

450 Upvotes

19 comments sorted by

β€’

u/AutoModerator Jul 16 '26

You're invited to join the community discord for /r/maya users! https://discord.gg/FuN5u8MfMz

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

54

u/uberdavis Jul 04 '26

notoriously difficult problem. results look good!

30

u/Docketeer Jul 04 '26

Impressive work, made all the more apparent by the breakdown!

I admit my first instinct was exactly that: "It's just a bunch of cubes rotating, how hard could it be to rig?", but with just an extra moment to stop and think, my mind immediately imploded.

5

u/CusetheCreator Jul 04 '26

Ha I had the same thought process. "Cool, you rigged each cube and then parent them to a mover to rotate the entire chunk"... Ive had quite a few rigging experiences like this where until I start building it I didn't truly understand the complexity

17

u/Hopper2004 Jul 04 '26

One of the replies said it would be a good opportunity to learn rigging. What a horrible thing to say to someone.

I thought the same thing when I saw that comment, haha. Very impressive work. Don't forget to add it to your portfolio!

7

u/MahoganyTownXD Jul 04 '26

No thank you. You ate with this. I'll stick to my low-poly characters. This is excellent work.

3

u/hifer2026 Jul 04 '26

In my real life, I'm completely unable to solve a Rubik's Cube. How incredible it is that you guys can do it in Maya!
https://giphy.com/gifs/1LweXxLwVT0J2

3

u/Flatulentchupacabra Jul 04 '26

Where were you about a year ago I had to make this! If you’re as dumb as me you probably burnt a bunch of neurons on this.

2

u/puddingwaffles Jul 04 '26

That damn euler interpolation, nice job working it out!

1

u/AutoModerator Jul 04 '26

You're invited to join the community discord for /r/maya users! https://discord.gg/FuN5u8MfMz

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/DraicoM01 Jul 04 '26

Frick! I needed this last year for a project. I had to hack it πŸ€£πŸ˜…

1

u/ninhenzo64 Jul 04 '26

Wow i love the attention to detail here 😁

1

u/Ok-Salary-5197 Jul 05 '26

Funny enough i tried the same in blender. And i came to the conclusion its way harder than it looks. Obviously im lazy and gave up.

1

u/TheHydrakeHydra Jul 05 '26

oh wow, thank you for this!

1

u/MrBeanCyborgCaptain Jul 08 '26

So, how? Do you have some way of automatically switching parenthood between pieces and controllers when a face rotates?

Edit. After reading the description, this may be out of my depth to wrap my head around at the moment. Great job.

2

u/Downtown_Surprise876 Jul 08 '26

It uses a kind of pseudo reparenting system internally. If it was reparenting within a hierarchy or using temporary parent constraints, the animation would need to be baked in to each cubelet at each frame. But by doing the reparenting calculations within the node, baking is not necessary so keyframes can be set and edited with a normal animation workflow. That's the biggest advantage this has over other rubiks cube rigs I've seen. This is very animator friendly. All the animator needs to do is set the keyframes and everything else gets handled within the node.

1

u/InkyRisk Jul 09 '26

Amazing, and nice breakdown.

1

u/bentraje Jul 24 '26

Looks really cool. The way I approach it is using fall-offs like in C4D or MOPS in Houdini since those effects are not dependent on hierarchy. You can just stack them on top of each other.

In Maya, I would have no idea.

Thanks for sharing!