Trace: » blender_plugin » giselle
Giselle
Introduction
Giselle (working title) is a procedural animation system engineered to the principles outlined in Stephen May's 1998 PhD thesis "Encapsulated Models: Procedural Representations for Computer Animation" and his resulting project AL. It is based around the Lua language, there are many reasons for this choice, among them…
- Speed - Lua is very fast to evaluate, which when dealing with larger scenes will be important.
- Expressiveness - Lua has many useful language features, such as functions as first class values, metatables, etc.
- Simple API - it's very easy to extend and Lua and use it within a larger application.
There are a few low level constructs in the underlying framework that make the system work, mainly the Model and the Avar. A Model is the encapsulation of scene data, i.e. geometry, surface specification, properties etc. and the Avar is a control mechanism for animating those models.
A Model consists of a body of Lua code that is executed in a custom Lua interpreter to produce renderables. Renderables are simple low level primitives that can be interpreted by a renderer implementation to produce a visual representation of the model. Renderables are categorised into two types, gops and gprims. A gop is a renderable that modifies the state, such as a transformation or material specification, a gprim is a geometric primitive that can be rendered by the renderer using the current state. The renderable list that results from evaluating the world Model is a set of instructions to a renderer that is in itself a state machine, much like OpenGL or RenderMan. Using this intermediate representation has a couple of major benefits, firstly the system is able to perform intelligent caching of the renderable lists produced by individual models, avoiding re-evaluation. Secondly, Giselle can use multiple renderable command lists to automatically deduce motion information and, where appropriate introduce motion blur if available. This means that there is no need to consider motion blur in the body code of the Models, as you would when writing RIB by hand.
An Avar is a function of time, it provides a value given a current time that can be used in the body of a Model. This way, the specification of the animation of a model is separated from the model itself, allowing coders to produce the encapsulated model, with various exposed avars, and then allow an animator to animate the values of those avars to create the final animation. How an avar works internally is flexible, all that's required of an avar is that given a time, it will provide a value, and that the value will be the same if the same time is passed again. Currently Giselle only implements avars as keyframe lists, with interpolation (linear only at the moment), but other implementations of avars could provide purely procedural generation of data, or read values from external sources.