Project 3: Magic Box & Projections
Jumping into project 3, we are required to create a 'magic box' with something related to our interests inside. We are also required to film our own plates with a chosen box, which using Maya and Nuke, we will open the box to reveal something inside. The project will utilize different techniques such as 3D tracking, basic modeling and shading, and the use of render layers in compositing.
Live Plate & Camera Tracking
For the project, I planned to fill the box with origami cranes. Origami was a major obsession of mine throughout my early teen years, plus the intricate and ornate graphics in origami paper would definitely help liven the plate. Once the box is opened, one of the cranes will fly out.
​
The plate I chose to film used styrofoam walls (which I planned to replace in 3d), cardboard and a small cardboard box. This allowed me to be versatile thematically; there is not much personality or identity within the plate, allowing more possibilities for the project.

To create a 3D camera from the original plate, I used standard 3D tracking techniques in Nuke. Beginning with a CameraTracker node with 250 points, I simplified the points based on their error, followed by setting specific tracks to the X Y and Z planes-- which was easier based on the plate I am using. I then added a few cards, rotating where necessary to line them up with the plate. Lastly, I exported the scene as an FBX to bring the track into Maya.





Plate Cleanup
After bringing the FBX to Maya, I began analyzing the plate to see how to model the box in order to prepare for compositing. The physical box has flaps attached to the lid that fold / tuck into the side of the box. For the sake of saving time in modeling, I wanted to edit the plate to get rid of the exposed flaps.
​
To do this, I first tracked the location of points on the box. I then used roto shapes along the edges of the box, transformed using the tracking data. There were some minor slips in the track, so I keyframed an extra transform node to set the cleanups in place.


Before- flap on edges of box

After- flattened front of lid
Box Modeling & Animation
With the plate cleaned up and the cameras matched, I needed to begin modeling the box as well as make small adjustments to the walls/ground alignment. Because the box material will only be visible on the inside, the modeling of the box was done slightly imperfectly; however, by uncleanly moving the vertices to the position of the plate's box, the plate can be projected onto the mesh directly. I also made sure to model the lid separate from the box mesh as it will be animated.



Crane Rigging
Now that I had a basic setup of the box, I started creating the objects that will bring the scene to life. To save time, I purchased a very simple model of a crane to start with. With the model, I made some adjustments to the mesh, set up the UVs in Maya and created extra subdivisions.


The plan for the animation was to have the crane fly out of the box. I only have a bit of experience in rigging, though I was able to create a simple rig to be able to keyframe the pose of the crane. I also added an empty axis to control the overall position.


I then added cranes to the inside of the box. I originally approached this with Maya's MASH dynamics, however as the results were relatively uncontrollable, I was unhappy with the look. Instead, I manually moved each crane into its position. MASH and Maya's bullet solver were interesting side explorations nonetheless. Also, the animation at this point does not include any wing flap animation (yet!).
​

Crane Texturing

To develop the shaders of the cranes, I found free downloadable templates for origami paper to use as the base color. I also found an additional texture to use in the bump, hopefully creating a paper-like quality. For the gold foil crane(which later I converted to a silver color), I utilized this source's texture maps for the bump.
​
To help bring more life to the plate, I utilized 7 different crane shaders each with a similar setup in the hypershade. Here are the setups for both the paper cranes and the foil crane:


Paper


Foil
Render Layer Setup
Now with the models and shaders roughly set up, I began setting up the layers for compositing. Much of this process was unclean trial-and-error until I got the layers I needed. I started with the obvious, being to separate the cranes to their own layer, then adding a mask for their shadows. I also created a few variations of masks with the box to control the layering of elements.



Clean Plate
Test Comp
Box Interior
in the test comp shown above, the interior of the box needs to be given a cardboard-like material. Because the box is somewhat blurry in the plate, I approached this in two different layers; a flat render using the generic standard surface, then another with a cardboard texture. In Nuke, I will then merge the layers together to flatten the texture-- as opposed to blurring the texture, using a lower quality texture, or blurring it in Nuke.​​
​
Here is the very basic material setup for the cardboard, as well as the two layers merged together.





Merging the two layers together helps to avoid the foggy look a typical blur would cause, also giving me more control over the color and textural quality. The cardboard texture I used could have been different, however it was the closest match I found in terms of having no ridges or tearing.
Crane animation
To create the animation for the crane flying, instead of keyframing the wings themselves, I approached this by keyframing the overall position and using Maya's expressions within the joints.
​
Using a sin() wave, I can control the rotation of the wing's joints based on the frame number. To give the wings a more flexible appearance, each of the joints throughout the wings are assigned the same expression, just with varying amounts of degrees the joint rotates in. For instance, joints closest to the body rotate more degrees than further out.


Final Render Layer Setup
After some experimentation for what layers I would need, here are all the render layers I am using for the comp:
- Shadow for stagnant box
- Shadow for moving lid
- Masks for different parts of the box to preserve the original
- Occlusion
- Exterior of box with materials projected from plate
- Interior of box with built materials
- Shadow of cranes in box
- Plain box with standard surface
- Environment to replace walls
- Cranes in box
- Animated crane
