This script has an embedabble UI, click for an installation video tutorial Watch a quick demo video about this script

Creates and animates a Rubik Cube.

"Name Your Own Price"
You can pay anything you want, the amount displayed in the cart is only a suggested amount.
View Cart

RubikCube This is a new version of this script Compatible with After Effects CS3Compatible with After Effects CS4Compatible with After Effects CS5

Version: 2.0   Sign up to be notified by email when a new version of this script is posted

This script creates and animates a Rubik Cube.

Some fun trivia

Researchers just concluded that every position of Rubik’s Cube™ can be solved in twenty moves or less. http://www.cube20.org/

Version History

  • v2.0 (Aug 2010)
    • New interface
    • User-defined faces (comps or footage files); the script takes care of the resizing, splitting,… of each face
    • CS5 compatibility
  • v1.2 Initial release on aescripts.com (Sep 2009)

Last updated August 25th, 2010
7,008 views
Tags: , , , , ,

About the author

My name is Charles Bordenave and I am currently located in France. I started working with After Effects in 2005, when I was a PhD student in computer science at Montreal. My interest quickly converged to expressions and scripting. Nowadays I'm regularly hired on a freelance basis by production studios focussed on tv broadcast, cartoon animation, motion graphics or cinema. My job usually consists of developing customized automation tools for After Effects.

Pingbacks

    35 Comments

    • Lloyd,
      Was there supposed to be a companion resource file with the script?
      The download contained the script only.

      Thanks,
      J

    • i just downloded Rubick scripts, but not contains scripts companion and RBK files, can u send me it plz, thanks

    • Hy
      I been having some trouble using this script. actually i haven’t been able to use it at all.
      could you release a small manual to it?
      Thank you – Ran Ben Avraham.

    • Hi

      I would like to know if it´s possible to create a box with its faces divided not only in 3×3 pieces, if it´s possible to make faces divided in 4×4 pieces, or even in 4×3 pieces.

      Thank you very much

    • amazing script!!!!!
      but i have no idea how can i replace the faces!
      when i try selecting an solid…i use rubik replace source but say me need 54 files!
      54 file ??? if the faces are 6 ….
      any help?

    • The download now contain all the companion resource files.

    • Hey i just got this script yesterday and im lost on how to use it. can some one please help!!!

    • Really good idea and much work to create this script….
      But -sorry- its too complicated for me.
      I dont know how to use the “Rubik_ReplaceSources.jsx and i must have 54 pictures to replace?!?!
      Better possible way: At the beginning, the script ask me for 6 pictures or videos (for each side one) and automaticly devides up each into 3×3 mini-cubes.

      Greetings
      Wolle

    • Here are the main steps for creating and animating a rubik cube with your own images/videos:

      1) Prepare your images (for the cube faces):
      * since each face is formed by 9 small images (3×3 grid decomposition), you need a total of 54 image files
      * this step may be painful, but it is made very easy -couple of seconds- by SplitImage.jsx (cf my scripts list). the mini-images will be positioned like this (when they replace the solids):
      im1—im2–im3
      |……….|……..|
      im4–im5–im6
      |……….|……..|
      im7–im8–im9

      * place these files in a dedicated folder

      2) Execute the RubikCube script…specify your settings (click the help buttons and look at the sample animation file for more details)…click on Proceed

      3) In the project panel, select the blue+green+orange+red+white+yellow solids (9 for each color), and execute the ReplaceSources script. When it asks for a folder, select the images folder. The Rubik Cube animation is contained in the “Rubik Comp”.

      Hope this helps.

      @Wolle: perhaps in a future version ;)

    • Maybe it’s not obvious to me–but how do I get the result of SplitImage.jsx into a folder. I can easily split up an image into a 3×3 grid that gets placed in a new composition. But how do I turn each of those pieces into separate .jpg files? Thanks!

    • The thing I don’t understand is that if I rotate C1 @ +90 and then rotate it @ -90, it continues to rotate in the same direction. Undoing my previous rotation is the only way I know to solve it.

    • @David: place your image in a 1-frame comp, then select this comp in the project panel and use SplitImage to decompose it in a 3×3 grid. Look at the project panel, a new folder (“Tiles – theCompName”) has been created, it contains the comps you need to render…

      @Peter: looks like a bug, thanks for reporting that.
      EDIT: I’ve found and fixed the bug. I’ll upload the new version soon…(this week-end)

    • Thanks for that. Actually, I might have another one for you. Try making a comp longer than 30 seconds. For me, it makes things go a little haywire. Thanks for responding though.

    • Loading of the rbk file file is not working. Although its creating the composition, its not setting up and animating the layers of the cube. I am on AE CS3 win xp 64bit. Any suggestions on this issue?

    • Love the script. Making some changes to the script to fit a 1280×720 comp. So in script editor I changed G.CUBE_COMP_W = 427; G.CUBE_COMP_H = 240 and the position to make the cube work. My only problem is the sides of the sides of the cube. Since the cube is not square now the sides are too long. I am looking for a way to change the side walls of the cube to a different size then the g.cube_comp width and height, any suggestions?

      Thanks

      Aaron

      • You don’t have to edit the script, use the Settings dialog to set the comp size (1280×720), and the cube size (720 for instance).

        • That was the first thing I tried. I didn’t mention I’m trying to divide the 1280×720 frame equally by threes. Which leaves me with a uneven cube. So I need to create a custom sized cube. I am going to try to make my own cube tommorow and study your script and customize that.

          Thanks for your reply.

    • So my understanding of scripts is a very basic understanding so I am having trouble pulling this off. I guess I am trying to write a variable that will make the sides of the cubes a different size then the top, bottom and front.

    • So I solved my problems, but ran into another problem. When I use the replace rubix script it replaces all the solids besides the red solids for the cubes. I get an error message each time it gets to the red solids.

    • Love this script, having a lot of fun with it. Once the Rubik comp is created, is there a way to change the rotation values, or does a new comp need to be created with the script?

      Thanks,
      Chris

    • I have version 1.1 and i just downloaded and used this new version 1.2 and i do not see any different…I can use cube only from front side but i want to put it in the 3d space…how i can do it?….

    • This script is definitely not working under CS3 (8.2) WinXP64. I tried it several times. Although its starting creating the compositions, its not setting up and animating the layers of the cube. The “renderbar” at the bottom always stops at about 5%. I installed the Demo of CS4, and here it is runnig perfectly. Any suggestions/same experiences?

    • So, what settings would you use if you want each cube face to be 200×200 pxls?

    • Why make a script, offer it for free and no one knows how to us it? Please explain how to make the sliced up image fit the faces.
      Thanks.

      I would like to appreciate your work if I can use it.

    • Hi, nice script! Works well on CS4, couldn’t get it to work on CS3 either.
      Another thing: I noticed that once I set up a cube size of ie. 720 x 720, with 240 x 240 individual cubes, the sides of the cubes merge together and overlap. Also tried 600×600 with 200×200 sized smaller cubes, same there. The default (300×300 and 90×90 or in my case 100×100 b/c I don’t want the gaps) works.

      Any ideas?

      Thanks again for the nice work!

    • How exactly do you up tin the rotation values? I see the C1 R2 C2 R3 but what are you supposed to put in for that?

    • Has anyone had any luck with this script to produce some great results? I’d be interested in seeing some of the combinations and settings people have put to use.

    • Very cool scripts. Replacing with a custom image requires a bit of work, but it does work. Follow the steps above, but make sure the 54 files in the directory are named in order. Charles, you have a bug in your Rubik_ReplaceSources.jsx file. The block in which you iterate through the selected items, the index is off by one. It should read like this:

      if (selItems[i].name.indexOf(“Red”) != -1) selItems[i].replace(files[1 + redOrder[r++]]);
      else if (selItems[i].name.indexOf(“Yellow”) != -1) selItems[i].replace(files[10 + yellowOrder[y++]]);
      else if (selItems[i].name.indexOf(“Green”) != -1) selItems[i].replace(files[19 + greenOrder[g++]]);

      else if (selItems[i].name.indexOf(“Orange”) != -1) selItems[i].replace(files[28 + orangeOrder[o++]]);

      else if (selItems[i].name.indexOf(“Blue”) != -1) selItems[i].replace(files[37 + blueOrder[b++]]);
      else if (selItems[i].name.indexOf(“White”) != -1) selItems[i].replace(files[46 + whiteOrder[w++]]);

      After some trial and error, I found that the script worked with this edit.

    • Hi ! Thnx for this great script ! I’m having some trouble with the image replacing. Script returns “Unable to execute at line 25.Function folder GetDialog is undefined”. I’ve first selected all the cube side images in the solids folder and than run the script. Am i doing something wrong ?

    • In version 2.0, faces are user-defined elements (look at the UI at the top of the page….).

    • Ok . Wow! That’s great! Thanks! I had actualy downloaded the script, but was still running the old one…. :)

    • Hi, I’m still having a problem with the script. When it’s allmost finished I keep getting this error.
      “TypeError:Undefined is not an object” The animation is working but i’m missing some blocks at the back of the cube and the master rotation isn’t working.

    • Sorry, figured it out….. Not enough key times……

      Yes, I am ashamed….

    Leave a comment

    (to reply to a specific comment use the link by the comment)