One of the most powerful features of Lightwing is its ability to natively render animated 3D objects created with Blender. Blender is an open source tool for authoring custom 3D models with animations. These models are then used in script files where they can be positioned, scaled and rotated using script commands. This example uses the position and scale options on a single object model of a rotating sphere named SphereSpin.
The first parameter of the object command defines the file name of the object file. An extension of .pod is assumed. The time, rate, loop, fade, position and scale options all work the same as they do for the text, ticker and box commands. Notice that the time duration (second) parameters to the time options are zero for the object commands. This has a special meaning; the object’s time duration will be whatever time remains for the page.
The rate option overrides the default animation speed of the object which would otherwise depend on the time duration of the object. The loop option causes the object’s animation to be played continuously, and the reverse option causes the object’s animation to be played in reverse.
The scale option allows objects to be reused at different sizes. Scaling factors less than 1.0 reduce the size of objects in the x, y, z directions and values greater than 1.0 increase their sizes.
The image option defines the file names of images that are displayed on the object. Objects may have default images defined in the object file, but this option overrides any such default images. The file type is indicated by the extension and can be .jpg, .png, .pvr or .bmp. The default is .pvr.
Refer to the online Scripting Guide for more details about these commands.
// Scripting Tutorial - Objects version: 1.0 page: Mercury time: 1, 5 image: PlanetMercuryBackground.pvr text: OpenSansBold_100 time: 1, 0 align: CenterCenter fade: 1, 1 position: 50, 50 type: "Hello Mercury!" object: SphereSpin time: 0, 0 rate: 10 loop: on fade: 1, 1 position: 10, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa1 object: SphereSpin time: 1, 0 rate: 10 loop: on fade: 1, 1 position: 90, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa2 object: SphereSpin time: 2, 0 rate: 10 loop: on fade: 1, 1 position: 10, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa3 reverse: On object: SphereSpin time: 3, 0 rate: 10 loop: on fade: 1, 1 position: 90, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa4 reverse: On page: Venus time: 1, 5 image: PlanetVenusBackground.pvr text: OpenSansBold_100 time: 1, 0 align: CenterCenter fade: 1, 1 position: 50, 50 type: "Hello Venus!" object: SphereSpin time: 0, 0 rate: 20 loop: on fade: 1, 1 position: 10, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa1 object: SphereSpin time: 1, 0 rate: 20 loop: on fade: 1, 1 position: 90, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa2 object: SphereSpin time: 2, 0 rate: 20 loop: on fade: 1, 1 position: 10, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa3 reverse: On object: SphereSpin time: 3, 0 rate: 20 loop: on fade: 1, 1 position: 90, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa4 reverse: On page: Earth time: 1, 5 image: PlanetEarthBackground.pvr text: OpenSansBold_100 time: 1, 0 align: CenterCenter fade: 1, 1 position: 50, 50 type: "Hello Earth!" object: SphereSpin time: 0, 0 rate: 30 loop: on fade: 1, 1 position: 10, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa1 object: SphereSpin time: 1, 0 rate: 30 loop: on fade: 1, 1 position: 90, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa2 object: SphereSpin time: 2, 0 rate: 30 loop: on fade: 1, 1 position: 10, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa3 reverse: On object: SphereSpin time: 3, 0 rate: 30 loop: on fade: 1, 1 position: 90, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa4 reverse: On page: Mars time: 1, 5 image: PlanetMarsBackground.pvr text: OpenSansBold_100 time: 1, 0 align: CenterCenter fade: 1, 1 position: 50, 50 type: "Hello Mars!" object: SphereSpin time: 0, 0 rate: 40 loop: on fade: 1, 1 position: 10, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa1 object: SphereSpin time: 1, 0 rate: 40 loop: on fade: 1, 1 position: 90, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa2 object: SphereSpin time: 2, 0 rate: 40 loop: on fade: 1, 1 position: 10, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa3 reverse: On object: SphereSpin time: 3, 0 rate: 40 loop: on fade: 1, 1 position: 90, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa4 reverse: On page: Jupiter time: 1, 5 image: PlanetJupiterBackground.pvr text: OpenSansBold_100 time: 1, 0 align: CenterCenter fade: 1, 1 position: 50, 50 type: "Hello Jupiter!" object: SphereSpin time: 0, 0 rate: 50 loop: on fade: 1, 1 position: 10, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa1 object: SphereSpin time: 1, 0 rate: 50 loop: on fade: 1, 1 position: 90, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa2 object: SphereSpin time: 2, 0 rate: 50 loop: on fade: 1, 1 position: 10, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa3 reverse: On object: SphereSpin time: 3, 0 rate: 50 loop: on fade: 1, 1 position: 90, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa4 reverse: On page: Saturn time: 1, 5 image: PlanetSaturnBackground.pvr text: OpenSansBold_100 time: 1, 0 align: CenterCenter fade: 1, 1 position: 50, 50 type: "Hello Saturn!" object: SphereSpin time: 0, 0 rate: 60 loop: on fade: 1, 1 position: 10, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa1 object: SphereSpin time: 1, 0 rate: 60 loop: on fade: 1, 1 position: 90, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa2 object: SphereSpin time: 2, 0 rate: 60 loop: on fade: 1, 1 position: 10, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa3 reverse: On object: SphereSpin time: 3, 0 rate: 60 loop: on fade: 1, 1 position: 90, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa4 reverse: On page: Uranus time: 1, 5 image: PlanetUranusBackground.pvr text: OpenSansBold_100 time: 1, 0 align: CenterCenter fade: 1, 1 position: 50, 50 type: "Hello Uranus!" object: SphereSpin time: 0, 0 rate: 70 loop: on fade: 1, 1 position: 10, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa1 object: SphereSpin time: 1, 0 rate: 70 loop: on fade: 1, 1 position: 90, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa2 object: SphereSpin time: 2, 0 rate: 70 loop: on fade: 1, 1 position: 10, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa3 reverse: On object: SphereSpin time: 3, 0 rate: 70 loop: on fade: 1, 1 position: 90, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa4 reverse: On page: Neptune time: 1, 5 image: PlanetNeptuneBackground.pvr text: OpenSansBold_100 time: 1, 0 align: CenterCenter fade: 1, 1 position: 50, 50 type: "Hello Neptune!" object: SphereSpin time: 0, 0 rate: 80 loop: on fade: 1, 1 position: 10, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa1 object: SphereSpin time: 1, 0 rate: 80 loop: on fade: 1, 1 position: 90, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa2 object: SphereSpin time: 2, 0 rate: 80 loop: on fade: 1, 1 position: 10, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa3 reverse: On object: SphereSpin time: 3, 0 rate: 80 loop: on fade: 1, 1 position: 90, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa4 reverse: On page: Pluto time: 1, 5 image: PlanetPlutoCharonBackground.pvr text: OpenSansBold_100 time: 1, 0 align: CenterCenter fade: 1, 1 position: 50, 50 type: "Hello Pluto!" object: SphereSpin time: 0, 0 rate: 90 loop: on fade: 1, 1 position: 10, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa1 object: SphereSpin time: 1, 0 rate: 90 loop: on fade: 1, 1 position: 90, 18 scale: 0.5, 0.5, 0.5 image: GlobeNasa2 object: SphereSpin time: 2, 0 rate: 90 loop: on fade: 1, 1 position: 10, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa3 reverse: On object: SphereSpin time: 3, 0 rate: 90 loop: on fade: 1, 1 position: 90, 82 scale: 0.5, 0.5, 0.5 image: GlobeNasa4 reverse: On jump: Mercury