130 likes | 144 Views
eMuse is a language and 2D animation framework that allows screenplays to be written in a natural language syntax. It provides a simple and extensible environment for creating animations. The generated Java source code animates the screenplay using an animation framework. With eMuse, writers and directors can easily create and visualize their plays before they hit the stage.
E N D
eMuse Mark Ayzenshtat Elena Filatova Kristina Holst Vlad Shchogolev “Rapid Screenplay Prototyping Language”
Motivation • Screenplays can succeed on paper but fail on stage. • Screenplay is the natural blueprint or “source code” for a play. • Writers and directors couldn’t care less about loops, functions, scope, etc.
Overview • eMuse is 2 things: • a language • screenplay-like syntax • allows more-or-less free-form English • a 2D animation framework • simple: stick figures with superimposed images • extensible: custom behaviors
Source Structure • Title / Author • Definitions • Characters • Props • Settings • Each of these is typed (e.g. Romeo: LovesickTeenager) • Exposition • Dialogue • Actions
Syntax • As close to the syntax of a play written in natural language as possible, e.g. • Authors’ names • All possible formats can be accepted Stephen A. Edwards, Sasha, etc • Action format might include any combination (all combinations are parsed by one rule) • Direct object • Preposition • Indirect object • Adverb Francisco (appears on stage), Bernardo (takes sword), Francisco (appears away quickly)
Illegal Semantics • eMUSE has quite simple semantics • No scoping • All variable names must be unique Romeo: <Young noble guy> Romeo: <Old peasant> Juliet: (kisses Romeo)
Semantics (cont’d) • eMUSE has quite simple semantics • Characters and Props mentioned in the actions should be defined Character Romeo: <Young noble guy> Prop Book: <The Dragon Book> Definitions Juliet: (hits Romeo with Book) Exposition
Default eMuse Compiler Screenplay Java Compiler • Two halves: • Lexer, Parser, Semantic Checker • Back end: OutputGenerator • Just an API – an interface – lots of different implementations possible • Default Implementation: Java source code
Java Output Generator • A Java Model API • Models classes, methods, modifiers, etc. as Java objects. • Not This: writeSource(“public class Foo {”);But This: Class c = new Class(“Foo”); c.addModifier(Modifier.kPublic); … sourceWriter.write(c); • Advantage: generated source is readable, consistent
Java Output Generator (cont’d) • What does the generated Java source do when compiled and run? • Answer: Animates the screenplay using our Animation Framework
Animator Design • Two basic entities derived from parse tree • Actions • Stage objects • Actions occur over discrete time intervals • Stage objects are organized in a class hierarchy
Animator Design (cont’d) • Affine Transformation • Composition of matrix multiplicationsdefine transformation of local to global coordinate system. • used to construct scene graph in which individual objects can be manipulated from any node in the scene graph Global Local
Actual Screenshot Dubya shares a serene moment with Prof. Edwards.