Tutorial: Automated Stop Motion¶
Stop-motion animation creates a motion picture by capturing each frame one at a time. It brings to the forefront the central illusion of film or video, that of the moving picture created from successive still images. Traditional stop-motion involves laboriously moving every element of the scene and characters by hand. This tutorial explores the automation of the stop-motion process by programming an automated scene to advance position-by-position, capturing each instant of time separately.
Objectives: At the end, you should be able to do the following:
- design a simple scene in which every element can be automated or passively controlled.
- compose a motion program for an armature with two or more degrees of freedom, including the possibility of exceeding normal actuator speeds.
- set up and use a computer-based camera interface
- configure the image capture system for manual control for consistent frame-by-frame exposures
Deliverables: please finish setting up your scene and shoot a short video (e.g. 10 seconds) using a lab Sony a6000 camera and Blackmagic Ultra Mini recorder. The video should emphasize a visual choreography created using programmed motion of on-screen or off-screen mechanical armatures, captured frame by frame.
The video should be uploaded to Vimeo and embedded in a short blog post. Please assign all group members as authors on the post. This is due Monday at 5PM.
Please have your workstation cleaned up and all materials put away prior to the start of class next Tuesday.
Warmup: Servo Calibration¶
Physical hardware can change, so it can be useful to calibrate a servo system so it can be controlled using precise angles. This improves the chance of an animation program continuing to work as the hardware is revised.
We will assume that the servos are linear and apply a linear scale and offset to map an angle value in degrees to a command value. On the hardware side, the commands are measured in microseconds of pulse width.
Servo Interface Setup
The next steps involve the routine setup of the hardware servo interface and loading an example patcher into Max.
- Set up a Mini Maestro board with up to six servos, a 5V power supply, and a USB connection to your computer.
- Download and unpack servo-calibration.zip. You should now have a folder named
servo-calibration
with several files. - Load the
servo-calibration.maxpat
patcher into Max. - Select the correct serial port to connect to the Maestro. It may be helpful to click ‘Rescan ports’ and check the Max Console window to see which port is the Maestro command port.
- Use the slider interface to make sure that each servo can move properly.
Calibration Process
- Click the button labeled ‘Center all channels’ and adjust the offsets until the physical positions are correct.
- Move all channels to each fixed angle and adjust the scale values.
- Save the settings. This will update the calibration.json file for your hardware. This is a text file written by a pattrstorage object.
The calibration file will be reloaded the next time the patcher is loaded and the values should remain good until the servos are physically adjusted.
Stop Motion Programming in Max¶
Getting Started
- Download and unpack animation-tutorial.zip. You should now have a folder named
animation-tutorial
with several files. - Load the
animation-tutorial.maxpat
patcher into Max. - Use the controls at the bottom-left corner to select a camera and capture size.
- Turn on the monitoring to preview the camera view.
- Configure the desired number of frames. The frame grabber keeps all raw images in memory, so the maximum is limited to a few hundred frames.
- The default patcher effectively implements a time-lapse camera; clicking Record will begin grabbing images at 2 Hz to build a sequence. Click Stop to pause.
- Rewind and Play will show the sequence at the full frame rate. exportmovie will open a dialog to write the sequence to a movie file.
Controlling the Scene
The grabber is designed to co-exist with motion control patchers. It uses a simple message protocol to communicate between the frame grabber and the animation controller which moves the physical hardware. A simple example is included in the subpatcher animation-scene-control. For each frame, a prepare-frame message is emitted on the scene channel specifying the frame number. The scene controller can then move all motors to the correct position and respond with a frame-ready message on the scene channel. The grabber will then capture the image and continue.
In the example subpatch, positions are computed for six servos and sent as messages, assuming that the servo-calibration or similar patcher is also running to communicate with the physical hardware. The hobby servos are open-loop and thus it isn’t possible to measure when they have settled at a target position. The example simply waits for a constant settling time to ensure the materials have come to rest. This is a parameter you may wish to tune for a particular scene.
Note that the scene programming can be arbitrarily complex; you may wish to build a keyframing interface, or a generative system, or some combination. The one requirement is that it can accept a frame index, possibly in arbitrary order.
If you are careful with your scene programming, you can include a test mode for previewing with continuous motion to speed up the process of tuning the choreography. The same trajectories can then be used to move and stop per frame in order to get a stop-motion look with no motion blur.
Shooting a Sequence
For visual consistency it is important for the camera to apply the same settings to every capture. This requires disabling all automatic operation so the camera does not change exposure or focus during the shoot.
As always, it is crucial to control all light sources. However, the typical stop-motion shoot is considerably longer than live-action. Care should be taken on a hot set not to disturb any light or shadow for good continuity.