Generating films from 3D animations requires knowledge in cinematography (camera placement, framing and lighting) and editing (cutting between cameras). In applications where the user is already engaged in other tasks, such as playing a game, directing virtual actors, or narrating a story, it appears desirable to build systems that can make decisions about cinematography and editing and automatically generate a grammatically correct movie according to film grammar. In this paper, we introduce a framework for generating a well-edited movie based on the rules of film editing. Specifically, our system computes a sequence of shots by simultaneously choosing which camera to use, when to cut in and out of the shot, and where to cut to. We cast film editing as a cost minimization problem in the space of possible shot sequences and provide an efficient search algorithm. The method is illustrated with multiple edits of the same footage in different editing rhythms and styles.