+ All Categories
Home > Documents > Anark Studio4 User Guide

Anark Studio4 User Guide

Date post: 09-Apr-2015
Category:
Upload: chinabean
View: 246 times
Download: 3 times
Share this document with a friend
354
Anark Studio™ User Guide
Transcript
Page 1: Anark Studio4 User Guide

Anark Studio™ User Guide

Anark_Studio_User_Guide.book Page 1 Monday, March 19, 2007 10:34 AM

Page 2: Anark Studio4 User Guide

© 2006 Anark Corporation. Anark, Anark Client, Anark Studio, Anark Player and the Anark logo are trademarks, and in certain jurisdictions, registered trademarks of Anark Corpora-tion. All rights reserved. Windows, Windows Media, DirectX and ActiveX are either trade-marks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Pentium is a trademark or registered trademark of Intel Corporation or its sub-sidiaries in the United States and other countries. JavaScript is a trademark or registered trademark of Sun Microsystems, Inc. in the U.S. or other countries. Adobe and Adobe Pho-toshop are registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Apple, Mac, Mac OS, QuickTime and Safari are trademarks or registered trademarks of Apple Computer, Inc. Netscape is a registered trademark of Netscape Com-munications Corporation in the United States and other countries. 3ds max, plasma and cleaner are registered trademarks and Discreet is a registered trademark of Autodesk/Dis-creet in the USA and/or other countries. Cinema 4D is a registered trademark of MAXON Computer GmbH/MAXON Computer Ltd., in the United States and/or other countries worldwide. Maya is a registered trademark of Alias Systems Corp in the United States and/or other countries. OpenGL is a registered trademark of Silicon Graphics, Inc., in the United States and/or other countries worldwide. Sony, the PlayStation, and the PS logo are trademarks of Sony (the “Sony Marks”). LightWave 3D is a registered trademark of New-Tek, Inc. Anark Studio uses Pixomatic Rendering Technology, Copyright® 2005 by RAD Game Tools, Inc. Anark Studio contains paintlib code. paintlib is copyrighted by Ulrich von Zadow and other contributors.

All other trademarks are the property of their respective owners. All rights reserved. This software is confidential and is the property of Anark Corporation. It may not be redistrib-uted under any circumstances. Use of the documentation and software are subject to the Anark license agreement.

Version date: March 19, 2007

Anark Corporation 1434 Spruce Street Suite 200 Boulder, CO 80302

303.545.2592

www.anark.com

Anark_Studio_User_Guide.book Page 2 Monday, March 19, 2007 10:34 AM

Page 3: Anark Studio4 User Guide

Table of Contents

Table

of

Contents

i

User Reference 3

Introduction to Anark Studio 5Introducing Anark Studio 4.0 . . . . . . . . . . 5About this manual. . . . . . . . . . . . . . . . . . . 6Windows system requirements . . . . . . . . . 6Installation instructions . . . . . . . . . . . . . . . 6Configuring a computer running an interna-tional version of Windows . . . . . . . . . . . . . 6Learning Anark Studio . . . . . . . . . . . . . . . . 7Providing feedback . . . . . . . . . . . . . . . . . . 8

Chapter 1: Anark Studio Overview 9Working with project files . . . . . . . . . . . . 10Organizing the palettes and workspace . . 10

Using the Palette menu button . . . . . . 11About the Project window. . . . . . . . . . . . 11Different ways of looking at your scene . . 12Shortcuts for manipulating the edit cameras . 16

Keyboard modifiers. . . . . . . . . . . . . . . 16Setting program and project preferences 17

Setting application preferences. . . . . . 17Editing project settings . . . . . . . . . . . . 19

Understanding objects and resources . . . 23About the Basic Objects tab . . . . . . . . . . 24About the Storage tab. . . . . . . . . . . . . . . 24Working with the Storage tab . . . . . . . . . 25

Adding objects from the Storage tab to the project . . . . . . . . . . . . . . . . . . . . . . . 25

About the Library tab . . . . . . . . . . . . . . . 26

Adding objects to the Library . . . . . . . . . . 27Cleaning up the Library. . . . . . . . . . . . 27

Accessing the Behavior Library . . . . . . . . . 27About the Inspector tab . . . . . . . . . . . . . . 29

Units of measurement . . . . . . . . . . . . . 30About the Assistant palette . . . . . . . . . . . 31About the Timeline tab . . . . . . . . . . . . . . 31

Chapter 2: Preparing Models, Videos and Images 35

Choosing a 3D program and export file format 36

About the AMX format . . . . . . . . . . . . 36About the Collada format . . . . . . . . . . 36ColladaMaya translator . . . . . . . . . . . . 36ColladaMax translator . . . . . . . . . . . . . 36

Tips for creating models, materials and maps 37

General modeling guidelines and best prac-tices . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Guidelines for working in 3ds max . . . 37Guidelines for working in Cinema 4D . 39Guidelines for working in Maya. . . . . . 39Guidelines for exporting to .3ds . . . . . 39Guidelines for exporting to .dae . . . . . 39Guidelines for exporting to .amx. . . . . 40

Working with exporter plug-ins . . . . . . . . 40Exporting models to .amx . . . . . . . . . . . . 41Exporting models to .3ds . . . . . . . . . . . . . 41Preparing video clips and graphics as image maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

Preparing image files in Adobe Photoshop

Anark_Studio_User_Guide.book Page i Monday, March 19, 2007 10:34 AM

Page 4: Anark Studio4 User Guide

Table of Contents

ii Anark Studio User Guide

43Troubleshooting models, materials, videos and images . . . . . . . . . . . . . . . . . . . . . . . 43

General troubleshooting . . . . . . . . . . . 433ds max troubleshooting . . . . . . . . . . 44

Chapter 3: Creating a Project 47Understanding layers . . . . . . . . . . . . . . . . 48Understanding attachments. . . . . . . . . . . 49Understanding the coordinate system . . . 50How the object hierarchy affects attachments 50Understanding pivot points . . . . . . . . . . . 50Importing objects . . . . . . . . . . . . . . . . . . 51Adding objects to the project. . . . . . . . . . 52

The duration of added objects. . . . . . . 54How the Ctrl key affects adding objects. .

54How text is added to the project . . . . . . . 54Currently supported media formats . . . . . 55Working with source files . . . . . . . . . . . . . 55Refreshing components in the project . . . 56Creating refreshable components . . . . . . 56Converting legacy projects. . . . . . . . . . . . 57Replacing versus refreshing . . . . . . . . . . . 58Copying and duplicating objects in the project . . . . . . . . . . . . . . . . . . . . . . . . . . . 58Duration of the project . . . . . . . . . . . . . . 59Exporting and importing components . . . 60Selecting objects . . . . . . . . . . . . . . . . . . . 61

Special selection options . . . . . . . . . . . 62Selected items vs. active items. . . . . . . 62

Working with the Object outline . . . . . . . 62Renaming objects . . . . . . . . . . . . . . . . 63Rearranging objects . . . . . . . . . . . . . . 64

Using the Shy toggle and button . . . . . . . 64Using the Active toggle and button . . . . . 64Using the Lock toggle and button . . . . . . 64Deleting objects. . . . . . . . . . . . . . . . . . . . 65Controlling presentation playback . . . . . . 65Undoing and redoing actions. . . . . . . . . . 66

Chapter 4: Customizing and Extending Anark Studio 71

What are behavior scripts? . . . . . . . . . . . . 72Understanding behaviors . . . . . . . . . . . . . 72Creating behaviors. . . . . . . . . . . . . . . . . . 72Editing behaviors . . . . . . . . . . . . . . . . . . . 73

Using the Behavior Editing tools . . . . . 74

Updating behavior scripts . . . . . . . . . . . . 74Exporting and printing behavior scripts . . 74Customizing properties for any object . . . 75Creating custom parameters for objects . 75

Working with custom properties . . . . . 76Working with custom actions . . . . . . . 78Working with custom events. . . . . . . . 79

Chapter 5: Setting Object Properties 81

Understanding different types of properties . 82About setting properties for resources . . . 82About setting properties for instances . . . 83

About linked properties. . . . . . . . . . . . 83Setting properties for the scene or slide . . 83Setting properties for layers . . . . . . . . . . . 84Setting properties for text . . . . . . . . . . . . 85Setting properties for cameras . . . . . . . . . 90

Working with fog . . . . . . . . . . . . . . . . 93Setting properties for lights . . . . . . . . . . . 93Setting properties for groups . . . . . . . . . . 95Setting properties for models. . . . . . . . . . 97Shortcuts for setting properties for groups, models and text . . . . . . . . . . . . . . . . . . . 97

Changing rotation . . . . . . . . . . . . . . . 98Changing position . . . . . . . . . . . . . . . 98Changing scale . . . . . . . . . . . . . . . . . . 99

Working with obscured objects . . . . . . . 100Setting properties for materials . . . . . . . 100Setting properties for images. . . . . . . . . 104

Basic properties (for images) . . . . . . . 105Advanced properties (for images) . . . 107Shared properties (for images) . . . . . 108Mipmapping. . . . . . . . . . . . . . . . . . . 109Working with opacity . . . . . . . . . . . . 111Creating a Light Map . . . . . . . . . . . . 111Creating an Opacity Map . . . . . . . . . 112

Setting properties for video . . . . . . . . . . 113Setting properties for sound . . . . . . . . . 114Setting properties for music. . . . . . . . . . 115Setting color properties . . . . . . . . . . . . . 116Setting properties for behaviors . . . . . . . 116Setting properties for components . . . . 117

Chapter 6: Working with Actions, Slides and Components 119

Understanding actions. . . . . . . . . . . . . . 120Creating and deleting actions . . . . . . . . 120

Anark_Studio_User_Guide.book Page ii Monday, March 19, 2007 10:34 AM

Page 5: Anark Studio4 User Guide

Table of Contents iii

Understanding Action icons . . . . . . . 121Selecting a Trigger or Target object. . . . 121

Specifying paths for Trigger and Target objects . . . . . . . . . . . . . . . . . . . . . . . . 122

Selecting an event. . . . . . . . . . . . . . . . . 122Selecting an action . . . . . . . . . . . . . . . . 125Making actions active and inactive . . . . 130Copying and pasting actions . . . . . . . . . 130Dynamically matching a property value using an action. . . . . . . . . . . . . . . . . . . . . . . . 131Working with time labels. . . . . . . . . . . . 131

Creating a Go to Label action . . . . . . 132Using a Time Label as an event . . . . . 132

Loading components dynamically . . . . . 132Understanding slides . . . . . . . . . . . . . . . 133

Adding slides . . . . . . . . . . . . . . . . . . 134Deleting slides . . . . . . . . . . . . . . . . . 134Rearranging slides. . . . . . . . . . . . . . . 134Duplicating slides . . . . . . . . . . . . . . . 134

About Master slides . . . . . . . . . . . . . . . . 134Accessing and exiting the Master slide . . .

135Linking and unlinking properties . . . . . . 135

How objects are copied between slides. . . 136

How objects are attached between slides . 136

Using components . . . . . . . . . . . . . . . . 136How the Scene and component Timelines work . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

Playback in different Timelines . . . . . 139Working with slides, components and bread-crumbs . . . . . . . . . . . . . . . . . . . . . . . . . 139

Understanding the duration of compo-nents . . . . . . . . . . . . . . . . . . . . . . . 139

Adding and attaching objects to compo-nents . . . . . . . . . . . . . . . . . . . . . . . 140

Copying objects in components . . . . 140

Chapter 7: Animating Objects 145Using the Animation toggle. . . . . . . . . . 146Overview of the Time pane . . . . . . . . . . 147Scaling the Timeline . . . . . . . . . . . . . . . 147Using the timebar . . . . . . . . . . . . . . . . . 148

Resizing timebars . . . . . . . . . . . . . . . 148Working with cameras and the timebar . . 150

Using the Playhead . . . . . . . . . . . . . . . . 150Using keyframes . . . . . . . . . . . . . . . . . . 152

Setting keyframes . . . . . . . . . . . . . . . 152

Autokeyframing . . . . . . . . . . . . . . . . 154Selecting keyframes . . . . . . . . . . . . . 155Deleting keyframes. . . . . . . . . . . . . . 155Turning keyframes on and off. . . . . . 155Moving keyframes . . . . . . . . . . . . . . 156Copying and pasting keyframes . . . . 156

Controlling keyframe interpolation . . . . 157Playing back a presentation. . . . . . . . . . 159Using dynamic keyframes . . . . . . . . . . . 159

How dynamic keyframes are executed . . . 160

Playback controls . . . . . . . . . . . . . . . . . 160Scrubbing with the Playhead . . . . . . 160

Chapter 8: Working with Streaming Media and Dynamic Images 165

Working with proxy video. . . . . . . . . . . 166Understanding paths for streaming media and dynamic images. . . . . . . . . . . . . . . 166Adding streaming media files to a project . . . 167Setting up streaming files . . . . . . . . . . . 167Distributing streaming media files . . . . . 169Setting up dynamic images. . . . . . . . . . 169

Chapter 9: Viewing and Distributing Anark Media Files 173

Previewing a presentation . . . . . . . . . . . 174Setting rendering options . . . . . . . . . . . 174

Software renderer limitations . . . . . . 175Choosing a distribution format . . . . . . . 176Exporting a presentation. . . . . . . . . . . . 176Exporting to Anark Player . . . . . . . . . . . 177Exporting to Internet Explorer. . . . . . . . 177Exporting to video . . . . . . . . . . . . . . . . 178Exporting to screen saver . . . . . . . . . . . 180Exporting to projector. . . . . . . . . . . . . . 182Viewing a presentation . . . . . . . . . . . . . 182System requirements for viewing a presenta-tion. . . . . . . . . . . . . . . . . . . . . . . . . . . . 183Distributing a presentation . . . . . . . . . . 183Editing the HTML document. . . . . . . . . 184

Embedding Anark Media in an existing HTML file . . . . . . . . . . . . . . . . . . . . 186

Running older presentations in Anark Cli-ent 4.0 . . . . . . . . . . . . . . . . . . . . . . 186

Working with HTML events . . . . . . . 186Working with ActiveX control methods and properties . . . . . . . . . . . . . . . . 189

Anark_Studio_User_Guide.book Page iii Monday, March 19, 2007 10:34 AM

Page 6: Anark Studio4 User Guide

Table of Contents

iv Anark Studio User Guide

Preparing Anark Media for a CD-ROM . . 190Running a presentation on a CD-ROM by double-clicking . . . . . . . . . . . . . . . . 191

Running a presentation on a CD-ROM au-tomatically (Windows). . . . . . . . . . . 191

Command line and configuration file options (Windows) . . . . . . . . . . . . . . . . . . . . . . . 192

Setting up a configuration file for a projec-tor file . . . . . . . . . . . . . . . . . . . . . . . 195

Setting up a configuration file for Anark Player (Windows). . . . . . . . . . . . . . . 195

Anark Player features . . . . . . . . . . . . . 195About the Anark Client controls . . . . . . . 196

Anark Client Control Panel . . . . . . . . 196Anark Client Context menu. . . . . . . . 197

Creating SCORM-conformant presentations. 197

Chapter 10: Using Scripting 203Overview of scripting. . . . . . . . . . . . . . . 204Scripting resources. . . . . . . . . . . . . . . . . 204Scripting syntax . . . . . . . . . . . . . . . . . . . 204Data types . . . . . . . . . . . . . . . . . . . . . . . 206Global functions. . . . . . . . . . . . . . . . . . . 207Keywords. . . . . . . . . . . . . . . . . . . . . . . . 211

Assigned keywords . . . . . . . . . . . . . . 211Reserved keywords . . . . . . . . . . . . . . 211

Objects . . . . . . . . . . . . . . . . . . . . . . . . . 211JavaScript intrinsic objects . . . . . . . . . 211Anark Studio intrinsic objects . . . . . . 212

Specifying paths in scripting . . . . . . . . . 212Operators . . . . . . . . . . . . . . . . . . . . . . . 213Object model overview . . . . . . . . . . . . . 214Creating objects using scripting . . . . . . . 215Using variables. . . . . . . . . . . . . . . . . . . . 216Addressing objects and properties using scripting . . . . . . . . . . . . . . . . . . . . . . . . 217

Defining the scope of objects and variables 218

Function scope . . . . . . . . . . . . . . . . . 218Behavior scope . . . . . . . . . . . . . . . . . 218Working with the global keyword . . . 218Creating dynamic properties for objects . 219

Understanding dynamic objects. . . . . . . 219Attaching dynamic objects to components 220

Animating copied dynamic objects . . 220Understanding how script-controlled proper-ties are handled . . . . . . . . . . . . . . . . . . . 220

Understanding functions . . . . . . . . . . . . 221Creating functions . . . . . . . . . . . . . . 221Using the parent property of a behavior . 224

Event handler functions . . . . . . . . . . . . . 224Accessing event information . . . . . . . 229Working with mouse events and event bubbling . . . . . . . . . . . . . . . . . . . . . 230

Cancelling bubbling . . . . . . . . . . . . . 231Understanding the onAttach and onDe-tach functions . . . . . . . . . . . . . . . . . 232

Using the onCommand function. . . . 233Freezing and unfreezing objects . . . . . . 233Using conditional statements. . . . . . . . . 234Using loops . . . . . . . . . . . . . . . . . . . . . . 236How behaviors affect animation. . . . . . . 237

Object Reference 241

Scripting Object Reference 243Asset . . . . . . . . . . . . . . . . . . . . . . . . . . . 244

Scene . . . . . . . . . . . . . . . . . . . . . . . . 247Behavior . . . . . . . . . . . . . . . . . . . . . . 247Material . . . . . . . . . . . . . . . . . . . . . . 249Image . . . . . . . . . . . . . . . . . . . . . . . . 250Video . . . . . . . . . . . . . . . . . . . . . . . . 253Music . . . . . . . . . . . . . . . . . . . . . . . . 255

Node. . . . . . . . . . . . . . . . . . . . . . . . . . . 257Layer. . . . . . . . . . . . . . . . . . . . . . . . . 258Camera. . . . . . . . . . . . . . . . . . . . . . . 260Light. . . . . . . . . . . . . . . . . . . . . . . . . 261Group. . . . . . . . . . . . . . . . . . . . . . . . 263Model. . . . . . . . . . . . . . . . . . . . . . . . 264Text . . . . . . . . . . . . . . . . . . . . . . . . . 269Sound. . . . . . . . . . . . . . . . . . . . . . . . 271

Utility . . . . . . . . . . . . . . . . . . . . . . . . . . 272Color . . . . . . . . . . . . . . . . . . . . . . . . 272Vector. . . . . . . . . . . . . . . . . . . . . . . . 275Vector2. . . . . . . . . . . . . . . . . . . . . . . 279Vertex. . . . . . . . . . . . . . . . . . . . . . . . 280Rotation . . . . . . . . . . . . . . . . . . . . . . 281Matrix. . . . . . . . . . . . . . . . . . . . . . . . 284Mouse . . . . . . . . . . . . . . . . . . . . . . . 287Key . . . . . . . . . . . . . . . . . . . . . . . . . . 288Window . . . . . . . . . . . . . . . . . . . . . . 289Memory . . . . . . . . . . . . . . . . . . . . . . 289

AKEvent. . . . . . . . . . . . . . . . . . . . . . . . . 291Miscellaneous . . . . . . . . . . . . . . . . . . . . 292

Presentation . . . . . . . . . . . . . . . . . . . 293

Anark_Studio_User_Guide.book Page iv Monday, March 19, 2007 10:34 AM

Page 7: Anark Studio4 User Guide

Table of Contents v

TimeContext . . . . . . . . . . . . . . . . . . 294Player . . . . . . . . . . . . . . . . . . . . . . . . 295Container . . . . . . . . . . . . . . . . . . . . . 296XMLNode. . . . . . . . . . . . . . . . . . . . . 298XML . . . . . . . . . . . . . . . . . . . . . . . . . 300

Glossary and Appendices 303

Appendix A: Supported Media For-mats 305

Appendix B: Shortcut Keys 307

Appendix C: Key Names 315

Scripting Glossary 319

Index 325

Anark_Studio_User_Guide.book Page v Monday, March 19, 2007 10:34 AM

Page 8: Anark Studio4 User Guide

Table of Contents

vi Anark Studio User Guide

Anark_Studio_User_Guide.book Page vi Monday, March 19, 2007 10:34 AM

Page 9: Anark Studio4 User Guide

1

About this Book

This book is divided into two main sections:

1. User Reference on page 3

2. Object Reference on page 241

The User Reference fully documents the Anark Studio appli-cation interface, and includes an overview of writing behavior scripts. It covers workflow for project creation and details all major product features.

The Object Reference documents the objects available in the Anark Studio Document Object Model (DOM).

At the end of the book is a glossary and several appendices.

Anark_Studio_User_Guide.book Page 1 Monday, March 19, 2007 10:34 AM

Page 10: Anark Studio4 User Guide

Anark_Studio_User_Guide.book Page 2 Monday, March 19, 2007 10:34 AM

Page 11: Anark Studio4 User Guide

3

User Reference

The User Reference fully documents the Anark Studio appli-cation interface, and includes an overview of writing behav-ior scripts. It covers workflow for project creation and details all major product features. It contains the following chap-ters:

Introduction to Anark Studio on page 5

Chapter 1: Anark Studio Overview on page 9

Chapter 2: Preparing Models, Videos and Images on page 35

Chapter 3: Creating a Project on page 47

Chapter 5: Setting Object Properties on page 81

Chapter 4: Customizing and Extending Anark Studio on page 71

Chapter 6: Working with Actions, Slides and Components on page 119

Chapter 7: Animating Objects on page 145

Chapter 8: Working with Streaming Media and Dynamic Images on page 165

Chapter 9: Viewing and Distributing Anark Media Files on page 173

Chapter 10: Using Scripting on page 203

Anark_Studio_User_Guide.book Page 3 Monday, March 19, 2007 10:34 AM

Page 12: Anark Studio4 User Guide

Anark_Studio_User_Guide.book Page 4 Monday, March 19, 2007 10:34 AM

Page 13: Anark Studio4 User Guide

5

IntroductionIntroduction to Anark Studio

Before you begin using Anark Studio™, it may be helpful to

understand more about the Anark Media™ it is used to cre-ate. Anark Media integrates 3D and 2D graphics, video, audio and data into animated, interactive projects. These projects can be delivered via the Web, intranets or any other digital media distribution channel. It uses layers, lighting effects, actions and keyframe animation to create integrated, interactive motion graphics that can be viewed in a stan-dard Web browser using Anark Client™, a compact end user plug-in. The data file can also be viewed as a video file, as a standalone projector file, as a screen saver for the PC or in Anark Player™.

Anark Media allows you to communicate and interact with your audience in exciting new ways. It can be used for a wide range of applications, including distance learning, corporate communications, customer service, presales demonstrations, trade show presentations, kiosks, adver-tising, news and entertainment, computer-based training, and gaming.

Introducing Anark Studio 4.0Anark Studio is a professional digital media authoring appli-cation that provides a flexible interface and workflow process for the creation of Anark Media. It enables digital media developers to author and repurpose television-quality interactive content, incorporating all the elements of 3D and 2D graphics, video, audio, text and data. With Anark Studio, you can assemble, animate and add interactivity to those elements to create richly detailed digital projects.

Anark_Studio_User_Guide.book Page 5 Monday, March 19, 2007 10:34 AM

Page 14: Anark Studio4 User Guide

Introduction to Anark StudioIntroduction

6 Anark Studio User Guide

About this manualThis manual is intended to introduce you to version 4.0 of Anark Studio. It provides installation instructions and detailed documentation of the Anark Studio interface. For other Anark product documentation, visit the Anark Web site at:

http://www.anark.com/support.

Windows system requirements

Windows 2000 or Windows XP

Pentium®III processor @ 600 MHz (or better)

256 MB of RAM or more

Microsoft DirectX 7 or later

Windows Media® Player 7 or later installed

Minimum of 224 MB of free disk space

Note: Anark Studio supports three rendering engines. If you want to view Anark Media presentations using the OpenGL® renderer, then you will need a graphics card that supports OpenGL 1.2.1 or later. For more information about the render-ing options, see “Setting rendering options” on page 174.

Installation instructionsAnark Studio uses a standard setup wizard. The steps for installation are simple:

Insert the Anark Studio compact disc into the CD-ROM drive on your computer. The Anark Studio Installer should automatically launch. If it doesn’t auto-launch, do the following:

1. From the Start menu, select Run. The Run window will open.

a. From the Run window, select the Browse button. The Browse win-dow will open.

b. From the Browse window, select your CD-ROM drive. The files on the Anark compact disc should appear.

c. Double-click on the Anark Studio setup file, Install.exe, to launch the installer. The setup program will now load.

2. Follow the instructions in the installer. After installation, Anark Studio will be available on the Start menu.

Configuring a computer running an international version of WindowsTo use Anark Studio when you are running an international version of Microsoft Windows operating system, you will need to set some specific Regional Options in the Control Panel.

Note: These settings only need to be configured on the computer that is creating the presentation; viewers can view Anark Media regardless of their Windows settings.

To configure Regional Options for Windows 2000:1. Click on Start > Settings > Control

Panel > Regional Options.

2. Do one of the following:

• Click on the General tab and change “Your locale (location)” to English (United States). Then click OK. This will automatically set the correct numbering properties.

Anark_Studio_User_Guide.book Page 6 Monday, March 19, 2007 10:34 AM

Page 15: Anark Studio4 User Guide

Learning Anark Studio

User Reference 7

• Click on the Numbers tab and manually set the following values:

- Set “Decimal symbol” to a period (.).

- Set “Digit grouping symbol” to a comma (,).

- Set “List separator” to a comma (,).

3. Click OK.

To configure Regional Options for Windows XP:1. Click on Start > Control Panel.

2. Click on “Date, Time, Language, and Regional Options.”

3. Click on “Change the format of numbers, dates and times.”

4. Do one of the following:

• In the Standards and formats section, select English (United States) from the pull-down menu. Then click OK. This will automati-cally set the correct numbering properties.

• Set the Number format to 123,456,789.00, and click OK.

Learning Anark StudioThere are a number of resources available to help you learn Anark Studio. Technical assistance is also available.

Assistant paletteThe first time you open Anark Studio after installation, a welcome page will open in the Assistant palette. The Assis-tant palette provides quick access to the Behavior Reference Library and the Reference Manual. There is an Offline/Online toggle in the upper-right corner of the Assistant Palette that you can use to access the “online” mode of the palette. The online mode contains a searchable database of the latest/greatest

versions of the following items: Tuto-rials, Sample Projects, Sample Assets, Documentation, Latest Behaviors, Script Reference, and Latest Exporters.

Help filesAfter you have installed Anark Studio, the searchable Reference Manual is easily accessible from the Help menu. The Reference Manual fully documents the Anark Studio application interface and also includes an overview of writing behavior scripts.

SamplesA Samples folder that contains a wide variety of presentation assets, including 3D models and components, sounds, music, video, and image maps, is included with the default Anark Studio installation. The folder is included as a default directory on the Storage tab.

Behavior reference libraryOne way to add interactivity to your projects is by using the ready-made behaviors that are included in the Behavior Library. The Behavior Refer-ence Library contains brief descriptions of each behavior and how they operate. Behaviors are separated into categories based on their functionality. The majority of behaviors have sample presentations that show how to correctly setup and use the behavior. The Behavior Reference Library is also avail-able as a default directory on the Storage tab. To access the Behavior Reference Library, select:

Help > Behavior Reference

Recently created behaviorsThese are behaviors that have been written by Anark staff or by members of the Anark user community. They are posted in the Latest Behaviors section of

Anark_Studio_User_Guide.book Page 7 Monday, March 19, 2007 10:34 AM

Page 16: Anark Studio4 User Guide

Introduction to Anark StudioIntroduction

8 Anark Studio User Guide

the Online Assistant, which is available inside of Anark Studio and from the Support area of the Anark website. Although the behaviors are not “guaran-teed” to work, Anark is confident that they are useful and represent a “value-add” to your projects.

If the author of the script wishes to share their work, they should send the script to [email protected] or post it on the Anark Forum at http://forum.anark.com.

Anark community forumVisit http://forum.anark.com to access the Anark Community Forum. Anark Technical Support, Professional Services and Content Development experts visit the forums daily and will help answer your questions, plus fuel your creative possibilities and productivity in Anark Studio.

Anark knowledge baseThe knowledge base provides access to a large number of wiki-style short articles and FAQs that have been written by Anark staff or by members of the Anark

user community. Type your question into the Question area, and then click Search. You can find the knowledge base at:

http://www.anark.com/developer/knowledgebase.

Technical supportThe Support area of the Anark website has links to the Anark Forum, Knowl-edge Base, and to the Studio Online Assistant Palette. To learn more visit:

http://www.anark.com/products/support.html.

If you don’t find the answer to your question on the support site, you can e-mail your question to:

[email protected].

Providing feedbackAnark invites you to send your sugges-tions and feature requests and to report any issues you may find with Anark Studio by using the Send Feedback option under the Help menu.

Anark_Studio_User_Guide.book Page 8 Monday, March 19, 2007 10:34 AM

Page 17: Anark Studio4 User Guide

1

9

Chapter 1: Anark Studio Overview

The Anark Studio Graphical User Interface (GUI) is designed

to follow typical digital media content development work-flows. 3D and 2D graphics, video clips and streaming music created in other programs are imported into Anark Studio. Lights, cameras, layers and groups are created within Anark Studio and are used to organize the elements of the scene and control how they are displayed. All of these assets are assembled in the Project window and can then be animated using the tools available on several palettes. Slides allow you to break up a presentation into segments that can be quickly loaded based on user interaction, and to create “states” for interactive objects such as buttons and menu items. Actions extend the animation capabilities and make interactivity easy to create. The resulting Anark Media presentations can be viewed with Anark Client or Anark Player, as video, and even as a Windows screen saver.

Anark_Studio_User_Guide.book Page 9 Monday, March 19, 2007 10:34 AM

Page 18: Anark Studio4 User Guide

10 Anark Studio User Guide

Chapter 1Anark Studio Overview

Working with project filesWhen Anark Studio is started, it creates a blank project file for you to work in. Only one project file can be open at a time. If you try to open or create a new project while one is currently open, the program prompts you to save the current file before closing it and opening or creating the new one.

Anark Media uses .amw (for “Anark Media Workspace”) as its file extension. This file contains the project’s data and workspace settings.

The New, Open and Save buttons are avail-able in the application tool bar.

To save a project:1. Do one of the following:

• Choose File > Save.

• Press Ctrl + S.

• Click on the Save button.

2. If this is the first time you are saving the file, enter a name for the file.

3. Click OK.

After a project has been saved, previewing it (using the F12 key) or exporting it creates some additional files. For more information about the files that are created when a project is previewed, see “Previewing a presenta-tion” on page 174. For more information about the files that are created when a project is exported, see “Exporting a presentation” on page 176.

Note: Previewing is the only way to see behaviors and actions. They are not executed when the Playhead is scrubbed. See “Scrubbing with the

Playhead” on page 160 for more information.

To create a new project:Do one of the following:

Choose File > New.

Press Ctrl + N.

Click on the New button.

To rename a project or move a copy to a new location:Choose File > Save As, enter a new name or browse to a new location and click OK.

Only the .amw file is saved. The HTML file and .am file will only be created if you preview the project or export it.

To open an existing project:1. Do one of the following:

• Choose File > Open.

• Press Ctrl + O.

• Click on the Open button.

2. Locate and select a project file from the file browser and click Open.

Note: Earlier versions of Anark Studio cannot open files created in later versions. Presentations created in Anark Studio 4.0 cannot be opened in Anark Studio 3.5.

To revert to the last saved version of the project:Choose File > Revert and select Yes at the Are you sure? prompt. No backup file is made, so any changes you made since you last saved the file will be perma-nently lost. Reverting cannot be undone.

Organizing the palettes and workspaceThe first time Anark Studio runs, it uses the default workspace layout, which displays all the available palettes. Each

Anark_Studio_User_Guide.book Page 10 Monday, March 19, 2007 10:34 AM

Page 19: Anark Studio4 User Guide

User Reference 11

Using the Palette menu button

palette has a default set of tabs. Both the palettes and the tabs can be moved, resized and hidden, allowing you to organize the workspace according to your personal preferences. All palettes are easily docked to other palettes and can be undocked by dragging them.

Tip: Anark Studio saves your work-space settings as you change them. However, any time you want to reset your choices, and return all palettes to their original locations, you can do this easily by clicking the Restore Defaults button at the bottom of the Application Preferences dialog. (This dialog is opened by selecting Edit > Application Preferences.)

To move the application window:In order to move the application window, Anark Studio must not be maximized. Click on the application Title bar and drag the window to the desired location on your desktop.

To display a palette:From the View menu, select the palette you want to view.

To hide a palette:Do one of the following:

From the View menu, select the palette you want to hide.

Click the Close button on the palette you want to hide.

To move a palette:Drag the palette by its Title bar to the desired location.

To resize a palette:1. Position the mouse over the border

of a palette so that a double arrow appears.

2. Drag the border or corner until the palette is the desired size.

Using the Palette menu buttonThe Palette menu button ( ) allows you to move the palette tabs and to create new palettes. The menu items are dynamically generated based on the palette and tab you are working in.

To move a tab:Click on the Palette menu button and select a location to move the tab to from the pull-down menu.

To create a new palette:Click on the Palette menu button and select Create New Palette from the pull-down menu.

About the Project windowThe box in the center of the application window is the Project window where the content and action of the scene are displayed. When a new project is created, or when Anark Studio is first started, the Project window is blank. To add items to the scene, you drag them from the Library or Storage palette or from a Windows Explorer window to either the Project window or the Object outline in the Timeline tab, creating instances of them. For more information on adding objects, see “Adding objects to the project” on page 52.

Quick DefinitionInstance - An instance is an object that has been added to the scene.

Anark_Studio_User_Guide.book Page 11 Monday, March 19, 2007 10:34 AM

Page 20: Anark Studio4 User Guide

12 Anark Studio User Guide

Chapter 1Anark Studio Overview

Different ways of looking at your sceneAll scenes in Anark Studio are inherently 3-dimensional. To view these 3D scenes you have several choices. You can use the Scene Camera view (described below), which shows how your presenta-tion will be viewed when it is deployed. Alternatively, you can use edit camera views, which allow you to view the 3D space from several predefined angles.

You can view your scene from multiple viewpoints; these alternate viewpoints are called edit cameras. The edit cameras allow you to navigate and peruse the scene without making any changes to cameras present in the Scene Camera view.

Anark Studio has nine different edit cameras to choose from.

For information about the coordinate system used by Anark Studio, see “Understanding the coordinate system” on page 50.

The various edit camera views are:

Scene Camera View – This viewpoint is always co-located with the scene camera. This is the default edit camera view.

3D Perspective View – A type of rendering that graphically approxi-mates on the screen the images of three-dimensional objects so as to

simulate actual visual perception.

Note: Please note that all perspectives on a planar surface have some degree of distortion, similar to the distortion created when portraying the earth’s surface on a planar map.

3D Orthographic View – Orthographic projection is a means of representing a three-dimensional object in two dimensions. It creates multiple views of the object, using points of view rotated about the object’s center through increments of 90°.

You can think of the appearances of views as being projected onto planes that form a transparent “box” around the object.

The following six views are ortho-graphic, in that each one is aligned with one side of the transparent box:

Top View – Assumes a viewpoint looking directly down the Y axis (decreasing values of Y).

Bottom View – Assumes a viewpoint looking directly up the Y axis (increasing values of Y).

Left View – Assumes a viewpoint looking directly up the X axis (increasing values of X).

Right View – Assumes a viewpoint looking directly down the X axis (decreasing values of X).

Front View – Assumes a viewpoint looking directly up the Z axis (increasing values of Z).

Back View – Assumes a viewpoint looking directly down the Z axis (decreasing values of Z).

Anark_Studio_User_Guide.book Page 12 Monday, March 19, 2007 10:34 AM

Page 21: Anark Studio4 User Guide

User Reference 13

Different ways of looking at your scene

A small toolbar consisting of five icons allows you to control and manipulate the position of the currently selected edit camera. For more information, see “Shortcuts for manipulating the edit cameras” on page 16.

Tip: When the edit camera dropdown menu widget has focus, scrolling the middle mouse button takes you sequentially through all the various edit cameras. In this manner, this technique provides a quick way to look at your scene from all possible angles.

Anark_Studio_User_Guide.book Page 13 Monday, March 19, 2007 10:34 AM

Page 22: Anark Studio4 User Guide

14 Anark Studio User Guide

Chapter 1Anark Studio Overview

A comparison of the various 3-dimensional edit camera views. Note the use of wire-frame rendering, which you easily toggle on or off.

3D Orthographic View3D Perspective View

Scene Camera View (Default)

Anark_Studio_User_Guide.book Page 14 Monday, March 19, 2007 10:34 AM

Page 23: Anark Studio4 User Guide

User Reference 15

Different ways of looking at your scene

Top View Bottom View

Left View Right View

Front View Back View

Anark_Studio_User_Guide.book Page 15 Monday, March 19, 2007 10:34 AM

Page 24: Anark Studio4 User Guide

16 Anark Studio User Guide

Chapter 1Anark Studio Overview

Shortcuts for manipulating the edit camerasYou can use either the mouse or keyboard shortcuts to manipulate the position of the currently selected edit camera. The interface also includes controls for making the same sort of adjustments.

Toolbar icons for controlling the currently selected edit camera.

To select an edit camera tool:Click on the icon for it or press one of the following keys:

Fit Selected – Centers the current edit camera view on the currently selected model or group. If no object is selected, the camera centers on the entire scene.

• Mouse Shortcut: n/a

• Keyboard Shortcut: f

Edit Camera Pan – With the Pan tool selected, the edit camera tracks mouse movements around in the XY plane.

• Left/right mouse button: Press and drag to pan

• Keyboard Shortcut: n/a

Tip: If you have a middle mouse but-ton, you can click and drag it at any time to enable the Pan tool.

Edit Camera Zoom – With the Zoom tool selected, the edit camera tracks mouse movements either in (towards the objects in the scene) or out (away from the objects in the scene).

• Mouse Shortcut: Use any mouse button to change the degree of

zooming:

Left/right mouse button: Press and drag to zoom

Middle mouse button: Spin to zoom

• Keyboard Shortcut: n/a

Tip: If you have a middle mouse but-ton, you can click and spin it at any time to enable the Zoom tool.

Edit Camera Orbit – Rotates the posi-tion of the edit camera. The view orbits around the selected object(s) in the scene (after you do a ‘Fit Selected’); if no object(s) are selected, it orbits around the entire scene, while always looking towards the center of the scene.

• Mouse Shortcut: Use any mouse button to orbit the camera:

Left/right mouse button: Press and drag to orbit

Middle mouse button: Spin to zoom

• Keyboard Shortcut: n/a

Note: This control is only enabled for the 3D edit camera modes.

Shading Mode Toggle – Toggles the rendering method from wireframe to shaded.

• Mouse Shortcut: n/a

• Keyboard Shortcut: F3

Keyboard modifiersWhen some Edit Camera tools are enabled, you can temporarily enable a different tool by holding down modifier keys. The Edit Camera tool icon in the Project window will change to the currently enabled tool. The following

Anark_Studio_User_Guide.book Page 16 Monday, March 19, 2007 10:34 AM

Page 25: Anark Studio4 User Guide

User Reference 17

Setting program and project preferences

table lists how the keys affect the currently selected tool.

Setting program and project preferencesAnark Studio allows you to set prefer-ences for each project and for the appli-cation itself. The application settings are saved when you close the project so that the next time you open Anark Studio, it will use the same application settings.

Setting application preferencesTo set application preferences:Choose Edit > Application Preferences.

The Preferences dialog opens. In Windows, the Application tab will be selected.

General settingsNudge Increment – Sets the increment by which objects will be nudged when

Currently Selected ToolModi-fier Key *

Fit Selected

Edit Cam-era Pan

Edit Cam-era Zoom

Edit Cam-era Orbit

Shad-ing Mode Toggle

Alt key

No effect

Zoom Orbit Zoom No effect

Ctrl key

No effect

Orbit Pan Pan No effect

* The mouse must be inside the perimeter of the Project window when you press the modifier key.

Anark_Studio_User_Guide.book Page 17 Monday, March 19, 2007 10:34 AM

Page 26: Anark Studio4 User Guide

18 Anark Studio User Guide

Chapter 1Anark Studio Overview

pressing the arrow keys on the keyboard. Defaults to .01. For more information about using the arrow keys to nudge objects, see “Shortcuts for setting proper-ties for groups, models and text” on page 97.

Snapping Range – Sets the number of pixels within which an item on the Timeline tab will snap to other items. Defaults to 10.

Default Interpolation – Specifies whether Anark Studio will create keyframes with Smooth interpolation (also referred to as Bezier interpolation) or Linear interpola-tion. The interpolation of any existing keyframes will not be changed; however, the interpolation of any new keyframes will be set to this value. The interpola-tion of individual keyframes can also be set using the Timeline menu. For more information about keyframes and inter-polation, see “Controlling keyframe interpolation” on page 157.

Timeline Snapping Grid – The checkbox specifies whether elements on the Time-line tab, including the Playhead, time-bars and keyframes, will snap to marks on the Time measure. The pull-down menu lets you select the snapping reso-lution. High snaps to every tick. Medium

snaps to every tall tick. Low snaps to every numbered tall tick.

Timeline Snapping resolution can be set to low, medium or high.

For information about scaling the Time-line, see “Scaling the Timeline” on page 147.

Studio Renderer – Sets the rendering preference for presentations when viewed in Anark Studio’s Project window. This setting can be used to see how the different renderers will display the content of the scene.

Auto – This is the recommended set-ting. It tries the following sequence of renderers and uses the first one that’s available: DirectX, OpenGL, then Soft-ware.

DirectX – Uses Microsoft DirectX® for rendering the scene. DirectX is a group of technologies that enable Windows-based computers to run multimedia applications. Fast frame rates are possible with DirectX rendering.

OpenGL – Uses OpenGL for rendering the scene. OpenGL is a cross-platform standard for 3D rendering and 3D hardware acceleration. Fast frame rates are possible with OpenGL rendering.

Software – Specifies that software ren-dering will be used. Software rendering enables Anark Media to be played on nearly all Windows computers; how-ever, there are some limitations to soft-ware rendering that should be considered when using this option. See

Quick DefinitionKeyframe - A keyframe controls the data for a property at a single moment in time. At least two keyframes, each with different values, are needed for a property to be animated.

Anark_Studio_User_Guide.book Page 18 Monday, March 19, 2007 10:34 AM

Page 27: Anark Studio4 User Guide

User Reference 19

Editing project settings

“Software renderer limitations” on page 175 for more information.

If the machine Anark Studio is running on does not support OpenGL or DirectX, those options will not be available in the Studio Renderer list.

Note: OpenGL is able to evaluate floating-point numbers more pre-cisely than DirectX does, which can lead to slight differences in render-ing or to unexpected results in behaviors. In DirectX, if you set a value for an object to an exact deci-mal point (e.g., 123.456) the value returned may not be that exact deci-mal value (123.45600123173828 would be returned instead).

Preview Thumbnails – Controls whether or not thumbnails will be displayed for importable file types in the Storage tab. When thumbnails are previewed, it may take longer for the content on the Storage tab to fully display.

RulersMajor Increment – Sets the pixel incre-ments that are labeled in the ruler. The ruler is displayed around the perimeter of the Project window. Pixels are always the unit of measure used in the ruler.

Origin – Sets the origin of the ruler.

Snapping Grid – Choose between low, medium, and high resolution snapping. If snapping is enabled, objects inside the Project window snap to this invisible grid. The pull-down menu lets you select the snapping resolution. High snaps to every tick. Medium snaps to every tall tick. Low snaps to every numbered tall tick.

Editing viewBackground Color – Opens the standard Windows color picker. Choose the color you want to see used for the background of editing views inside the Project window.

Preferred Startup View – Choose your preferred startup view. Your choice may depend on the type of project you are currently working on. For more details about startup views, refer to “Different ways of looking at your scene” on page 12.

Restoring application defaultsRestore Defaults – Click to reset all pref-erence settings and palette locations to their original values.

Editing project settingsThe Project Settings tab allows you to configure items specific to an individual presentation.

Anark_Studio_User_Guide.book Page 19 Monday, March 19, 2007 10:34 AM

Page 28: Anark Studio4 User Guide

20 Anark Studio User Guide

Chapter 1Anark Studio Overview

To edit project settings:Choose Edit > Project Settings or press Ctrl + P. The Project Settings dialog opens.

Presentation SizeYou can change the size of the Project window, which controls what the viewer will see during presentation playback. Layers and the objects attached to them may extend beyond the borders of the Project window, but only the portions within its borders will be displayed.

Changing the size of the Project window affects the view of objects in the scene because it changes the 3D “world space” of the scene. Due to the way the 3D space is calculated, changing the height of the window maintains the aspect ratio of the objects within the space. For

example, if an object appears to take up a third of the window before resizing, it will still appear to take up a third of the window after resizing.

However, if only the width of the window is changed, the aspect ratio is not maintained. Objects located outside the bounds of the new window size will be cropped, or additional space will be added to the edges.

The project window is set to 512 X 300 (top). Changing the height of the window to 512 X 200 (middle) maintains the aspect ratio of the objects within the space. Objects that appear to take up a third of the window before resizing still appear to take up a third of the window after resizing. Changing the width of the window to 300 x 300 (bottom) does not maintain the aspect ratio of the objects. Objects located outside the bounds of the new window size are cropped.

Scale Mode – Sets how the size of the Project window will be determined and whether the viewer will be allowed to resize the presentation window.

Anark_Studio_User_Guide.book Page 20 Monday, March 19, 2007 10:34 AM

Page 29: Anark Studio4 User Guide

User Reference 21

Editing project settings

Fixed size – Uses the Width and Height settings as the size of the Project window. When the finished presentation is viewed, the user will not be able to resize the presentation.

Scale to fit – Sets the Project window to fill the current workspace. When the finished presentation is viewed, the presentation will be automatically sized to fit the viewer’s current browser window size. The viewer can also resize the presentation. Changing the height of the window maintains the aspect ratio of the objects within the space. Changing the width of the window does not maintain the aspect ratio; objects located outside the bounds of the new window size will be cropped, or additional space will be added to the edges.

Fixed aspect ratio – Allows the viewer to resize the presentation window but always maintains the original aspect ratio of the objects within it.

Note: If your presentation uses either Flat text or an orthographic camera, and the Scale Mode isn’t Fixed Size, be sure to test how the presentation resizes to make sure the objects scale they way you want them to. In some cases, you may want to use the Fixed Size Scale Mode.

Width – Sets the horizontal length of the Project window in pixels. Range = 1 to 2048.

Height – Sets the vertical length of the Project window in pixels. Range = 1 to 2048.

Constrain Proportions – Specifies whether the current proportions of the Project window will be kept at their present settings. You can then change either the Width or Height setting and the program will automatically fill in the other number in order to maintain the current height-to-width ratio.

Anark_Studio_User_Guide.book Page 21 Monday, March 19, 2007 10:34 AM

Page 30: Anark Studio4 User Guide

22 Anark Studio User Guide

Chapter 1Anark Studio Overview

Export OptionsBorder Color – Sets the color of the border between the presentation window and the playback application (e.g., a Web browser, Anark Player, etc.).

Playback Preferred Renderer – Sets a flag in the exported presentation that can be read by the playback application to help decide what rendering engine to use for the presentation when it is viewed on a user’s machine. Because of the vast differences among video cards and processors, the end user can also control the rendering engine used on his or her machine.

Auto – Allows the user’s machine to try a sequence of renderers and uses the first one that’s successful. It tries the renderers in the following order: DirectX, OpenGL, then Software.

Auto is the recommended setting. For a description of DirectX, OpenGL, and Software, see “Setting application pref-erences” on page 17.

Force Hardware – Limits the playback choices for the presentation to either OpenGL or DirectX. The Software ren-derer choice will not be available when playing back this presentation in the end user’s playback application. Users viewing a presentation with the Force Hardware flag on a machine that does not have OpenGL or DirectX support

will see an error message within their playback application.

Force Software – Limits the playback of the presentation to the Software ren-derer only. OpenGL and DirectX ren-derer choices will not be available when playing back this presentation in the end user’s playback application.

Important: The Force Hardware option must be used when the Anark presentation is used as or made into a commercially distrib-uted video game that sells for more than $4.00 U.S., as explained in the License Agreement.

Note: Anark Media presentations that were created in Anark Studio 2.0.1 or earlier have Auto set as their Play-back Preferred Renderer.

For more information about controlling rendering for a presentation, see “Setting rendering options” on page 174.

Embed Fonts – Sets whether or not fonts used in text objects will be embedded in the finished Anark Media (.am) presenta-tion file. If fonts are embedded it will increase the file size but it also ensures that viewers can see text in your chosen font. If fonts are not embedded and the viewer does not have the chosen font installed on his or her computer, the text will be displayed in Arial.

Anark_Studio_User_Guide.book Page 22 Monday, March 19, 2007 10:34 AM

Page 31: Anark Studio4 User Guide

User Reference 23

Understanding objects and resources

Project InfoAuthor – Allows you to enter the name of the author of the project.

Company – Allows you to enter the name of the company where the project was created.

Anark Client License – Enter a valid client license code, which grants you a full legal license to your content. Only licensed content has access to Anark Playback Module loading, XML script object loading or posting, or the use of internal and external commands to interact with a web browser.

Preview PreferencesSelect Application – Sets whether Anark Player, the default Web browser, or another type of viewer (custom) will be used for previewing the project. For more information about previewing a project, see “Previewing a presentation” on page 174.

Understanding objects and resourcesThis manual frequently refers to objects and resources, which are closely related, but the distinctions between them are important to understand.

An object can be loosely defined as any visual or auditory element that can be added to a scene, or any element that controls how the contents of the scene are viewed. Objects such as 3D models, video images, streaming music and 2D graphics have a physical presence. They can be seen or heard in the project. Several other objects, including layers, groups, lights and cameras, control the way the visual objects are grouped and

viewed but are not directly visible them-selves. Behaviors are a special type of object that add interactivity to the scene.

A resource refers exclusively to objects that have been added to the Library. Resources act as templates for creating instances of objects in the scene. Their data is embedded in the finished presen-tation file and increases its size.

Custom properties for objects are made at the Library resource level, so if a prop-erty is added to one instance, it is auto-matically propagated to the Library resource and all other instances at the same time. See “Working with custom properties” on page 76 for more details.

For information about working with objects and behaviors in a scene, see “Chapter 3: Creating a Project” on page 47. For more information about resources and the Library palette, see “About the Library tab” on page 26.

Quick DefinitionObject - An object is any visual or audi-tory element that can be added to a scene, or any element that controls how the contents of the scene are viewed.Resource - A resource is an object that is in the Library palette, and that can be used to create instances of objects in the scene.Behavior - A behavior is a special type of object that contains instructions for how other objects should act. Behavior scripts are XML (Extensible Markup Language) documents with a .bvs extension. They are typically used to add interactivity to the scene.

Anark_Studio_User_Guide.book Page 23 Monday, March 19, 2007 10:34 AM

Page 32: Anark Studio4 User Guide

24 Anark Studio User Guide

Chapter 1Anark Studio Overview

About the Basic Objects tab

The Basic Objects tab contains a row of buttons that allow you to add built-in objects and primitives to your project. There are nine built-in resource object types: Component, Group, Text, Layer, Camera, Light, Behavior, Video and Music. There are five primitive objects: Rectangle, Sphere, Cube, Cylinder and Cone.

Every time an item from the Basic Objects tab is dragged into the project, it’s added to the Library and therefore increases the finished file size. Whenever possible, it’s a good idea to reuse existing Library resources instead of continually adding new resources. An exception to this rule is text objects. Because they are not added to the Library, you must drag instances from the Basic Objects tab each time, or otherwise copy or dupli-cate them. For more information about adding basic objects to your project, see “Adding objects to the project” on page 52.

About the Storage tab

The Storage tab is a file repository that lets you quickly access object files such as 3D models, sounds, 2D graphics, videos and behavior scripts that you may want to use in your project. It features folders for organizing objects by type and a second pane to quickly access their contents.

You can drag and drop items from the Storage tab onto the Timeline or Project window, or you can add items to the Library using the Add to Library button. Items on the Storage tab are not included in a project until you add them.

Note: Text and components are not added to the Library, although the objects inside a component are. For more information, see “How text is added to the project” on page 54.

Two default folders are included when Anark Studio is installed: the Behavior

Anark_Studio_User_Guide.book Page 24 Monday, March 19, 2007 10:34 AM

Page 33: Anark Studio4 User Guide

User Reference 25

Working with the Storage tab

Library and Samples. You can add and delete folders, edit their names, etc.

Working with the Storage tabWhen you add a folder to the Storage tab, it creates a dynamic link to a direc-tory or file on your computer or network. If you rename, add, move or delete a file or directory from your computer or network, that change will be reflected on the Storage tab. You can also refresh the Storage tab manually during a session.

To add files to the Storage tab you must either map an existing directory on your computer to the Storage tab or add files to a directory on your computer or network that is already mapped to a folder on your Storage tab.

To add a folder:1. Click on the Palette menu button

( ) and select Add Folder. The Add Folder dialog box will open.

2. Select a name and a root directory for the folder. If you don’t type in a name, the directory’s current name will be used.

3. If you want this directory to be avail-able for all your Anark Studio projects, check “Create as default folder on application launch.” If you want to use it for this project only, leave it unchecked.

4. Click OK.

All of the files, folders and subfolders within the root directory will be included in the new folder on the Storage tab.

Note: When you initially add a direc-tory to the Storage tab, the absolute path is used. If you plan to share your project file (the .amw file) with

someone else, you must edit the path to be relative and ensure that they have the same directory struc-ture; otherwise, only their default folders will be displayed. For more information about specifying paths, see “Understanding paths for streaming media and dynamic images” on page 166.

Note: If you add a directory to the Storage tab from a network drive that contains an extremely large number of files, it may slow down the loading time of any Anark Stu-dio presentation that includes that folder.

To delete a folder:1. Select a folder.

2. Click on the Palette menu button ( ) and select Delete Folder. Delet-ing a folder will not remove the files from your hard drive or network. It will only delete the Storage tab’s link to the directory.

3. Click Yes.

To edit a folder:Click on the Palette menu button ( ) and select Edit Folder. Change any settings you want and click OK.

Adding objects from the Storage tab to the projectFiles on the Storage tab can be added to the Library or directly to the Project window or Timeline (which automati-cally adds it to the Library, as well). This only works for individual files, not folders. While components are not added to the Library, their contents are.

To add a resource to the Library:Do one of the following:

Select the object file and click the Add

Anark_Studio_User_Guide.book Page 25 Monday, March 19, 2007 10:34 AM

Page 34: Anark Studio4 User Guide

26 Anark Studio User Guide

Chapter 1Anark Studio Overview

to Library button.

If the Library is on a separate palette, you can drag an object file onto the Library from the Storage palette.

To add an object to the project:Drag an object file from the Storage tab to either the Timeline or the Project window. This creates an instance of the object in the project and adds it as a resource in the Library at the same time.

For more information about creating instances of objects and controlling their attachments, see “Adding objects to the project” on page 52.

Tip: When models are dragged onto the Project window, they are placed in the center by default. Holding down Alt as you drag a model will place it at the location of the mouse instead.

About the Library tab

The Library tab is a storehouse for the resources that you are using in your project. Resources act as templates for creating instances of objects in the scene.

For a description of the differences between objects and resources, see “Understanding objects and resources” on page 23.

Each object is labeled with its asset type and the full path to where the object is stored, if applicable.

With the exception of streaming music and video files, the data of each resource added to the Library is embedded in the project file and will therefore increase the final file size.

Anark_Studio_User_Guide.book Page 26 Monday, March 19, 2007 10:34 AM

Page 35: Anark Studio4 User Guide

User Reference 27

Adding objects to the Library

The Library displays the name of each built-in and imported resource and the icon for its object type. These resources serve as templates for the objects and interactive behaviors that you add to the project (using the instructions in “Adding objects to the project” on page 52).

To rename items in the Library:1. Select the item in the Library and

then double-click on the text of the item’s name or press the F2 key.

2. Type a new name and press Enter.

Adding objects to the LibraryThere are several ways to add items to the Library.

From the Storage tab using the Add to Library button. If the Library is on a separate palette, items can also be dragged onto the Library from the Storage palette. See “Adding objects from the Storage tab to the project” on page 25 for more information.

From the Basic Objects tab by adding objects to the project. See “Adding objects to the project” on page 52 for more information.

From the Library tab using the Import Resource menu item. See “Importing objects” on page 51 for more informa-tion.

Text cannot be brought into the Library. For more information, see “How text is added to the project” on page 54.

Cleaning up the LibraryAs you add and remove objects from your scene, the Library may get cluttered with resources that aren’t being used. This can significantly increase the final file size. Before you publish your project, you should clean out the Library. You

may also want to clean out the Library as you are working on a project. There are two ways to get rid of unused items in the Library.

To delete a single resource from the Library:1. Select a resource in the Library.

2. Do one of the following:

• Press the Delete key.

• Right-click and select Delete Item from the Context menu.

If there is an instance of the resource in the presentation, an error message will appear. If you still want to delete the resource, you must first delete all instances in the presentation and delete the resource again.

To delete all unused resources:With the mouse over the Library, right-click and select Delete Unused Resources from the Context menu. Every resource that is not currently being used in the scene will be deleted.

Accessing the Behavior LibraryWhen you are ready to start working with behaviors, which create the interac-tivity of the scene, you can import any of the common interactive behaviors that are included in the Behavior Library tab on the Storage tab or you can create your own.

A Behavior Reference HTML page that provides information about what each behavior does is easily accessible from the Help menu or from the Online Assis-tant (accessible from the Anark website).

The Behavior Reference Library contains brief descriptions of each behavior and how they operate. Behaviors are sepa-rated into categories based on their func-tionality. The majority of behaviors have

Anark_Studio_User_Guide.book Page 27 Monday, March 19, 2007 10:34 AM

Page 36: Anark Studio4 User Guide

28 Anark Studio User Guide

Chapter 1Anark Studio Overview

sample presentations that show how to correctly setup and use the behavior.

To create a custom behavior, you can click on the Behavior button in the

toolbar to create an empty Behavior object and then edit the behavior using the instructions in “What are behavior scripts?” on page 72.

Anark_Studio_User_Guide.book Page 28 Monday, March 19, 2007 10:34 AM

Page 37: Anark Studio4 User Guide

User Reference 29

About the Inspector tab

About the Inspector tab

The Inspector tab is used to edit the properties of selected objects and behav-iors.

When a resource is selected in the Library or an object is selected in either the Timeline or the Project window, the current settings for its editable properties are displayed in the Inspector. When an object in the Timeline is selected, Animation toggles ( ) also appear.

Each object type has its own set of prop-erties. The editable properties of behav-iors are also displayed in the Inspector when selected.

The Inspector features several types of parameter controls, such as pull-down menus, sliders and numerical entry boxes. For added flexibility, the interface

includes several ways to quickly change the numerical parameter settings of objects in the Inspector.

You can display a help tip for each prop-erty in the Inspector when you hold the mouse over the property’s entry field.

To turn on the Animation toggle for an object or property:Do one of the following:

Click on the box next to the object’s name to turn on the Master Animation toggle, which turns on the toggle for all of its properties as well.

Click on the box next to a property to turn on only that Animation toggle.

The Animation toggle must be turned on in order to set keyframes for a property.

For more information about the Anima-tion toggle, see “Using the Animation toggle” on page 146.

Quick DefinitionParameter - A parameter is a value for an object that is available to the Anark Studio interface, such as Opacity and Scale.Property - A property is a value for an object. This includes both parameters and any variables that are not pub-lished to Anark Studio. Since no unpublished properties are discussed in this manual, the two terms are used interchangeably.

Anark_Studio_User_Guide.book Page 29 Monday, March 19, 2007 10:34 AM

Page 38: Anark Studio4 User Guide

30 Anark Studio User Guide

Chapter 1Anark Studio Overview

To set a numeric property in the Inspector:1. Click in the edit field of the property

you want to change.

2. Do one of the following:

• Type in the desired value and press Enter/Return.

• While holding down the mouse button, drag up to increase the property value or down to decrease the property value.

• Use the up arrow key to increase the property value or the down arrow key to decrease the property value.

• Roll the mouse wheel up to increase the property value or down to decrease the property value.

When incrementally changing a value (while dragging a value or when using the arrow keys or the mouse wheel) the property is changed in increments of 1. Holding down the Shift key changes the value in increments of 10. Holding down the Ctrl key changes the value by .10.

For information about setting properties for objects, see “Chapter 5: Setting Object Properties” on page 81. For infor-mation about setting keyframe data using the Inspector (which is used to

create animation), see “Setting keyframes” on page 152.

To enable or disable tool tip display:Select View > Tool Tips.

To resize the property entry fields:Drag the divider bar at the top of the Inspector to the desired location.

Units of measurementUnless otherwise indicated, the parame-ters of objects are set in generic “world” units. Unlike standard measurements like inches or centimeters, these units are arbitrarily defined by the 3D space taken up by the various elements of the project.

Anark_Studio_User_Guide.book Page 30 Monday, March 19, 2007 10:34 AM

Page 39: Anark Studio4 User Guide

User Reference 31

About the Assistant palette

About the Assistant palette The Assistant palette provides quick access to the Behavior Reference and the online Reference Manual. The first time Anark Studio is launched after installa-tion, a welcome page will open in the Assistant palette. You can use the links to navigate to the desired resource.

About the Timeline tabThe Timeline tab is where the elements of a project are organized and animated. Many of the parameters that can be set using the Inspector can be animated using the Timeline tab. The Timeline tab has several panels and controls. For more information about animating objects see “Chapter 7: Animating Objects” on page 145.

Anark_Studio_User_Guide.book Page 31 Monday, March 19, 2007 10:34 AM

Page 40: Anark Studio4 User Guide

32 Anark Studio User Guide

Chapter 1Anark Studio Overview

A. Breadcrumbs – Helps you quickly nav-igate between components and the Scene.

B. Current time – Displays the current time in the presentation, according to the location of the Playhead.

C. Filter buttons and toggles – Control whether objects will appear in the Object outline or project, and whether they can be edited. • Shy – Determines whether an object

will be shown in the Object outline. If the Shy toggle is on for an object and the Shy filter button is on, neither the object nor any of its children will appear in the list. For more information, see “Using the Shy toggle and button” on page 64.

• Active – Determines whether an object will be active in the project. For more information, see “Using the Active toggle and button” on page 64.

• Locked – Determines whether an object’s properties can be edited. For more information, see “Using the Lock toggle and button” on page 64.

D. Playhead – Points to the current time in the Project window. For more information, see “Using the Playhead” on page 150.

E. Actions column – Indicates when an object has an action associated with it. For more information, see “Under-standing actions” on page 120.

F. Object outline – Contains a hierar-chical list of all objects and behaviors that have been added to the project, along with any animatable parame-ters. For more information, see “Working with the Object outline” on page 62.

G. Time pane – Contains controls for animating the parameters of objects and behaviors. For more information, see “Overview of the Time pane” on page 147.

Anark_Studio_User_Guide.book Page 32 Monday, March 19, 2007 10:34 AM

Page 41: Anark Studio4 User Guide

User Reference 33

About the Timeline tab

Anark_Studio_User_Guide.book Page 33 Monday, March 19, 2007 10:34 AM

Page 42: Anark Studio4 User Guide

34 Anark Studio User Guide

Chapter 1Anark Studio Overview

Anark_Studio_User_Guide.book Page 34 Monday, March 19, 2007 10:34 AM

Page 43: Anark Studio4 User Guide

2

35

Chapter 2: Preparing Models, Videos and Images

While it’s possible to create a project using only the primi-tive objects that are available on the Basic Objects tab, video, custom-designed 3D models and 2D images can be used to create vivid backgrounds, interesting visual effects and richly layered content.

There are several guidelines to keep in mind when creating 3D models. In addition, there are some tips and tricks for getting the best results from your 2D images and video clips.

This section assumes that you have experience creating objects in 3D modeling and 2D graphics programs and are familiar with their capabilities.

Anark_Studio_User_Guide.book Page 35 Monday, March 19, 2007 10:34 AM

Page 44: Anark Studio4 User Guide

36 Anark Studio User Guide

Chapter 2Preparing Models, Videos and Images

Choosing a 3D program and export file formatCurrently, Anark Studio can read 3D files created in the following applications:

.3ds files created in 3ds max™ Release 2.5 or later

.amx files created in:

• 3ds max Release 5.0 or later

• Maya version 4.0 or later

• LightWave 6.5 or later

• Cinema 4D 8

.dae (Collada) files created in 3ds max or Maya

3ds max, Maya, LightWave and Cinema 4D are 3D modeling, animation and rendering programs.

Exporting to the AMX format is recom-mended for most projects unless the 3D scene includes instances, which are supported in .3ds but not in .amx. If your 3D scene includes animation, exporting to .dae will allow you to import that animation into Anark. For information about the exporter plug-ins, see “Working with exporter plug-ins” on page 40.

About the AMX formatAMX is a file format created by Anark to generalize the format of 3D files so that the widest variety of 3D models and scenes can be imported into Anark Studio.

To enable the various modeling and conversion programs to export 3D models and scenes in the AMX format, Anark has created exporter plug-ins for those programs. With the exception of files that were originally created in Maya, AMX files include all geometry, hierarchy, groups, precise normals,

materials and maps. The Anark Maya AMX Exporter includes everything except texture map data.

As new exporter plug-ins become avail-able, they will be posted in the online Assistant Palette.

About the Collada formatCOLLADA (COLLAborative Design Activity) is a royalty free, open standard for the interactive entertainment industry. The standard defines an XML-based schema for 3D authoring applica-tions to freely exchange digital assets without loss of information. This enables multiple software packages to be combined into powerful tool chains.

ColladaMaya translatorThe Maya Collada plug-in supports importing/exporting Maya scenes according to the Collada format specifi-cations. The binaries, source code and all associated documents are released under the MIT License. Please take the time to read the documentation before using ColladaMaya.

Anark Studio ships with a custom-built exporter plug-in for Maya. This exporter fixes some known bugs existing in the ColladaMaya exporter available from Feeling Software, and is available in the Collada folder of the Anark Studio instal-lation directory. Use this exporter if you wish to create Collada files with Anark Studio.

ColladaMax translatorAnark Studio can import Collada files exported from 3ds max using the 1.05 version of the Feeling Software Collad-aMax exporter. You can find the installer for this exporter, plus installation instructions, in the Collada folder of the Anark Studio installation directory.

Anark_Studio_User_Guide.book Page 36 Monday, March 19, 2007 10:34 AM

Page 45: Anark Studio4 User Guide

User Reference 37

Tips for creating models, materials and maps

Tips for creating models, materials and mapsWhen creating models in a 3D modeling program or converting them from other formats into AMX, these tips will help produce the best results.

Note: Because the Anark Maya AMX Exporter does not export texture map data, you can ignore all guide-lines related to image maps.

General modeling guidelines and best practices

Anark Studio limits a single model’s complexity to 65,000 vertices or 21,000 faces. All models must be triangulated.

If you want to apply any kind of texture map in Anark Studio, your model must have UV coordinates on it.

If you apply any kind of bitmap image to a model, it will more than double the finished file size.

All bitmap images that have been applied to a model will import as uncompressed bitmaps. If you want to reduce the file size, select the image in the Library palette in Anark Studio and set the desired compression using the Inspector. Setting compression levels on one image will distribute the settings to all instances of the image. See “Setting properties for images” on page 104 for more information.

As you work in a modeling program, create and edit your models in the native format. Export them to .3ds or .amx after they are completed. See “Choosing a 3D program and export file format” on page 36 for more infor-mation about deciding what file format to use.

Avoid using a negative scale value for polygons. If any of the polygons in your model have a negative scale value, they will be interpreted incor-rectly in Anark Studio. If the model is exported as an AMX file, the negative values are retained and the polygons will appear black. If the model is exported as a 3DS file, Anark Studio will turn the negative values into posi-tive values.

It’s always a good idea to name all models, materials and maps.

Important: Due to the parameters of the .3ds format, the name of a map can only be eight characters long (plus the three-character file exten-sion). For example, if you applied a texture named RockTexture.png to a model, you would have to rename it ROCKTEXT.PNG before exporting the model. The AMX format does not have this limitation.

If you plan to apply video or bitmap images without color shifting, set the Diffuse Color of the Material to White.

Guidelines for working in 3ds max

To ensure that the units will be the same in 3ds max and Anark Studio, set the units to 1 inch in 3ds max. To do this:

a. Pull down the File menu.

Quick DefinitionImage Map - An image map is a 2D graphic image that has been wrapped around a 3D object by mapping it to the object’s material. Some 3D model-ing applications refer to image maps as bitmaps, textures or texture maps.

Anark_Studio_User_Guide.book Page 37 Monday, March 19, 2007 10:34 AM

Page 46: Anark Studio4 User Guide

38 Anark Studio User Guide

Chapter 2Preparing Models, Videos and Images

b. Select Preferences. The Preferences window will open.

c. Select the General tab.

d. On the General tab, set System Unit Scale to: 1 unit = 1.0 inches.

e. Click on the Automatic Unit Con-version button.

Settings in Smoothing Groups will take precedence over any settings in Shading Mode (also called Rendering Mode). For example, even if you set the Material Shading Mode to Constant (or Smooth), if adjacent sets of facets have different Smoothing Groups, it will render an edge between them.

Pivot point guidelinesWhen setting the pivot point on a model, make sure it is aligned to the world. To do this in 3ds max:

a. Select the model.

b. Click on the Hierarchy tab.

c. Select Affect Pivot Only.

d. Click on the Align to World button.

If a model is not aligned to the world before it is exported, an extra group will be added to the model’s hierarchy with a “pivot” extension in order to preserve the pivot infor-mation.

Material Editor guidelinesWhile all Basic Parameters are preserved when a model is exported, there are a few Material settings that either aren’t used in Anark Studio or are used differently than in the modeling program. They include:

• Face Map and Faceted (under Options) are not exported, although

Wire and 2-sided are.

• Extended Parameters are not exported.

• The following maps are preserved during export:

- Diffuse Color

- Specular Color

- Opacity

- Self-Illumination (or Emissive)

- Reflection

All other maps (such as Ambient Color, Filter Color, Bump and Refraction) are converted into Dif-fuse Color maps when imported into Anark Studio.

You can assign different materials to individual faces or a grouping of faces. Refer to the 3ds max documentation for instructions on doing this.

Map guidelinesOnly Bitmap maps are preserved during export. Others such as Mix, Noise, Cellular, Smoke, etc., are not exported.

Bitmap Parameters are not used.

Most Coordinates information is preserved, with the exception of Blur settings.

W Angle settings on maps in 3D max are not imported into Anark Studio. If you want a map to be rotated on an object, set the UV Rotation on the image directly in Anark Studio using the Inspector palette.

When working in 3ds max, if you need to rotate, scale or edit an image map, do not do it in the Material Editor; adjust the UV coordinates instead.

Anark_Studio_User_Guide.book Page 38 Monday, March 19, 2007 10:34 AM

Page 47: Anark Studio4 User Guide

User Reference 39

Guidelines for working in Cinema 4D

See “Preparing video clips and graphics as image maps” on page 41 for more tips on working with maps.

Guidelines for working in Cinema 4D

Only pure polygon objects can be exported, so do not include any spline, lathe, patch or other object types.

All polygon normals must be facing the proper direction. You can switch on the Show Normals option to check that the normals are facing the proper direction.

Do not import 3ds files. They are not interpreted correctly and thus will not export to the AMX format correctly.

Guidelines for working in MayaIf a model you are working on in Maya has a texture map applied to it, Maya automatically sets the Shader diffuse color to black. When the model is brought into Anark Studio, the texture map information is not imported and the diffuse color is set to light gray.

Only polygonal models will be exported; NURBs (non-uniform rational B-splines) and Subdivision Surface models should be converted to polygons before exporting.

Layered and Surface shaders are not exported, although Anisotropic, Blinn, Lambert, Phong and PhongE shaders are.

There is a 100:1 ratio of scale between Maya and Anark Studio units. Any model that is created at a 1 unit size in Maya (such as any primitive model’s default size) will need to be scaled up 100 times to be seen in Anark Studio’s default viewport setting.

Guidelines for exporting to .3dsBe sure to use “eight dot three” file names (eight-character name plus three-character file extension) for all maps and ensure these maps are in the same directory as the saved .3ds file.

If a bitmap has been applied to the model (or if you intend to apply an image to it in Anark Studio), it must have UV coordinates on it and you must check Preserve Texture Coordi-nates in the Export dialog box.

Guidelines for exporting to .dae

GeometryAll polygon geometry is supported.

NURBS and sub-division surfaces need to be tessellated first before they can be exported.

MaterialsSupported ColladaMaya material types:

• Constant (flat shading)

• Blinn

• Phong

• Lambert

Note: The shading types Blinn, Phong and Lambert are switched to use Gouraud shading at the time of conversion.

Supported color types:

• Diffuse

• Ambient

• Specular

Opacity, specular power, and emissive power are supported.

Material modes supported:

• Solid

Anark_Studio_User_Guide.book Page 39 Monday, March 19, 2007 10:34 AM

Page 48: Anark Studio4 User Guide

40 Anark Studio User Guide

Chapter 2Preparing Models, Videos and Images

• Wireframe

• Double-sided (normals may need be flipped in Maya first if they appear odd when imported)

Textures2D-placed texture only

Supported map channels:

• Diffuse

• Opacity

• Specular

• Reflection

• Shininess

• Emission

Supported texture parameters:

• Coverage U/V

• RepeatU/V

• OffsetU/V

• RotateU/V

TransformationTranslation, rotation, scaling, rotate pivot all supported.

No scale pivot, skewing/shearing.

AnimationAnimatable properties:

• Rotation.

• Transformation (translation, scaling).

• Materials – diffuse color, ambient color, specular color, specular power, emissive power, opacity.

Unsupported featuresNo Collada FX support (no shaders, etc.).

No physics support.

No joints and rigging.

Splines and other curve animations are not supported (however, using the ‘Sampling’ option in the ColladaMaya exporter forces them to be exported as keyframes).

Lights and cameras are ignored.

Guidelines for exporting to .amxThe .amx file format enables the use of GIFs as image maps. However, GIFs cannot be imported into Anark Studio directly. They must be mapped to a model using a modeling program and then exported to the .amx format. Once imported into Anark Studio, they can be used on other models in addi-tion to the model to which they were originally attached.

With the exception of files that were originally created in Maya, all texture bitmaps are saved into the AMX file. It is not necessary to keep the texture bitmaps on disc with the AMX file. The Anark Maya AMX Exporter does not export texture map data.

Cameras and lights are not exported. However, target nodes may be exported as empty groups in the AMX file.

The current version of the Anark AMX exporter does not correctly save out rotated pivot point/axis information.

Working with exporter plug-insIn order to work with a wide variety of 3D modeling programs, each of which has a specific file format, Anark has created the AMX file format. To export a 3D model into this format so that it can then be imported into Anark Studio, you need to install an exporter plug-in for

Anark_Studio_User_Guide.book Page 40 Monday, March 19, 2007 10:34 AM

Page 49: Anark Studio4 User Guide

User Reference 41

Exporting models to .amx

the modeling or conversion program. Currently, there are plug-ins for:

3ds max Release 5.0

Maya version 5.0 or later for Windows

LightWave 3D for Mac OS X version 7.5 or later and Windows version 6.5 or later

Cinema 4D version 8.0 or later for Mac OS X

From time to time, new AMX Exporter plug-ins may be available in the online Assistant Palette, along with instructions for installing and working with them.

The plug-ins and their associated ReadMe files are located in your Anark Studio installation directory inside the AMX Exporter Plug-ins folder.

Exporting models to .amxAfter you have created and saved a model or scene in 3ds max, Maya or Cinema 4D, you can export it. Exporting files to the AMX format requires that you first install a plug-in for the 3D modeling program.

Note: The LightWave plug-in offers some additional features that aren’t covered in this section. See the ReadMe files for the plug-in for more information.

To export a file to the AMX format:1. When you are finished working on

your scene or model in 3ds max, Cin-ema 4D or Maya, do one of the fol-lowing:

• Select File > Export (Export All in Maya).

• Select the models you want to export and select File > Export Selected. Child objects will not be

exported unless their parent objects are selected as well. This option is not available in Cinema 4D.

2. Create a name for the file and select Anark Exchange (*.AMX) from the Save as Type pull-down.

Anark Exchange files are imported exactly like all other files. See “Adding objects to the project” on page 52 for more information.

Exporting models to .3dsOnce you have created a model in 3ds max, you must prepare it for export into the .3ds file format. The final steps before exporting the file are:

1. Reset the Xform (Transform). To do this:

a. Select the model(s).

b. Click on the Utilities tab.

c. Click the Xform button.

2. Collapse the stack of each model.

If a bitmap has been applied to the model (or if you intend to apply an image to it in Anark Studio), it must have UV coordinates on it and you must check Preserve Texture Coordinates in the Export dialog box.

Preparing video clips and graphics as image mapsWhen preparing images for use in either a modeling program or Anark Studio, these tips will help produce the best results:

When working with images and video, you should always try to keep the dimensions in powers of 2, such as 8, 16, 32, 64, 128, 256, 512, etc. Any combination will work (16 x 128, 128 x 256, 8 x 512, 128 x 64, etc.), although square dimensions work best

Anark_Studio_User_Guide.book Page 41 Monday, March 19, 2007 10:34 AM

Page 50: Anark Studio4 User Guide

42 Anark Studio User Guide

Chapter 2Preparing Models, Videos and Images

with certain video cards. If you decide to use dimensions that are not in powers of 2, such as 210 x 112, during playback, the graphics card will auto-matically rescale the image to 256 x 128, which can make the image appear fuzzy. Not using a power of two for certain video types that are set to tile may cause a black margin to appear between the tiled images.

Try to limit image dimensions to less than 256 pixels in width and height to conserve Texture memory and band-width for Internet broadcasts.

In general, you should import uncom-pressed images and then use the Compression Type, Compression Quality and Image Size Reduction settings in Anark Studio. Avoid importing .jpg images because all image files are recompressed in Anark Studio, which can inadvertently increase the file size. See “Setting prop-erties for images” on page 104 for more information.

For video clips, choose a compression type that is suitable for your band-width. Compression Technologies’ CinepakPro™ (http://www.cinepak.com/) is known to work fairly well.

When an AVI is used as a map for a material in 3ds max, only the first frame of the video is used as the map when the model is imported into

Anark Studio. To successfully map the video to the model in Anark Studio, you need to delete the single-frame image map attached to the model’s material, import the .avi file directly into Anark Studio and reattach it to the material. For more information about working with video, see “Adding streaming media files to a project” on page 167.

If the video will be mapped to a rect-angle or square, you can maintain the aspect ratio while compressing the file from 320 x 240 (the standard setting) down to 256 x 192 in order to improve performance. If the video will be mapped to an object with curves, where it will already be distorted, it’s recommended that you compress it down to 256 x 256.

Be judicious about the codecs and compression you choose to ensure that the file sizes are only as large as needed in order to conserve processor power and bandwidth. For example, a Reflec-tion Map can be highly compressed and the results will still be rendered well.

When applying video or images without color shifting, be sure to set the Diffuse Color of the Material to White.

See “Map guidelines” on page 38 for more information on applying images to models.

Anark_Studio_User_Guide.book Page 42 Monday, March 19, 2007 10:34 AM

Page 51: Anark Studio4 User Guide

User Reference 43

Preparing image files in Adobe Photoshop

Preparing image files in Adobe Photoshop

General settingsAnark Studio can only work with 8-bit per channel image files, which is the default setting in Photoshop. If you have changed the Photoshop file to the 16-bit per channel mode, you will need to change it back to the 8-bit mode when you export it for Anark Studio. There should be no loss of quality when you do this.

To set a Photoshop file to 8-bit mode:Select Image > Mode > 8 Bits/Channel. You can then export the image to the file format you want to use in Anark Studio.

Creating a PNG file for an Opacity MapIf you are creating an image in Adobe Photoshop that you plan to use as an Opacity Map in Anark Studio, it’s recom-mended that you export it to the .png format. This is because .png is a 32-bit file format that includes alpha channel information. The alpha channel is what specifies the transparency of each pixel in the image.

Adobe Photoshop 5 or later includes a wizard that walks you through the export process. Use the following instructions to export the image:

1. Create an image on a layer in Photo-shop and add the transparency where you want it.

2. Select Help > Export Transparent Image. The export wizard will open.

3. Select “My image is on a transparent background.” Click the Next button.

4. For the question “What will this image be used for?” select “Online.” Click the Next button.

5. For the question “What image format would you like?” select “PNG.” Click the Next button.

6. Use the browser window to select a name and location for the file.

7. Click OK.

For more information about using the image as an Opacity Map, see “Creating an Opacity Map” on page 112.

Troubleshooting models, materials, videos and images

General troubleshootingWhen I add an image to a material on a model, it has a seam along the back of the object.The seam is the result of the way Anark Studio wraps the image around the model. This is normal, but if the back of the model will show in your presenta-tion, one way to minimize the seam is to select the image and set the U Repeat to 2 (or more) and U Tiling to Mirrored. See “Setting properties for images” on page 104 for more information on setting U Repeat and U Tiling.

An image or a model appears to flicker or has a “window blinds” effect on it.The object may need to be brought forward in the scene slightly. This is because when two objects are either on the same plane or are very close to it, the rendering engine can’t always decide which to render in front of the other. An example of this might be a label model mapped on top of a CD case model. To

Quick DefinitionAlpha channel - An alpha channel is the portion of an image’s data that specifies the transparency of each pixel in the image. Some popular image types, such as JPEG, do not support alpha channel data.

Anark_Studio_User_Guide.book Page 43 Monday, March 19, 2007 10:34 AM

Page 52: Anark Studio4 User Guide

44 Anark Studio User Guide

Chapter 2Preparing Models, Videos and Images

fix the problem, simply move the label slightly closer along the Z axis.

I want to use an AVI video file in my project, but it won’t import, even though it’s listed as a supported file type.Anark Studio works with most, but not all AVI files. Some video card manufac-turers create proprietary AVI codecs, which Anark Studio may not be able to work with.

There’s a black border between tiled video clips on a model.The video dimensions need to be set to a power of two such as 8, 16, 32, 64, 128, etc.

When I apply an image to a material on an imported model, only a single color is applied.The model doesn’t have UV coordinates. You must create UV coordinates for it in your 3D modeling application and re-import it or refresh the file.

When I drag a video resource onto a layer or a material on a model, the object turns black. Where’s the video?There are a couple of possibilities.

Your video may have an unsupported bit depth. In Windows, only 32-bit depth video files will work. Video files with other bit depths will not show up at all.

The video may still be loading or Anark Studio may not be connecting to the resource properly. Large video files, high resolution video and uncom-pressed video can all take a while to load. If the video takes longer than normal to appear, try the following:

a. Check to see if there is a Remote Source for the video resource. This is the URL of the video file or the fully qualified absolute or relative path to it.

b. Turn on Connect to Source by checking the box.

c. Drag the Playhead.

The video should now be displayed.

3ds max troubleshootingWhen I import a model and drag it onto the Project window, it doesn’t appear.There are several possibilities:

The scale of the object may be so large that the camera is actually inside it, which means you won’t be able to see it unless you move the camera or the object or you reduce the scale of the object.

Alternatively, the scale of the object may be so small that you can’t see it on the screen. You can either increase the object’s scale or you can move the camera closer to the object.

In some cases, 3ds max may have created an empty object (i.e., a node that doesn’t contain any geometry), which Anark Studio is unable to read. Go back into 3ds max and view all the objects in the file (the schematic view and the Select Objects dialog box are two options for doing this). Delete any object that does not contain geometry that is visible in the scene, save the .3ds file and reimport it into Anark Studio.

When I import a .3ds object, the models are no longer in the same position in relation to each other. You must go back into 3ds max and reset the Xform (Transform) and collapse the stack of each model before importing the object into Anark Studio. For detailed instructions, see “Exporting models to .3ds” on page 41.

Anark_Studio_User_Guide.book Page 44 Monday, March 19, 2007 10:34 AM

Page 53: Anark Studio4 User Guide

User Reference 45

3ds max troubleshooting

When I add an image to the material on a model that I imported from 3ds max, the image doesn’t appear. The .3ds model was never given UV mapping coordinates. You can either choose another type of texture map

(anything except UV mapping) or you can go back into 3ds max and set UV mapping coordinates for the model. Then save the .3ds file and reimport it.

Anark_Studio_User_Guide.book Page 45 Monday, March 19, 2007 10:34 AM

Page 54: Anark Studio4 User Guide

46 Anark Studio User Guide

Chapter 2Preparing Models, Videos and Images

Anark_Studio_User_Guide.book Page 46 Monday, March 19, 2007 10:34 AM

Page 55: Anark Studio4 User Guide

3

47

Chapter 3: Creating a Project

When Anark Studio is first started, a blank project file is cre-

ated. There are no visible objects in the Project window, although there is the root object (the scene) and a single layer with a default camera and default light attached to it. Behaviors, layers, music and sounds can be attached to the scene, but all other objects that you want to be part of a project must be attached, either directly or through other attachments, to a layer.

Anark_Studio_User_Guide.book Page 47 Monday, March 19, 2007 10:34 AM

Page 56: Anark Studio4 User Guide

48 Anark Studio User Guide

Chapter 3Creating a Project

Understanding layersA layer is a special way to group the elements of the scene. Layers in Anark Studio are similar to the layers used in many 2D graphic design programs. In 2D graphics, layers are rendered like stacked sheets of acetate.

The content of each layer remains distinct from the content of other layers so that effects can be applied to the content of a particular layer without affecting the content of other layers. The final image is a composite of all the layers, which means that the content of the top layers may obscure the content of lower (or “farther”) layers.

3D layers in Anark Studio are used in a similar way, but instead of being rendered like sheets of acetate, they are rendered like a stack of glass blocks. Each

block contains a 3D scene with elements that interact with each other, but not with the elements of the other layers. Effects like fades can be applied to one layer without affecting the other layers. As with 2D layering, the final image is a composite of all the layers, so that objects attached to layers that are more distant will never pass in front of objects attached to the top layers. There can be a single layer or many layers in a project. When a layer is added to the project, it already has a default light and a default camera attached to it. The default layer, light and camera are on the Master Slide. For more information about the Master Slide, see “About Master slides” on page 134.

The only object that layers can be attached to is the Scene object.

Anark_Studio_User_Guide.book Page 48 Monday, March 19, 2007 10:34 AM

Page 57: Anark Studio4 User Guide

User Reference 49

Understanding attachments

Understanding attachmentsAnark Studio uses hierarchical attach-ments between objects and behaviors to organize the visual content of the project and to provide fine-grained control over the animation and interac-tivity of the scene. The analogy of a family tree is typically used to describe these hierarchical attachments:

Parent – An object that influences some of the properties (e.g., position, rotation, duration) of one or more chil-dren that are directly attached to it.

Child – An object that is attached directly to a parent object, which influ-ences some of its properties. Child objects can have children attached to them.

Root – An object at the top of the hier-archy. Root objects can have children, but no parents. The scene is the root object in Anark Studio.

These attachments allow you to set up animation parameters and interactive behaviors for groups of objects with a single setting and to animate objects in relation to other objects.

A good example of both groups and hier-archical attachments is the solar system. Several moons revolving around a single planet can be thought of as a group with an attachment to the planet. The planet, in turn, is attached to the sun around which it revolves.

To create this solar system in Anark Studio, you would first attach the Sun

object as a child of a layer (which can only be attached to the scene), then attach a Planet object as a child object of the Sun, and attach the Moons Group as a child object of the Planet. In the Object outline it would look like this:

The effect of this structure is that as the planet moves in its orbit around the sun, the moons move with it so that the path of the moons is directly affected by the path of the planet. These hierarchical attachments are one-directional, however, so the path of the moons does not affect the path of the planet.

As you begin adding objects to your project, you’ll need to consider how you want them grouped and attached. If you want to work with several objects as a single unit, you will need to attach them to a group. If you want objects to move in relation to one another, you will need to create a parent/child hierarchical attachment between them.

For information about creating attach-ments between objects, see “Adding objects to the project” on page 52. For information about changing existing attachments, see “Working with the Object outline” on page 62.

Anark_Studio_User_Guide.book Page 49 Monday, March 19, 2007 10:34 AM

Page 58: Anark Studio4 User Guide

50 Anark Studio User Guide

Chapter 3Creating a Project

Understanding the coordinate systemAnark Studio uses a left-handed coordi-nate system. This means that positive Z is toward the screen (away from the viewer), positive Y is up, and positive X is to the right.

Positive rotation is clockwise around the axis of rotation.

Anark Studio uses a left-handed coordinate system.

How the object hierarchy affects attachmentsThe Scene object is at the top of the object hierarchy in Anark Studio. The only objects that can be attached to the Scene directly are layers, behaviors, sounds and music. Layers cannot be added to any other object type. The first layer in the Object outline is at the top of the layer stacking order. The last layer in the Object outline will be the bottom layer (i.e., the farthest layer) in the project.

Behaviors can be attached to any object, but objects cannot be attached to behaviors.

Understanding pivot pointsThe pivot point for an object serves as the center for its rotation and provides the coordinates for scaling. In Anark Studio, the pivot point is displayed as an axis tripod (green = Y, red = X, blue = Z). Only the pivot point of the topmost selected object is displayed.

Because attachments are made between objects at their pivot points, the position property of child objects is based on the location of the pivot points of both the parent and the child. For example, the pivot point of a parent object is also the origin (0, 0, 0) position for its child objects. The scale and rotation properties are based on the object’s own pivot point, although the pivot point of the parent acts as the origin of the child.

An object’s pivot point is displayed as an axis tripod (top). Notice how on the jet (below), only the topmost selected object’s pivot point is shown.

To display or hide pivot points:Choose View > Pivot Point (Ctrl + Alt + P).

Anark_Studio_User_Guide.book Page 50 Monday, March 19, 2007 10:34 AM

Page 59: Anark Studio4 User Guide

User Reference 51

Importing objects

Importing objectsIn addition to the basic objects that are included in Anark Studio on the Basic Objects tab, most projects would typi-cally include digital 3D mesh objects, music, sounds, video clips and/or graphics created in other applications. These objects must be imported into your Anark Studio project.

To import an object or behavior:Do one of the following:

Drag an item from the Basic Objects or Storage tab to the Library, the Object outline in the Timeline or the Project window.

Drag a file from a Windows Explorer window onto the Project window, the Library or the Object outline in the Timeline. You can drag multiply-selected objects this way.

Choose File > Import Resource (Ctrl + R). Locate and select an item to import from the file browser, and click Open.

With the mouse over the Library, right-click and select Import Resource from the Context menu. Locate and select an item to import from the file browser, and click Open.

Components that were previously exported can be imported and attached to an object already in the

project. For more information, see “Exporting and importing compo-nents” on page 60.

The imported item will appear in the Library. Text objects and components are handled a little differently than the other object types. For more information about them, see “How text is added to the project” on page 54.

If the item was dragged onto the Project window or the Object outline, then it will create an instance of the object in the project as well. If the selected file is not a supported media format, an error message will appear.

When a 3D file is imported or added to the Library, Anark Studio recognizes all of its models, materials and image maps and creates a Group object to contain them. These attachments are reflected in the Library’s display.

The Library tab displays a model’s hierarchi-cal attachments (left), while the Storage tab displays only the file directory (right).

Anark_Studio_User_Guide.book Page 51 Monday, March 19, 2007 10:34 AM

Page 60: Anark Studio4 User Guide

52 Anark Studio User Guide

Chapter 3Creating a Project

Adding objects to the projectWhen you add an object to the scene using a resource in the Library as a template, you create an instance of it. When you add an object to the scene by dragging an item from the Storage or Basic Objects tabs, or from a Windows Explorer window, it automatically adds it to the Library and creates an instance of it at the same time.

Because adding items to your library increases the finished file size, you should reuse Library resources whenever possible. For example, if you want to create three different buttons using a custom model, you can create one instance by dragging the model from the Storage palette and then drag out two more instances using the Library resource instead of the Storage palette (which would add additional Library resources).

Note: Text and components are never added to the Library, although the objects inside the component are. For more information, see “How text is added to the project” on page 54.

There are three ways to add objects to your scene:

Objects can be dragged onto the Object outline in the Timeline tab. This allows you to directly attach objects to other objects. For example, you can attach a model to a group, or

an image to a material.

When you drag an object onto the Timeline, you add it and set its attachments at the same time.

Objects can be dragged onto the Project window. When added this way, object attachments are determined in the following way:

• Music, layers, sounds and behaviors are added to the Scene object.

• Images and video are automapped to a material on a model. This means that a new rectangle primi-tive is created and the image or video is attached to the rectangle’s material.

• If currently inside a component, all objects are attached to the component.

• All other object types are attached to the currently active layer. The currently active layer is the layer that is currently selected in the Object outline or that has an attached object currently selected. If nothing is selected, then the object is attached to the topmost layer.

You can then drag items in the Object outline to change their attachments if needed, following the instructions in “Rearranging objects” on page 64.

Anark_Studio_User_Guide.book Page 52 Monday, March 19, 2007 10:34 AM

Page 61: Anark Studio4 User Guide

User Reference 53

Adding objects to the project

When you drag an object onto the Project window, it gets attached to either the Scene or the currently active layer.

Components that were previously exported can be imported and attached to an object already in the project. For more information, see “Exporting and importing compo-nents” on page 60.

Tip: It’s a good idea to give every object in your project a unique name whenever possible. See “Renaming objects” on page 63 for more information.

To add a basic object to the presentation:1. Click on one of the basic object but-

tons on the Basic Objects tab to select it.

2. Do one of the following:

• Drag it onto the Project window. It will be attached to the currently active layer.

• Drag it onto the bar of the item in the Object outline to which you want it attached.

If you create a Behavior, Music or Video object by clicking on the button rather than importing one, it is essentially an empty object with no instructions or content. You will need to do one of the following:

In order to create an effective behavior, you’ll have to edit the behavior using the instructions in “ What are behavior scripts?” on page 72. For detailed infor-mation about writing behavior scripts, see “Using Scripting” on page 203.

To add actual content to a Music or Video object, you’ll have to set a remote source for the streaming file using the instructions in “Chapter 8: Working with Streaming Media and Dynamic Images” on page 165.

To add an externally created object to the presentation:1. Select an item in the Library or Stor-

age tab or in a Windows Explorer window. If using Windows Explorer, you can select multiple items.

2. Do one of the following:

• Drag it onto the Project window. It will be attached to the currently active layer.

• If the item is from the Library, Storage tab or a Windows Explorer window, you can drag it onto the bar of the item in the Object outline to which you want it attached.

Tip: When models are dragged onto the Project window, they are placed in the center by default. Holding down Alt as you drag a model will place it at the location of the mouse instead.

Anark_Studio_User_Guide.book Page 53 Monday, March 19, 2007 10:34 AM

Page 62: Anark Studio4 User Guide

54 Anark Studio User Guide

Chapter 3Creating a Project

The duration of added objectsWith the exception of layers, sounds and music, when an item is added to the project, its duration is set to match the duration of its parent object and the item is automatically selected.

The duration of the default layer in the scene is initially set to 10 seconds. When subsequent layers are added, their dura-tion is also set to 10 seconds.

The duration of sounds and music is set to the length of the data they contain. For example, a sound might have a dura-tion of 2 seconds and a music file might have a duration of 4 minutes.

How the Ctrl key affects adding objectsHolding down Ctrl as you drag an object to the Project window or the Timeline has the following effects on the object’s timebar:

The start handle of the object’s timebar is set to the current position of the Playhead.

If the Playhead is currently located before the parent object’s end handle, the end handle of the object being added is matched to the end handle of the parent.

If the Playhead is currently located after the parent object’s end handle, the duration of the object’s timebar is set to 10 seconds.

How text is added to the projectText objects aren’t added to the Library. In order to add new instances of text to a project, you must drag them from the Basic Objects palette each time. If you want to keep the same property settings for additional instances of text, you can copy or duplicate an existing instance.

Anark_Studio_User_Guide.book Page 54 Monday, March 19, 2007 10:34 AM

Page 63: Anark Studio4 User Guide

User Reference 55

Currently supported media formats

Currently supported media formatsAnark Studio currently supports the following media formats:

There are many factors that can affect Anark Studio’s ability to work with specific files. For more information about file limitations see “Working with exporter plug-ins” on page 40.

Working with source filesWith the exception of streaming video and music, Anark Studio embeds the data of imported objects, rather than just linking to the source file. This means that you can move, edit or delete the files after they’ve been imported into Anark Studio without any effect on the resource in the Library. However, some-times you may want to update the files you have already imported into your project with changes you made to them outside of Anark Studio.

You can quickly update 3D models, behaviors, images and sounds by refreshing the Library resource.

To update a source file:1. Select a resource in the Library.

2. Right-click and select Refresh File from the Context menu.

3. Browse to the correct file and click Open.

To update all source files in the Library at once:Right-click anywhere in the Library and select Refresh all Resources from the Context menu.

Important: Refreshing objects that have child attachments (except for externally created 3D models, which are refreshed as described below) will not maintain the child attach-ments. For example, if you imported a custom 3D model into Anark Stu-dio and then attached an imported image to one of its materials, the image would be lost if you refreshed the model.

Externally created 3D models, which are always imported as Group objects in Anark Studio, are updated in the following way:

The Library resource and any instances of the group and model will be updated.

If there are several models within the group that is being refreshed, every model will be updated.

Media Formats File Extensions

3D objects .amx, .3ds, .dae

Sound files .ogg (Ogg Vorbis), .wav, aiff/.aif

Video types Windows Media: .avi, .asf, .wmvQuickTime: .qt, .movMPEG Audio: .mp2, .mp3MPEG Audio/Video: .mpg, .mpeg, .m1v, .mpe

Image files .png, .tga, .tif, .psd, .bmp, .jpg

Behavior scripts .bvs

Anark component .amc

Anark_Studio_User_Guide.book Page 55 Monday, March 19, 2007 10:34 AM

Page 64: Anark Studio4 User Guide

56 Anark Studio User Guide

Chapter 3Creating a Project

If the new source file contains addi-tional models, the new models will be added to both the Library and to any instances of the group.

If the new source file had models deleted from it, those models will also be deleted from the Library and from any instances of the group. If any of those models were moved so that they were attached to other objects instead of the original group, then those instances will be deleted as well.

If you don’t refresh a file in Anark Studio, then even if you move or delete the source file, no changes will be made to the presentation.

For information about working with streaming video and music, see “Chapter 8: Working with Streaming Media and Dynamic Images” on page 165. For information about adding instances of objects to a project, see “Adding objects to the project” on page 52. For informa-tion about object attachments, see “Understanding attachments” on page 49.

Refreshing components in the projectThe Refresh File command allows you to update multiple components within a scene from a single .amc file. In order to refresh a component in a presentation, you right-click on the component in the Library palette and select Refresh File.

This feature allows large design teams to distribute the work of creating reusable components, and facilitates collabora-tion.

WorkflowBriefly, the steps you follow to use refre-shable components are:

1. An artist creates a re-usable compo-nent as its own presentation. All changes to the master component need to occur in this file.

2. The artist exports the component to disk as a standalone Anark Media Component (.amc) file.

3. The .amc file is imported into another presentation. Instances of the component are positioned, ani-mated, and otherwise customized in this presentation.

4. When necessary, the master compo-nent presentation is changed, and the updated .amc file is re-exported to disk.

5. The artist using the component selects the component in the Library palette and chooses Refresh from File. Anark Studio updates instances of the component in the scene to use the new changes, and preserves the per-instance changes that the artist previously made.

Quickly finding a library itemTo easily find and select the associated Library asset, select the component in the Timeline and enter the keyboard shortcut Ctrl-L.

Creating refreshable componentsA single presentation potentially calls for many components that are similar, but not the same. For example, there may be ten Menu buttons, and ten more Options buttons. These two button types are different enough to justify their own master presentations and .amc files, but similar enough that it would be redun-dant to build both from scratch.

Anark_Studio_User_Guide.book Page 56 Monday, March 19, 2007 10:34 AM

Page 65: Anark Studio4 User Guide

User Reference 57

Converting legacy projects

The dilemmaSuppose you have already created the master presentation for the Menu button component, and you want to use this as the basis for the Options button compo-nent. Suppose that you then create a copy of the presentation file, modify it to be an Options button, and export the new .amc file. Because both components (and some contained items) would still have the same internal graphics unique identifier (GUIDs), you would run into trouble if you used both components in the same presentation.

When you import a component with the same GUID (but different file path) as another component already in the presentation, Anark Studio detects the conflict and shows a dialog:

There is no way to import two different com-ponents into a presentation if they share the same internal ID; you can import one or the other, but not both.

The solutionThese are step-by-step instructions for creating a new component based on an existing component, in a way that allows both to be included in the same presentation.

1. Create a new Anark Studio project. (File > New)

2. Import the .amc file for the original component into the new project. (File > Import Resource)

3. Duplicate the component in the Library. This creates new GUIDs for every item inside the component. To do this step, right-click on the

component and choose Duplicate from the Context menu.

Note: You will see a new component in the Library with the word “copy” appended to its name. You will also see all the contents of the imported component in the Library.

4. Delete the imported component by right-clicking on the item and choos-ing Delete Item from the Context menu.

5. Save the new project. (File > Save)

At this point, the new project may be customized and the component inside it exported as an .amc file, with no danger of conflicting with the original component.

Converting legacy projectsProjects created with Anark Studio version 3.5 or earlier do not automati-cally benefit from the Component Refresh feature. Components imported into these projects were not associated with a file on disk, and the contents of the components were not associated with the component.

A legacy project can be updated to the new format by refreshing each compo-nent and saving the project. Because the presentation is missing information that Anark Studio needs in order to perform the “smart” refresh, the first Refresh File command performed on these legacy components will actually use Replace mode (see “Replacing versus refreshing” on page 58).

Some legacy presentations may have instances in the scene that share Library items that are also used by items inside the component. If this cross-linking is present, the presentation is in an incon-

Anark_Studio_User_Guide.book Page 57 Monday, March 19, 2007 10:34 AM

Page 66: Anark Studio4 User Guide

58 Anark Studio User Guide

Chapter 3Creating a Project

sistent state. The presentation is not corrupt – there is no data loss – but is set up in a way that is explicitly prevented in brand new presentations. Refreshing components in such a presentation may show Library assets that would normally be hidden. The update that occurs to those Library items affects scene instances outside the component sharing that Library item.

The only way to clean up such a presen-tation (if it is deemed necessary) is to delete the items from the scene sharing the item, import a new copy of the item into the Library, and re-add the scene instances from that item.

Replacing versus refreshingWhen using the Refresh File command for a component, it is possible to select an .amc file for a completely different component. When this occurs, the two components are so wholly different that no per-instance artist changes are preserved. Instead, the component instances are said to be “replaced” rather than refreshed.

Anark Studio detects such a situation when the internal GUID for the new component does not match the GUID for the Library item, or when a legacy component is refreshed for the first time. The following dialog is shown:

If the artist selects OK, the contents of each component instance in the scene is replaced with instances of the new component. This means that all per-instance customizations are discarded.

This action is different from just deleting all the instances and starting over, however. The values of properties on the outside of each instance are preserved during a replace. This applies to standard properties (such as position, rotation, scale, opacity, etc.) as well as any custom properties the two components may share.

Copying and duplicating objects in the projectThere are three slightly different ways of copying an object: duplicating it, copying it, and cutting and pasting it.

All of these methods create an exact duplicate of the original object. The copy’s timebar remains its original length, and the copy will include any actions, animation keyframes and child objects.

There are some minor differences between copying, duplicating, and cutting and pasting.

Duplicating makes a copy and auto-matically attaches it to the same parent as the original.

Copying allows you to select a different object to copy it to.

Cutting deletes the original object until it is pasted.

Objects can be copied or cut and pasted between concurrently running instances of Anark Studio.

To duplicate an object:1. Select an item in the Object outline

or the Project window.

2. Do one of the following:

• Select Edit > Duplicate Object, or press Ctrl + D. The duplicate will be attached to the same parent as the

Anark_Studio_User_Guide.book Page 58 Monday, March 19, 2007 10:34 AM

Page 67: Anark Studio4 User Guide

User Reference 59

Duration of the project

original.

• Right-click on the name of the item in the Object outline and select Duplicate Object from the Context menu.

• While holding down Ctrl, drag it onto the bar of the object in the Timeline tab to which you want it attached.

To copy an object in the presentation:1. Select an item in the Object outline

or the Project window.

2. Do one of the following:

• Select Edit > Copy, or press Ctrl + C.

• Right-click and select Copy Object from the Context menu.

3. Do one of the following:

• Select Edit > Paste Object or press Ctrl + V.

• Right-click and select Paste Object from the Context menu.

To cut and paste an object:1. Select an item in the Object outline

or the Project window.

2. Do one of the following:

• Select Edit > Cut Object, or press Ctrl + X.

• Right-click on the name of the item in the Object outline and select Cut Object from the Context menu.

3. Select the object you want the cut object to be attached to.

4. Do one of the following:

• Select Edit > Paste Object or press Ctrl + V.

• Right-click on the name of the item in the Object outline and select Paste Object from the Context menu.

To copy or cut and paste an object between instances of Anark Studio:1. Select an item in the Object outline

or the Project window.

2. Do one of the following:

• Copy the object by selecting Edit > Copy or pressing Ctrl + C.

• Cut the object by selecting Edit > Cut Object or pressing Ctrl + X.

3. Launch a new instance of Anark Stu-dio or switch to one that is already running.

4. Select the object you want the copied object to be attached to.

5. Do one of the following:

• Select Edit > Paste Object or press Ctrl + V.

• Right-click on the name of the item in the Object outline and select Paste Object from the Context menu.

Duration of the projectThe duration of a presentation is based on the duration of the content within it. To determine a project’s duration, the system looks for the last end handle of the last layer and sets the duration of the project to that point.

During playback, the content will be played from 0 seconds to the final end handle of the last layer. If the scene is set to loop, it will continuously loop between those points. If the first layer’s start time begins after 0 seconds, play-back will begin with a blank screen at 0 seconds; and, even if the timebars of other objects extend past the last layer’s, nothing past the last layer’s end handle will be displayed.

There is no explicit limit on the duration of a project. When a project is first

Anark_Studio_User_Guide.book Page 59 Monday, March 19, 2007 10:34 AM

Page 68: Anark Studio4 User Guide

60 Anark Studio User Guide

Chapter 3Creating a Project

created, its duration defaults to 10 seconds, because that’s the length of the default layer’s timebar.

See “Setting properties for the scene or slide” on page 83 for more information about setting the Loop property. For information about setting the duration of objects, see “Using the timebar” on page 148.

Exporting and importing componentsA component in one presentation can be exported for use in another project. For example, you could create a complex menu component and then reuse it in other presentations.

You can export a component in two different ways for two different uses:

If you want to import the data from a component into another Anark Studio project, export it as an Anark Media Component file (.amc). These files include all Anark Studio Workspace information for the object(s), so things like timebar text and custom timebar colors are included. These files appear in the Storage tab and can be dragged onto the Project window or Object outline. An exported .amc file cannot be played independently. It can only be imported into another presentation. Instructions for importing a compo-nent are given below.

If you want to dynamically load a component into a presentation during playback, export it as a Playback Module, which uses the .am file exten-sion. Playback Modules do not include Anark Studio Workspace information because they can only be loaded during playback using actions or behavior scripts. They do not appear in

the Storage tab.

Instructions for exporting Playback Modules can be found below.

For more information about dynami-cally loading Playback Modules, see “Loading components dynamically” on page 132.

Note: Loading Anark Playback Mod-ules requires a valid license key. Please contact your Anark sales rep-resentative for licensing informa-tion.

To export an Anark Media Component:1. In the Object outline, select the

component you want to export. The component, its property settings, all of its children and any keyframed animation will be exported.

2. Right-click and select Export Compo-nent from the Context menu.

3. Select a location for the file, rename it if desired, and click Save.

To export a component as a Playback Module:1. In the Object outline, select the

component you want to export. The component, its property settings, all of its children and any keyframed animation will be exported.

2. Right-click and select Export Play-back Module from the Context menu.

3. Select a location for the file, rename it if desired, and click Save.

To import a component:Do one of the following:

Select the item in the Object outline to which you want the component attached, right-click and select Import Component from the Context menu. Browse to the desired .amc file and

Anark_Studio_User_Guide.book Page 60 Monday, March 19, 2007 10:34 AM

Page 69: Anark Studio4 User Guide

User Reference 61

Selecting objects

click on the Open button.

If the component you want to use is available in the Storage palette, drag the component onto either the Project window or the item in the Object outline to which you want the compo-nent attached.

In the Library palette, select Import Resource. Browse through your files to choose the appropriate .amc file. For your convenience, this command is also available from the File menu.

In order for the importation to be successful, the component must be “attachable” to the object you’ve selected in the current presentation. Typically, components would be attached to either a layer or to other models, although they can also be attached to cameras, lights and sounds.

The timebars of the objects in the imported component remain their orig-inal length on import.

Selecting objectsThere are several ways to select objects in Anark Studio. You can select an item in the Timeline tab by simply clicking on it, or you can enable one of two selec-tion modes that allow you to use the mouse to click on items in the Project window. You can also turn off the bounding boxes that surround selected objects.

Note: Only models, including primi-tives, text, groups and components can be selected in the Project win-dow. All other object types can only be selected using the Timeline tab.

Selection tools.

To select an item directly in the Project window, do one of the following:1. Enable the Group Select tool by click-

ing the button, then click on the desired object in the Project window. The topmost group containing the object will be selected. If the object is not part of a group, then just the object will be selected.

2. Enable the Item Select tool by click-ing the button, then click on the desired object in the Project window. The Item Select tool differs from the Group Select tool in that it selects only the specified object even if it’s a member of a group.

A green bounding box appears around a group when it is selected (left). A red bound-ing box appears around a single selected object (right) and, if the object has child objects attached to it, the child objects will be surrounded by a blue bounding box.

The current properties of the selected object or topmost selected parent will appear in the Inspector.

If there are any component objects in the project, then the Timeline can also affect what can and cannot be selected. See “Setting properties for components” on page 117 for more information.

To deselect an item:Click on another object or the back-ground in the Project window.

To turn bounding boxes on or off:Select View > Bounding Boxes or press Ctrl + B.

Anark_Studio_User_Guide.book Page 61 Monday, March 19, 2007 10:34 AM

Page 70: Anark Studio4 User Guide

62 Anark Studio User Guide

Chapter 3Creating a Project

Special selection optionsThere are two special selection options that allow you to toggle between resources in the Library and instances of objects in the Timeline and scene. These can be used to quickly locate instances of a Library resource in the Timeline, or the Library resource for a particular instance.

To select the Library resource for an object in the scene:With an instance of an object selected in the scene or Timeline, press Ctrl + L.

To select an instance of a Library resource:With a resource selected in the Library, press Ctrl + I.

This selects the first instance of the object in the Timeline and scene. To select subsequent instances, press Ctrl + I again.

Selected items vs. active itemsWhen an item is selected, it is also active; however, certain items remain active when they are no longer selected. Specifically, there is always an active layer and an active slide, even when one isn’t currently selected.

Selected items can be copied, moved, deleted and edited. None of those opera-tions can be performed on a slide or layer that is active but not selected. “Active” has a more limited definition:

The active layer is the one that objects are attached to when they are dragged onto the Project window.

The active slide is the one whose contents are currently displayed in the Timeline and Project window.

If a layer or slide is not currently selected, then the one that was most recently selected is still active.

Working with the Object outline

The Object outline.

The Object outline displays all the objects that have been added to the project and provides access to their hier-archical attachments and animated properties. You can access the contents of an object, including any child objects and the properties that have been selected for animation by using the Expand/Collapse arrow next to it. In addition, you can filter the items in the outline, rename them and rearrange them.

Anark_Studio_User_Guide.book Page 62 Monday, March 19, 2007 10:34 AM

Page 71: Anark Studio4 User Guide

User Reference 63

Renaming objects

To expand or collapse the contents of an object or behavior:Click on the Expand/Collapse arrow to the left of the item’s name in the Object outline.

Shift + double-clicking on an object’s icon expands or collapses all children as well.

Clicking on the Expand/Collapse arrow next to an object (left) expands the list to display the contents of the object, including ani-mated properties and child objects (right).

To resize the Object outline:Drag the bar between the Object outline and Time pane to the desired position.

To copy an object’s path to the clipboard:Right-click on the item in the Object outline and select Copy Object Path from the Context menu. This copies the hierarchical path to the object (e.g., Scene.Layer.Cube3.Material13.rays). This is particularly useful for copying an object’s complete path into a behavior script or an edit box in the Inspector of a custom behavior. For more information about the hierarchical path of objects, see “Object model overview” on page 214. For more information about editing behavior scripts, see “Editing behaviors” on page 73.

Renaming objectsRenaming instances of objects or behav-iors in the Object outline does not affect the name of the resource object in the Library, but it does change the item’s name in the Inspector.

If you want to create custom behaviors for a specific object, this will be the

name you use to create instances of the object or to initially address the object in scripting. For more information about addressing objects in scripting, see “Object model overview” on page 214.

Giving every object in your project a unique name is recommended for two reasons:

There is no way to distinguish between items with the same name when selecting a Target or Trigger object for an action. See “Creating and deleting actions” on page 120 for more infor-mation.

If there are two or more objects with the same name attached to the same object, then any reference to the object in a behavior script forces the scripting engine to make an arbitrary decision as to which object to address. This means you may get different results each time you play a presentation.

To rename items:1. Do one of the following:

• Right-click on the name of the item in the Object outline and select Rename Item from the Context menu.

• Select the item in the Object outline and then click on the text of the item’s name.

• Click on the name of the item in the Object outline and press F2.

2. Type a new name and press Enter.

Note: Since objects whose names begin with a number cannot be addressed by name in behavior scripts, you should avoid naming objects that way and rename any objects that were previously named that way.

Anark_Studio_User_Guide.book Page 63 Monday, March 19, 2007 10:34 AM

Page 72: Anark Studio4 User Guide

64 Anark Studio User Guide

Chapter 3Creating a Project

Rearranging objectsWhen rearranging items in the Object outline, be aware of their hierarchical attachments so that you don’t inadvert-ently break attachments you want to keep or create unintentional attach-ments. You can change the attachments of objects and behaviors by moving them from one object to another. When a parent object is moved, all of its child objects are moved with it. You can also change the order of an object’s children without changing their attachments as long as you don’t move them away from the parent object and keep them within the confines of their current level in the hierarchy.

To change an item’s attachment from one object to another:Click on the item in the Object outline and drag it onto the object to which you want it attached.

To change the order of items without changing their attachments:Click on the item in the Object outline and drag it onto the line above or below the object where you want it to reside. The target position must be on the same level of the hierarchy to maintain the attachment to the parent object; other-wise, the object’s attachment will be changed.

Using the Shy toggle and button

The Shy toggle and filter button control whether a specified object will be visible in the Object outline. The Shy toggle allows you to selectively choose objects to temporarily hide from the Object outline. If the Shy toggle is on for an object and the Shy filter button is on, neither the object nor any of its children

will appear in the outline. To bring shy objects back into view, unclick the Shy filter button.

Using the Active toggle and button

The Active toggle controls several features of objects:

It specifies whether an object and its child attachments will be visible in the Project window.

It controls whether behaviors are turned on or off.

It specifies whether the data for the object will be exported.

If the Active filter button is turned on, it also controls whether the object and its child attachments will be visible in the Object outline.

If a parent object is inactive (meaning the Active button is off), neither it nor its children will be visible and neither will be exported in the final presenta-tion. This means that any object that is inactive in Anark Studio will not be accessible from a behavior script.

The Active toggle and filter button are set to show and export objects by default. Materials and the Scene object do not have an Active toggle.

Using the Lock toggle and button

The Lock button controls whether the animatable properties of a behavior or an object and its child attachments are editable. When an object or behavior is locked, both its name in the Object

Anark_Studio_User_Guide.book Page 64 Monday, March 19, 2007 10:34 AM

Page 73: Anark Studio4 User Guide

User Reference 65

Deleting objects

outline and its timebar are grayed out. You cannot select it or change anything about it until the Lock button is disabled.

Locking or unlocking a parent object automatically locks or unlocks all of its child objects. Materials do not have a Lock button.

Deleting objectsObjects can be deleted from either the Object outline or the Project window. If the object is a parent, all of its children will be deleted with it. If the object is on the Master slide, then all instances of the object on all slides will be deleted when any one of them is deleted. See “About Master slides” on page 134 for more information.

To delete an item:1. Select an item in the Object outline

or in the Project window.

2. Do one of the following:

• Press the Delete key.

• If you selected an object in the Object outline, right-click and select Delete Item from the Context menu.

For information about deleting items from the Library, see “Cleaning up the Library” on page 27.

Controlling presentation playbackA presentation can play, pause or reverse, either automatically or based on user interaction. There are several ways to control how a presentation will be played.

The Initial Play State property of the Scene object can be set to either Play or Pause.

Play or Pause actions can be used to play or pause the scene.

Go to Time actions can be used to pause or continue playing. Play or Pause actions can then be used to start playback again or to pause playback.

Reverse Play actions can be used to reverse playback from its current direc-tion (either forward or backwards).

For information about the Initial Play State property of the Scene, see “Setting properties for the scene or slide” on page 83. For information about setting up actions, see “Creating and deleting actions” on page 120.

Anark_Studio_User_Guide.book Page 65 Monday, March 19, 2007 10:34 AM

Page 74: Anark Studio4 User Guide

66 Anark Studio User Guide

Chapter 3Creating a Project

Undoing and redoing actions

The Undo and Redo buttons are available in Windows.

Anark Studio allows you to undo actions (i.e., commands) and redo actions after you have undone them. This includes actions made using the Inspector palette or by dragging objects in the Project window. However, the following actions cannot be undone or redone:

Deleting objects from the Library. If you do delete an object from the Library, the stack of actions that can be undone is cleared, so no previous actions can be undone.

Adding objects to the Library.

Note: The behavior editing interface has a separate undo/redo stack.

To undo an action:Press Ctrl + Z or click the Undo button.

Undo can be repeated up to the last 100 actions or until you have reached the end of the stack of actions you performed since loading the project.

To redo an action you have undone:Press Ctrl + Shift + Z or Ctrl + Y or click the Redo button.

Redo can be repeated until you have reached the end of the previously undone actions or until you issue a new command.

Anark_Studio_User_Guide.book Page 66 Monday, March 19, 2007 10:34 AM

Page 75: Anark Studio4 User Guide

User Reference 67

Undoing and redoing actions

Anark_Studio_User_Guide.book Page 67 Monday, March 19, 2007 10:34 AM

Page 76: Anark Studio4 User Guide

68 Anark Studio User Guide

Chapter 3Creating a Project

Anark_Studio_User_Guide.book Page 68 Monday, March 19, 2007 10:34 AM

Page 77: Anark Studio4 User Guide

User Reference 69

Undoing and redoing actions

Anark_Studio_User_Guide.book Page 69 Monday, March 19, 2007 10:34 AM

Page 78: Anark Studio4 User Guide

70 Anark Studio User Guide

Chapter 3Creating a Project

Anark_Studio_User_Guide.book Page 70 Monday, March 19, 2007 10:34 AM

Page 79: Anark Studio4 User Guide

4

71

Chapter 4: Customizing and Extending Anark Studio

You can customize the properties of objects, behaviors and

actions. Custom properties added to objects inside of Anark Studio are available to the script engine at runtime.

Another versatile feature is the ability to import Collada formatted files (.dae file extension). If you have other 3D software packages that you use in your daily work, use one of the third-party software exporters (available from the Collada web site, http://www.khronos.org/collada/) to save your presentation. The saved presentation can then be imported into Anark Studio, where it can be further custom-ized.

Anark_Studio_User_Guide.book Page 71 Monday, March 19, 2007 10:34 AM

Page 80: Anark Studio4 User Guide

72 Anark Studio User Guide

Chapter 4Customizing and Extending Anark Studio

What are behavior scripts?While Anark Studio provides an easy-to-use GUI for creating interactivity and animation, custom behavior scripts can be used to greatly expand the animation capabilities and interactive states of your projects. The scripts that are used in Anark Studio are called behavior scripts. Behavior scripts use the .bvs file exten-sion. They contain sets of instructions for how objects in the scene should behave.

The Anark Studio Behavior Library includes a number of commonly used behaviors (such as buttons and links), in addition to more advanced behaviors, but you may also want to create your own custom behaviors.

This section of the manual explains how to create and edit custom behaviors in Anark Studio. Detailed information about writing the content for scripts is covered in “Chapter 10: Using Scripting” on page 203.

For information about using the Anark Studio Behavior Library, see “Accessing the Behavior Library” on page 27.

Understanding behaviorsBehaviors in Anark Studio are generally used to add custom interactive elements to the project, and they also offer a way to create specialized animation effects based on runtime information.

Behavior scripts are similar to the other object types in that they can be brought into the Library as resources and can be attached as children to objects in the Object outline. Conceptually they are quite different from the other object types, however. Behavior scripts are chunks of code that tell the objects they are attached to what to do and when to

do it. Some common behaviors include familiar interactive behaviors like buttons, linking, menus, toolbars, key commands, etc.

To create custom behaviors using the scripting interface, you’ll need to follow the instructions in “Using Scripting” on page 203.

The instructions contained within a behavior are executed only during the behavior’s duration, so be sure to change the duration of a behavior when needed. For example, if a behavior that makes a model glow during mouseovers is attached to a model, and you extend the model’s duration but not the behavior’s duration, then the model will only glow during mouseovers for as long as the behavior is active in the Timeline. For more information about controlling the duration of objects, see “Using the timebar” on page 148.

Note: Scrubbing with the Playhead will not execute behaviors. To see your behaviors being executed you must either view the final presenta-tion or preview using the F12 key.

Creating behaviorsTo write your own behaviors, you need to create an empty behavior object in Anark Studio and edit it using the scripting interface.

Behavior scripts are just XML (Extensible Markup Language) documents with a .bvs extension. While they can be edited in an external text editor, it’s recom-mended that you use Anark Studio’s script editor to ensure that the proper XML tags are included in the file.

To create a new behavior in Anark Studio:1. Do one of the following:

Anark_Studio_User_Guide.book Page 72 Monday, March 19, 2007 10:34 AM

Page 81: Anark Studio4 User Guide

User Reference 73

Editing behaviors

• Choose Script > New.

• Click on the Behavior button ( ) on the Basic Objects tab and drag a behavior instance onto either the Project window or the Object outline. An empty behavior resource will be created in the Library.

2. Do one of the following:

• Right-click on the behavior in the Library and select Edit Asset from the Context menu.

• Double-click on the behavior in the Library or Object outline.

A script editing area will open in the Project window.

3. Using JavaScript, write the desired behavior code. See “Chapter 10: Using Scripting” on page 203 for information about writing behavior scripts.

4. Compile and save your changes by doing one of the following:

• Click on the Compile button ( ).

• Choose Script > Compile.

• Press the F7 key.

The Anark Studio scripting interface error-checks your script each time you compile or save and close. If any compile errors are found, the first error will be displayed and highlighted in yellow. When you compile your edits, the changes are propagated to all instances of the behavior in the project.

Editing behaviorsUsing the Anark Studio scripting inter-face, you can edit any behavior script that is a resource in the Library. If you created the behavior by clicking on the Library button rather than importing it, it is essentially an empty object with no

“instructions” so you must edit it to make it effective.

Line numbers are turned on by default, but you can turn off using the menu or shortcut key.

The Script Editing window.

For detailed information about writing behavior scripts, see “Chapter 10: Using Scripting” on page 203.

To edit a behavior: Do one of the following:

Right-click on the behavior in the Library and select Edit Asset from the Context menu.

Double-click on the behavior in the Library or Object outline.

The text of the behavior will open in a script editing area in the Project window. When you compile your edits, the changes are propagated to all instances.

Anark_Studio_User_Guide.book Page 73 Monday, March 19, 2007 10:34 AM

Page 82: Anark Studio4 User Guide

74 Anark Studio User Guide

Chapter 4Customizing and Extending Anark Studio

To display or hide line numbers: Choose Script > Show Line Numbers or press F8.

Using the Behavior Editing toolsThese tools are only available on Windows systems.

A. Compile button – Checks the script for syntax errors and either saves the edited script if none are found or highlights the first error it comes across. You can also choose Script > Compile or press the F7 key to com-pile the script. The Compile button is only available when a script has been edited. With the exception of certain changes to the editable parameters themselves, compiled changes will be propagated to all instances of the behavior in the Object outline. For information about how editable parameters are updated, see “Updat-ing behavior scripts” on page 74.

B. Find – Opens the Find dialog box, which allows you to search and replace any text element in the script.

C. Find Previous – Searches backward through the script for the text you specified in the Find dialog box.

D. Find Next – Searches forward through the script for the text you specified in the Find dialog box.

E. Indent Right – Allows you to improve the format of your script by indenting a selected line of code four spaces to the right. This button is only active when a section of code is highlighted.

F. Indent Left – Moves an indented line of code four spaces to the left. This button is only active when a section of code is highlighted.

The Close button.

The Close button checks the script for errors. If none are found, it saves and closes the script. If an error is found, then it prompts you to edit the error before closing. If you choose Yes, the script will remain open and the first error will be highlighted. If you choose No, the errors will be saved in the script and will be propagated to any instances of the behavior in the Object outline.

Updating behavior scriptsWhen a behavior script is compiled or refreshed in Anark Studio, the following changes are propagated to all instances of the behavior in the Object outline:

Any edits to function text. Functions are the heart of any script because they contain the instructions for what the objects in the scene are supposed to do.

Changes to the values of any of the following Script Parameters:

• Type

• Min Value

• Max Value

• List Values

• Default Value (for List type only)

Changes to the values of any other Script Parameters are not propagated to the instances of the behavior.

Exporting and printing behavior scriptsYou can export a behavior to a .bvs file from Anark Studio. You can also print a currently open behavior.

Anark_Studio_User_Guide.book Page 74 Monday, March 19, 2007 10:34 AM

Page 83: Anark Studio4 User Guide

User Reference 75

Customizing properties for any object

To export a behavior as a .bvs file:1. Choose Script > Export Behavior.

2. Enter a name for the .bvs file and click OK.

Important: While exporting behavior scripts allows you to share them with other developers, certain errors in the script – particularly to the XML parameters – may prevent an externally edited script from prop-erly loading into Anark Studio when refreshed or imported.

To print a behavior:Choose Script > Print Behavior.

For information about writing behavior scripts, see “Creating behaviors” on page 72.

Customizing properties for any objectThe Edit Custom Parameters dialog can be used to expose custom properties on any object that can then be accessed by a behavior script or a Set Property action. A behavior must be written to define what the property will actually do.

In addition, custom actions and events can be created for behavior objects, which must include code that defines the action or event.

Detailed information about writing the content for scripts is covered in “Chapter 10: Using Scripting” on page 203. For information about setting up actions, see “Selecting an action” on page 125.

Creating custom parameters for objectsThe Edit Custom Parameters dialog allows you to define custom properties for any object, and custom actions and events for behaviors, and “expose” (i.e., publish) them to Anark Studio so that they will be available on the Inspector or Actions tab.

You must also write the code that defines what the property, action or event will actually do in a behavior script.

To access the custom parameter inter-face:

1. If you want to add a property to any object other than a behavior, make sure the Behavior Editor isn’t open. Otherwise, only the behavior’s prop-erties can be accessed.

2. Select any object in the Library or Object outline.

3. Choose Edit > Edit Custom Parame-ters. The Edit Custom Parameters dia-log box will open.

For instructions on creating each param-eter type, see the following sections:

“Working with custom properties” on page 76

“Working with custom actions” on page 78

“Working with custom events” on

Anark_Studio_User_Guide.book Page 75 Monday, March 19, 2007 10:34 AM

Page 84: Anark Studio4 User Guide

76 Anark Studio User Guide

Chapter 4Customizing and Extending Anark Studio

page 79

Working with custom propertiesCustom properties can be created for any object in a presentation.

For behavior objects, exposing the custom properties that were written in a script so that they are available in the Anark Studio Inspector makes the behavior easier to use in a variety of projects and easier to share with others.

For other object types, you can write behavior scripts that access the custom properties, giving you complete control over all objects in a presentation.

Custom properties appear in the Basic Properties in the Inspector palette for the object.

While custom properties are published to both the Library resource and all the instances of the resource in the project, the values for the property are set on a per-instance basis.

See “Understanding objects and resources” on page 23 instances and resources.

See “Chapter 10: Using Scripting” on page 203 for information about writing behavior scripts.

To create or edit a custom property:1. Open the Custom Parameters dialog

using the instructions in “Creating custom parameters for objects” on page 75.

2. On the Properties tab, click on the Add Property button ( ) or select an existing property from the list.

3. Set the desired properties as explained below.

• Display Name – Creates a label for the property that will appear in the Anark Studio Inspector palette.

• Type – Sets the type of property being created. This dictates what type of user interface editing tool will be created for the property in the Inspector palette. Each type has some optional properties that you can set for it.

Long – Creates an integer edit box. (See later bulleted information about selecting a minimum value and maximum value.)

Float – Creates a floating-point num-ber edit box. You can optionally specify a Minimum Value and Maxi-mum Value. If the minimum and maximum are not equal, then a slider tool will be created for the parameter in addition to the float-ing-point number edit box. You can also optionally set a Default Value; otherwise, 0.0 will be the default set-ting.

Boolean – Creates a checkbox. You can specify whether the Default

Anark_Studio_User_Guide.book Page 76 Monday, March 19, 2007 10:34 AM

Page 85: Anark Studio4 User Guide

User Reference 77

Working with custom properties

Value will be checked (true) or unchecked (false).

Vector – Creates X, Y and Z edit fields. You can also set default val-ues for X, Y and Z.

Rotation – Creates X, Y and Z edit fields that are specified in degrees. You can also set default values for X, Y and Z.

Color – Creates a Color picker. You can optionally set a Default Color using the Color picker.

String – Creates a text editing field. You can optionally set a Default Value for the String.

List – Creates a pull-down menu. You must specify the possible List Values as a comma-delineated list (e.g., Bounce,Dip,Twirl,Kick). Note that there should be no spaces after the commas. You can set a Default Value for the list; otherwise the first item in the list will be used as the default.

Object Reference – Creates an object picker that uses either the absolute or relative path to the object. The absolute path locates the object by walking down the object model hierarchy. The relative path locates the object by walking up the levels of the hierarchy using the parent property of objects. Regardless of the path method chosen by the user, the property will expose a reference to the script representation of that object, not a string representing the path to the object. You can option-ally set a Default Value for the picker.

Multiline Text Edit – Creates a multi-line text editing field. You can

optionally set a Default Value for the text.

• Name – Sets the scripting “handle” for the property.

• Help String – Specifies a help string to display in Anark Studio for this property. This string will appear as a tool tip when the user mouses over the parameter. This field is optional.

• Animatable – Specifies whether the property will automatically be animatable in Anark Studio. The following property types may be animated: Float, Rotation, Vector and Color.

• Minimum Value, Maximum Value, and Default Value – You can option-ally specify an integer (e.g., 0, -4, 7, etc.) as the Minimum Value and Maximum Value. If the minimum and maximum are not equal, then a slider tool will be created for the parameter in addition to the number editing box. You can optionally set a Default Value; otherwise, 0 will be the default setting.

4. Click OK to save your changes.

The custom properties will appear in the Inspector or Actions tab for objects.

Inspector palette for the Incrementor behav-ior script

Anark_Studio_User_Guide.book Page 77 Monday, March 19, 2007 10:34 AM

Page 86: Anark Studio4 User Guide

78 Anark Studio User Guide

Chapter 4Customizing and Extending Anark Studio

To delete a custom property:Select the property and click on the

Trash button ( ).

Working with custom actionsYou can expose a custom-written action to the Anark Studio GUI so that it will appear as an available action for a behavior object. The action can have additional custom properties set for it that will appear on the Actions tab when the action is selected.

You must also write the function code that defines what the action will actually do in the behavior script itself. See “Chapter 10: Using Scripting” on page 203 for information about writing behavior scripts.

To create or edit an action for a behavior:1. Open the Custom Parameters dialog

using the instructions in “Creating custom parameters for objects” on page 75.

2. On the Actions tab, click on the Add

Action button ( ) or select an existing action from the list.

3. Set the desired action properties as explained below.

Name – Sets the name of the action as it will appear in the Actions pull-down for the behavior.

Help String – Specifies a help string to display in Anark Studio for this

action. This string will appear as at the bottom of the Action selection pull-down when the user mouses over the action. This field is optional.

Function Name – Identifies the name of the function as it will be called in the text of the behavior script.

4. If you have defined any arguments for the function in your behavior script, you can expose them to the Anark Studio interface so that they will appear on the Actions tab when the function is selected as an action. To do this, select a function and click on the Add Property button ( ). The order in which the arguments are added must be the same as the order in which they are passed to the function. The Name of each parame-ter is ignored for actions.

5. Set the desired properties. The avail-able properties are generally the same as those documented in “Working with custom properties” on page 76. However, you cannot create a List or Object Reference property, and none of the properties can be animated, even though the Animatable check box is available.

6. Click OK to save your changes.

On the Actions tab, custom actions are now

Anark_Studio_User_Guide.book Page 78 Monday, March 19, 2007 10:34 AM

Page 87: Anark Studio4 User Guide

User Reference 79

Working with custom events

available in the Actions pull-down menu for the behavior.

To delete a custom action:Select the action and click on the Trash

button ( ).

Working with custom eventsYou can expose a custom-written event to the Anark Studio GUI so that it will appear in the Event pull-down menu on the Action tab for a behavior object.

You must also write the event code that uses the AKEvent object and the fireEvent method of Behaviors, or use the Fire Event action to invoke the event. See “Chapter 10: Using Scripting” on page 203 for information about writing behavior scripts.

To create or edit an event for a behavior:1. Open the Custom Parameters dialog

using the instructions in “Creating custom parameters for objects” on page 75.

2. On the Events tab, click on the Add Event ( ) button or select an exist-ing event from the list.

3. Set the desired event properties as explained below.

Name – Sets the name of the event as it will appear in the Event pull-down for the behavior. If this even will be fired by script, this name must be the same string that is set for the AKEvent that fires it.

Help String – Specifies a help string to display in Anark Studio for this event. This string will appear as a tool tip when the user mouses over the event. This field is optional.

4. Click OK to save your changes.

On the Actions tab, the custom events are now available in the Event pull-down menu for the behavior.

To delete a custom event:Select the event and click on the Trash

button ( ).

Anark_Studio_User_Guide.book Page 79 Monday, March 19, 2007 10:34 AM

Page 88: Anark Studio4 User Guide

80 Anark Studio User Guide

Chapter 4Customizing and Extending Anark Studio

Anark_Studio_User_Guide.book Page 80 Monday, March 19, 2007 10:34 AM

Page 89: Anark Studio4 User Guide

5

81

Chapter 5: Setting Object Properties

Anark Studio provides you with several ways to change the properties of objects. The Inspector tab can be used to change any property of any resource in the Library or any instance of an object or behavior that has been added to the project. In addition, mouse controls can be used to change any numerical properties of models and groups in the Project window.

Anark_Studio_User_Guide.book Page 81 Monday, March 19, 2007 10:34 AM

Page 90: Anark Studio4 User Guide

82 Anark Studio User Guide

Chapter 5Setting Object Properties

Understanding different types of propertiesThere are three different groups of prop-erties displayed in the Inspector palette.

Basic Properties include commonly and frequently used properties. In addition, any custom properties created for an object appear in the Basic properties.

Advanced Properties include more specialized and less frequently used properties.

Shared Properties include properties that are shared between Library resources and all the instances of the resource in the project. Images, video and music have shared properties. Changing a shared property on any one instance automatically changes it for all other instances and for the Library resource.

To open or close a property group:Click on the Expand/Collapse toggle next to the property group in the Inspector. Anark Studio remembers whether you have expanded or collapsed the Advanced properties and maintains

that state for all selected objects until you change it again.

Click on the Expand/Collapse arrow to access or close the Basic, Advanced or Shared properties.

In addition to these types of properties, individual properties can be linked across instances and/or slides. See “Linking and unlinking properties” on page 135 for more information.

About setting properties for resourcesThe settings of resources can only be changed using the Inspector (i.e., they can’t be edited in the Project window). Built-in resource objects that have been added to the Library (video, music and behaviors) have a set of default proper-ties that appear in the Inspector when the resource is selected. The properties of imported objects, such as externally created behavior scripts, 3D models, 2D graphics and sounds, are embedded with the file data and become the default settings for the resource.

Changes to a Basic or Advanced property for a resource in the Library mean that any new instance of the object will have the new setting, while the parameter

Anark_Studio_User_Guide.book Page 82 Monday, March 19, 2007 10:34 AM

Page 91: Anark Studio4 User Guide

User Reference 83

About setting properties for instances

settings of previously added instances of the object will not be affected. However, the Shared Properties for music, images and video are shared across all instances. If any of the Shared Properties are changed on any instance or the Library resource, they are also automatically updated everywhere.

Under their Advanced Properties, all Library resources have a read-only Object Size property that indicates the runtime size of the object in kilobytes, which can be used to help gauge memory usage.

About setting properties for instancesWhen a resource has been added to the project, it becomes an instance. An instance of an object has a set of default properties that are constant throughout its duration. To change a property over time, you’ll need to set up animation keyframes for it. The value of the first animation keyframe set for an object property will override any default settings. The object will begin its dura-tion at the value of the first keyframe and will end its duration at the value of the last keyframe.

Tip: A keyframe can also be set before an object begins its duration (i.e., before the start handle of its timebar) so that the object will come into the scene while it is being animated.

For information about animating object parameters using the Inspector palette,

see “Chapter 7: Animating Objects” on page 145.

About linked propertiesIf an object is on the Master slide, its properties are automatically linked between the instances on other slides. When properties are linked, changes made to one object are propagated to the other objects. For information about how to link and unlink object proper-ties, see “Linking and unlinking proper-ties” on page 135.

Setting properties for the scene or slideWhen the Scene or a slide is selected, the Slide properties appear in the Inspector.

Slides control how the Scene is played.

The Scene is the root object in the Anark Studio object hierarchy. It encompasses the overall 3D space in which a project takes place.

All layers are attached directly to the Scene. The only other objects that can be attached to the Scene are behaviors, sound and music.

The Background Color property of the Scene is shared across all slides.

For more information about slides, see “Understanding slides” on page 133.

Slide – Displays the name of the current Slide. For information about renaming

Anark_Studio_User_Guide.book Page 83 Monday, March 19, 2007 10:34 AM

Page 92: Anark Studio4 User Guide

84 Anark Studio User Guide

Chapter 5Setting Object Properties

objects, see “Renaming objects” on page 63.

Basic PropertiesPlayback Speed – Controls the speed at which playback is executed. This affects the speed of any animation, including any animation created by a behavior that uses the contextTime property. A setting of 2 means animated objects will appear to move twice as fast as normal; a setting of .5 means they will appear to move half as fast as normal, etc. A nega-tive value (e.g., -.3, -2, etc.) makes the scene play in reverse. This setting does not affect the frame rate of the presenta-tion or how often the scene is updated.

Initial Play State – Controls whether the slide will initially play or be paused. Defaults to Play.

Play Mode – Controls how the scene will be played back during this slide.

Stop at End – Sets the scene to play from beginning to end once.

Looping – Sets the scene to play from beginning to end continuously.

Ping Pong – Sets the scene to continu-ously play forward and then in reverse for the duration of the slide.

Ping – Sets the scene to play forward and back only once.

Play Through – Sets the scene to play from beginning to end once and then continue onto the next slide.

Shared PropertiesIn addition to the properties available in the Anark Studio Inspector that are listed here, some additional values are avail-able for slides:

Background Color – Sets the background color for the entire scene in all slides.

Setting properties for layersLayers in Anark Studio are a special kind of group that are used to organize the content of the scene and to control certain properties for all the attached objects. They are second only to the scene in Anark Studio’s object hierarchy, which means that all objects (except music and behaviors) must be attached, either directly or through other attach-ments, to a layer. There can be a single layer or many layers in a project. When a layer is added to the project, it already has a default light and a default scene camera attached to it.

For more information about how layers work, see “Understanding layers” on page 48.

Layer – Displays the current name of the Layer. For information about renaming objects, see “Renaming objects” on page 63.

Basic PropertiesX Position – Offsets the layer from the left side of the scene (along the X axis), creating a left margin for it. Specified as a percentage of the overall height of the scene.

Y Position – Offsets the layer from the top of the scene (along the Y axis), creating a top margin for it. Specified as a percentage of the overall width of the scene.

Anark_Studio_User_Guide.book Page 84 Monday, March 19, 2007 10:34 AM

Page 93: Anark Studio4 User Guide

User Reference 85

Setting properties for text

Width – Sets the scale of the layer along the X axis. Specified as a percentage of the overall width of the scene, up to 400%.

Height – Sets the scale of the layer along the Y axis. Specified as a percentage of the overall height of the scene, up to 400%.

Opacity – Adjusts the transparency of all the objects attached to the layer. If the opacity is set to 0, the objects will be drawn in the scene, but will be invisible. This is different from Use Layer Color, which controls whether the “empty space” of the layer will be drawn. See “Working with opacity” on page 111 for information about the effect of opacity settings on how objects are rendered and the multiplicative relationship of the Opacity properties of layers, groups, models and materials.

Use Layer Color – Enables the Layer Color property. When Use Layer Color is on (checked), this layer will completely obscure any layers behind it (i.e., that were drawn first). This is different from Opacity, which controls only the trans-parency of the objects that are attached to the layer. Defaults to off (unchecked).

Layer Color – Sets the background color for the layer. The background color will only be drawn if the Use Layer Color parameter has be turned on.

Advanced Properties

X Pivot – Sets the X position of the pivot point of the layer. Specified as a percentage of the layer size.

Y Pivot – Sets the Y position of the pivot point of the layer. Specified as a percentage of the overall width of the scene.

Setting properties for textText enables the creation of a variety of text objects, such as one-word labels, headlines, captions and entire para-graphs of scrollable text.

All fonts that are used in a project can be embedded in the presentation file so that they can be displayed on the viewer’s computer. See “Export Options” on page 22 for more information.

All languages supported by Microsoft Windows can be used.

Note: If your presentation uses text, setting the Scale Mode to Fixed Size is highly recommended. See “Pre-

Anark_Studio_User_Guide.book Page 85 Monday, March 19, 2007 10:34 AM

Page 94: Anark Studio4 User Guide

86 Anark Studio User Guide

Chapter 5Setting Object Properties

sentation Size” on page 20 for more information.

Text – Displays the current name of the Text. For information about renaming objects, see “Renaming objects” on page 63.

Basic PropertiesText Type – Specifies whether the text will be treated as line text or as a paragraph.

Line – Line text grows or shrinks in length as it’s edited, but it does not wrap to the next line. The Text Box Width and Height are dynamically updated for line text, and the dimen-

sions are limited to the width and height of the layer. To create more than one line of text, you can manu-ally add returns.

Because the Text Box Width and Height are automatically set to the width and height of the text they can-not be changed.

Paragraph – Paragraphs typically con-tain more than one line of text and can wrap automatically from line to line using the Word Wrap property. The text box for paragraphs is determined based on the Text Box Width and Height properties as a percentage of the layer’s dimensions. Text that extends beyond the boundaries of the text box is clipped.

Render Style – Determines how the text object is rendered.

Flat – Renders the text on a plane that always faces the camera, always remains at the specified font size and can only be rotated around the Z axis. Flat text is particularly useful for dis-playing blocks of informational text.

Flat text can be used to display blocks of information.

Depth – Renders the text on a plane that can be moved forward or back-ward and can be rotated around the Z axis. As with Flat text, the text will always face the camera, even if the text object is rotated. Depth text is particu-

Anark_Studio_User_Guide.book Page 86 Monday, March 19, 2007 10:34 AM

Page 95: Anark Studio4 User Guide

User Reference 87

Setting properties for text

larly useful for creating labels for parts or for diagrams.

Depth text can be used to create labels.

Full Perspective – Renders the text on a plane that can be moved, rotated and scaled like any other 3D object. Full Perspective text would typically be used for motion graphics and 3D but-tons.

Full Perspective text can be used to create motion graphics.

Text String – Specifies the text to be displayed. All languages supported by Microsoft Windows can be input.

Position – Adjusts the position of the text, relative to its parent. While all text objects can be moved along the X and Y axes, only text with a Render Style set to either Depth or Full Perspective can be moved along the Z axis.

Rotation – Adjusts the rotation of the text, relative to its parent. Text objects with a Render Style set to Depth or Flat can only be rotated around the Z axis.

Scale – Adjusts the scale of the text, rela-tive to its parent. Only text objects with a Render Style set to Full Perspective can be scaled.

Pivot – Adjusts the position of the text’s pivot point. The pivot point serves as the center for the text’s rotation and provides the coordinates for scaling.

Tip: The Pivot property can be used to offset text without changing the point of attachment. This can be more effective than changing the Position in order to lock the text in place relative to its parent

Text Color – Sets the color of the text. Defaults to white. The Text Color prop-erty bar in the Timeline will match the selected Text color.

Font – Sets the font in which to display the text. The specified font can be embedded in the finished project file so that it can be displayed on the viewer’s computer even if the font isn’t installed. By default, fonts are not embedded because they greatly increase the file size. To enable font embedding, you must turn on Embed Fonts in the Project Preferences. See “Setting program and project preferences” on page 17 for more information.

If fonts are not embedded in the presen-tation and the viewer does not have a font installed on his or her computer, the text will be displayed in Arial.

Fonts are never embedded in the .amw file, so other Anark Studio users would need to have the font installed in order to see it.

Font Size – Specifies the size of the text in points. If the presentation is resized during playback, Flat text continues to be rendered at the specified font size. However, Depth and Full Perspective text are resized if the height of the window is changed. See the section on Presentation Size under “Editing project

Anark_Studio_User_Guide.book Page 87 Monday, March 19, 2007 10:34 AM

Page 96: Anark Studio4 User Guide

88 Anark Studio User Guide

Chapter 5Setting Object Properties

settings” on page 19 for information about how objects are resized when the playback window is resized.

Anark_Studio_User_Guide.book Page 88 Monday, March 19, 2007 10:34 AM

Page 97: Anark Studio4 User Guide

User Reference 89

Setting properties for text

Horizontal Alignment – Determines how paragraph text is positioned between the left and right borders of the text box.

Left – Aligns the text along the left side of the text box.

Centered – Centers the text within the text box.

Right – Aligns the text along the right side of the text box.

Vertical Alignment – Determines how paragraph text is positioned between the top and bottom of the text box.

Top – Aligns the text along the top of the text box.

Middle – Centers the text within the text box.

Bottom – Aligns the text along the bot-tom of the text box.

Opacity – Adjusts the transparency of the text. If the opacity is set to 0, the text will be drawn in the scene, but will be invisible. See “Working with opacity” on page 111 for information about the effect of opacity settings on how objects are rendered.

Leading – Sets the spacing between lines of text.

Tracking – Sets the spacing between all letters in a word, sentence and/or para-graph.

Text Box Width – Sets the width of the text box as a percentage of the current layer’s dimensions. Text that extends beyond the boundaries of the text box is clipped. This property is only available when the Text Type is set to Paragraph.

Text Box Height – Sets the height of the text box as a percentage of the current layer’s dimensions. Text that extends beyond the boundaries of the text box is clipped. This property is only available when the Text Type is set to Paragraph.

Word Wrap – Enables word wrapping so that text automatically wraps to the next line when the text hits the horizontal edge of the text box. This is only avail-able when the Text Type is set to Para-graph. This property is only available when the Text Type is set to Paragraph.

Advanced Properties

Vertical Scroll – Moves the text down (by decrementing the value) or up (by incre-menting the value) in the text box.

Horizontal Scroll – Moves the text to the right (by decrementing the value) or to the left (by incrementing the value) in the text box.

Use Background Color – Enables the Background Color property. When Use Background Color is on (checked), the background of the text object will obscure the objects behind it. Defaults to off (unchecked).

Background Color – Sets the background color for the text object. The background color will only be drawn if the Use Back-ground Color parameter has been turned on.

Anark_Studio_User_Guide.book Page 89 Monday, March 19, 2007 10:34 AM

Page 98: Anark Studio4 User Guide

90 Anark Studio User Guide

Chapter 5Setting Object Properties

Setting properties for camerasCameras in Anark Media control the way their parent layer is viewed, much like video cameras in the real world. They can be used to zoom in or out of the scene and to focus on particular objects. Several of their properties can be animated so that the view of the scene changes and flows.For more information about animating cameras, see “Chapter 7: Animating Objects” on page 145.

When a new layer is created, it has a camera object already attached to it so that you can view the layer. You can edit the properties of this camera, and you can also add new cameras to the layer. Only one camera can be active for a layer at a given time. See “Working with cameras and the timebar” on page 150 for more information.

While each layer is seen through its own camera, the final image of the scene is a composite picture incorporating the views of every layer through their active cameras. This allows you to create a variety of interesting visual effects using

different fields of view, targets and animation.

Camera – Displays the current name of the Camera. The name of resources in the Library can only be changed using this box. For information about renaming objects, see “Renaming objects” on page 63.

Basic PropertiesOrthographic – Turns the camera’s perspective view on or off. Since an orthographic view doesn’t use perspec-tive, objects don’t appear to recede into the distance. This is very useful for precisely positioning and sizing objects in relation to each other (e.g., menus, pictures, text, etc.).

Note: If your presentation uses an orthographic camera, setting the Scale Mode to Fixed Size is highly recommended. See “Presentation

Anark_Studio_User_Guide.book Page 90 Monday, March 19, 2007 10:34 AM

Page 99: Anark Studio4 User Guide

User Reference 91

Setting properties for cameras

Size” on page 20 for more information.

A normal camera view (top), and an orthographic camera view of the same scene (bottom).

Position – Adjusts the position of the camera, relative to its parent.

Rotation – Adjusts the rotation of the camera, relative to its parent. If a Target Lock has been set, then any Rotation setting will be ignored, because the camera will not “look away” from the Target.

Scale – Adjusts the scale of the camera and any child objects attached to it. Scaling the camera affects the objects in the scene that are not attached to it inversely. If the camera is scaled to a value of 2, then the objects in the scene

that are not attached to it will appear to be half as big.

Pivot – Adjusts the position of the camera’s pivot point, which serves as the center for its rotation.

Field of View – Controls the amount of the scene visible and the amount of perspective flare applied to the camera’s view. It is measured in degrees of the horizon. A very narrow field of view flat-tens the perspective like a telephoto lens, while a very wide field of view exaggerates the perspective like a fish-eye lens. If Orthographic is checked, then the Field of View setting is inactive. Range = 0 to 180 degrees. Default = 60 degrees.

Clipping Start – Sets a radial front clip plane for the camera. Nothing in front of this plane will be rendered.

Clipping End – Sets a radial rear clip plane for the camera. Nothing behind this plane will be rendered.

Quick DefinitionClipping planes - A clipping plane is a plane that is vertical to the line of sight, beyond which objects disappear. The near clipping plane, which defines the point at which objects moving towards camera will disappear, is set with the Clipping Start property. The far clipping plane, which defines the point at which objects moving away from the camera will disappear is set with the Clipping End property.

Anark_Studio_User_Guide.book Page 91 Monday, March 19, 2007 10:34 AM

Page 100: Anark Studio4 User Guide

92 Anark Studio User Guide

Chapter 5Setting Object Properties

When Clipping Start is set to 200, portions of the objects in the foreground aren’t ren-dered (top), and when Clipping End is set to 400, the objects in the background are not rendered.

Basic PropertiesTarget Lock – Enables the Target prop-erty and locks the camera’s view to the specified Target. Even if the camera’s position is changed, it will stay focused on the Target. If Target Lock is on (checked), then any rotation settings for the camera will be ignored. Defaults to off (unchecked).

Target – Defines a point in space that the camera will look at.

Enable Fog – Enables fog settings for the camera, including Fog Color, Start of Fog

and End of Fog. Fog is used in 3D imaging to create a sense of distance. In the real world, because the atmosphere absorbs and scatters light from distant objects, things that are far from the viewer have less intense color and contrast than objects that are close up. When the human eye perceives this color change, it creates a sensation of depth. Camera fog creates a similar effect in the 3D scene.

Start of Fog – Sets the radial distance from the camera at which fog begins. Fog Enable must be turned on in order for this setting to appear.

End of Fog – Sets the radial distance from the camera at which fog makes every-thing opaque. Fog Enable must be turned on in order for this setting to work.

Fog Color – Sets the color of the fog. Fog Enable must be turned on in order for this setting to appear.

Fog makes objects in the background appear fainter.

Anark_Studio_User_Guide.book Page 92 Monday, March 19, 2007 10:34 AM

Page 101: Anark Studio4 User Guide

User Reference 93

Working with fog

Working with fogVideo cards can display two types of fog: vertex and table. Vertex fog is drawn based on the vertices of the objects in the presentation and can sometimes be blotchy, while table fog is always smooth. Vertex fog is more commonly supported than table fog. Because the video card itself decides which type of fog will be displayed, a presentation with fog in it may appear differently on different computers. There are a couple of things to keep in mind when working with fog:

Because vertex fog is blotchier on large objects with fewer vertices (such as cubes and rectangles) you may want to use more complex (or “curvy”) objects in the project.

If possible, you should test your project on different computers with different video cards to see what affect the different types of fog will have on your project.

Setting properties for lightsLights are used to create natural lighting like sunlight, artificial lighting like indoor lighting, or more stylized lighting effects like theatrical productions might use.

When a new layer is created, it has a Light object already attached to it that provides lighting for the scene. You can edit the properties of this light, and you

can also add new lights to the layer. There can be up to eight simultaneously active lights for each layer.

Light – Displays the current name of the Light. For information about renaming objects, see “Renaming objects” on page 63.

Basic PropertiesLight Type – Specifies whether the light will be Point, Directional or Spot.

Directional – A Directional light casts light in parallel rays, much like sun-light hitting the earth. The light is cast at the same angle on all the objects in the scene with equal brightness. The angle is determined by the Rotation setting of the light. Because directional lights don’t have a Brightness prop-erty, you must change their Diffuse

Anark_Studio_User_Guide.book Page 93 Monday, March 19, 2007 10:34 AM

Page 102: Anark Studio4 User Guide

94 Anark Studio User Guide

Chapter 5Setting Object Properties

Color in order to increase or decrease their brightness.

A Directional light illuminates the group with flat, even lighting.

Point – A Point light casts light in all directions from a single point. Because it emits light equally in all directions, any Rotation setting is ignored for this light type.

A Point light set inside a group illuminates the objects from within.

Spot – A Spot light casts a cone-shaped beam of light from a single point.

A Spot light illuminates the group with a cone of light.

Position – Adjusts the position of the light, relative to its parent. This property has no effect on Directional lights.

Rotation – Adjusts the rotation of the light, relative to its parent. This property has no effect on Point lights.

Scale – Adjusts the scale of any child objects attached to the light.

Pivot – Adjusts the position of the light’s pivot point. The pivot point for an object serves as the center for its rotation and provides the coordinates for scaling.

Light Color – Adjusts the color of the light’s direct rays.

Brightness – This setting is only available for Point and Spot lights. It adjusts the maximum level of light from this light source. Range = 0 to 200. Default = 100. To change the brightness of a Direc-tional light, you can change its Diffuse Color to a brighter or darker shade of the same hue.

Anark_Studio_User_Guide.book Page 94 Monday, March 19, 2007 10:34 AM

Page 103: Anark Studio4 User Guide

User Reference 95

Setting properties for groups

Cone Angle – This setting is only avail-able if the Light Type is Spot. It adjusts the falloff at the edge of a Spot light’s cone of light. Range = 0 to 180 degrees. Default = 180.

Advanced Properties

Linear Fade – This setting is only avail-able for Point and Spot lights. It adjusts the way and speed at which the light from this light source fades to darkness. If Linear Fade alone is used, then the light will diminish at a steady rate over the distance specified by the Range parameter. The higher the setting, the faster the fade. Exponential Fade can be used as well to create interesting light effects. Range = 0 to 200. Default = 0.

Exponential Fade – This setting is only available for Point and Spot lights. It uses an exponential formula and the specified value to control the way and the speed at which the light from this light source fades to darkness. “Real world” light fades exponentially, but it may seem too dark for computer graphics. The higher the setting, the faster the fade. Linear Fade can be used together with Exponential Fade to create interesting light effects. Range = 0 to 200. Default = 0.

Specular Color – Adjusts the color of highlights in the scene.

Ambient Color – Adjusts the color of indirect light in the scene.

Setting properties for groupsGroups hold other objects. They are used to apply the same settings to multiple objects at once or to animate them.

Note: Components, which are used to create independently timed ani-mation for objects, have several of the same properties as groups. They also have some unique properties, which are documented in “Setting properties for components” on page 117.

Group – Displays the current name of the Group. For information about renaming objects, see “Renaming objects” on page 63.

Basic PropertiesPosition – Adjusts the position of the members of the group, relative to the pivot point of the group’s parent.

Rotation – Adjusts the rotation of the group around its pivot point.

Scale – Adjusts the scale of the members of the group based on the group’s pivot point.

Anark_Studio_User_Guide.book Page 95 Monday, March 19, 2007 10:34 AM

Page 104: Anark Studio4 User Guide

96 Anark Studio User Guide

Chapter 5Setting Object Properties

Note: The position, rotation and scale of groups can also be set using mouse controls or the arrow keys. See “Shortcuts for setting properties for groups, models and text” on page 97.

Pivot – Adjusts the position of the group’s pivot point. The pivot point serves as the center for group’s rotation and provides the coordinates for scaling. When a group is added to the project, its pivot point is set to the World Center (0, 0, 0).

Note: The pivot point of the group is not based on the location of the objects within the group. Even if the objects within the group are moved around, the group’s pivot point does not move. It stays at the world cen-ter until the group object itself is moved.

Opacity – Adjusts the transparency of all models attached to the group. If the opacity is set to 0, the object will be drawn in the scene, but will be invisible. See “Working with opacity” on page 111 for information about the effect of opacity settings on how objects are rendered and the multiplicative relation-ship of the Opacity properties of layers, groups, models and materials.

Advanced Properties

Distance Fade – Enables “Soft Culling” based on the distance of objects from the

camera. When Distance Fade is on, objects that are part of the group that are beyond the Fade Far setting will not be rendered at all, while objects that are closer than the Fade Near setting will be fully rendered. Any objects between these ranges will be progressively more transparent. This can be used to opti-mize rendering speeds of complex presentations with many objects and polygons and can improve the appear-ance since aliasing of distant objects may be reduced.

The Distance Fade setting applies to all objects in the group; however, if the group contains a subgroup that has Distance Fade selected and that has different settings for Fade Near and Fade Far, those settings will be used for the objects within the subgroup instead. (Turning off the Distance Fade setting for the subgroup uses the settings of the parent; it does not disable Distance Fade for that subgroup.)

Fade Near – Sets the distance where objects begin to fade. Objects closer than this range are not affected by Distance Fade at all.

Fade Far – Sets the culling distance where objects are completely invisible. Objects in the group that are beyond this range are not rendered.

Tip: Typically, the Fade Far is “far-ther” from the camera than the Fade Near, but the reverse can also be used to make objects in the fore-ground disappear instead.

Anark_Studio_User_Guide.book Page 96 Monday, March 19, 2007 10:34 AM

Page 105: Anark Studio4 User Guide

User Reference 97

Setting properties for models

Setting properties for modelsThere are a variety of primitive models, such as cubes, spheres, cones and rectan-gles available on the Basic Objects tab. In addition, you may want to use 3D mesh objects that were created in other appli-cations. If you are creating them your-self, you should use the guidelines that are outlined in “Chapter 2: Preparing Models, Videos and Images” on page 35. Once you have created a model, you must import it into the Library palette as a resource using the instructions in “Importing objects” on page 51.

Model Name – Displays the current name of the Model. For information about renaming objects, see “Renaming objects” on page 63.

Position – Adjusts the position of the model, relative to its parent.

Rotation – Adjusts the rotation of the model, relative to its parent.

Scale – Adjusts the scale of the model and its children.

Note: The position, rotation and scale of models can also be set using mouse controls or the arrow keys.

See “Shortcuts for setting properties for groups, models and text” on page 97.

Pivot – Adjusts the position of the object’s pivot point. The pivot point serves as the center for the model’s rota-tion and provides the coordinates for scaling.

Opacity – Adjusts the transparency of the model. If the opacity is set to 0, the object will be drawn in the scene, but will be invisible. See “Working with opacity” on page 111 for information about the effect of opacity settings on how objects are rendered and the multi-plicative relationship of the Opacity properties of layers, groups, models and materials.

Shortcuts for setting properties for groups, models and textIn addition to using the Inspector palette to edit properties, the position, rotation and scale of currently selected models, groups and text in the Project window can be changed using the mouse or keyboard shortcuts. The interface also includes controls for quickly changing these properties in the Inspector palette.

Tip: Press and hold down with the middle mouse button to momen-tarily switch the focus to the edit camera tool icons. The tool with the focus is brighter than the other tools.

These controls can be used to change both the default settings or to animate these properties over time. For informa-tion about animating properties, see

Anark_Studio_User_Guide.book Page 97 Monday, March 19, 2007 10:34 AM

Page 106: Anark Studio4 User Guide

98 Anark Studio User Guide

Chapter 5Setting Object Properties

“Chapter 7: Animating Objects” on page 145.

Transform tools for selected objects.

To select a Transform tool:Click on the icon for it or press one of the following keys:

R = Rotate

W = Position

E = Scale

When any Transform tool is enabled, you can temporarily enable a different tool by holding down modifier keys. The tool icon in the Project window will change to the currently enabled tool. The following table lists how the keys affect the currently selected tool.

Using the keyboard shortcuts to change group, model or text properties is called nudging.

To change the number of units each keypress transforms the object:1. Choose Edit > Application Prefer-

ences (Ctrl + P). The Preferences dia-log will open.

2. Set a new Nudge Increment.

3. Click OK.

Changing rotationTo rotate an object along the X and Y axes:1. Select the object using the instruc-

tions in “Selecting objects” on page 61.

2. Enable the Rotate tool ( ).

3. Do one of the following:

• While holding down the left mouse button, click on the object and rotate it to the desired position in the Project window.

• Press the arrow keys on your keyboard to rotate the object to the desired position in the Project window. The up and down keys rotate the it around the X axis. The left and right keys rotate it around the Y axis.

Note: Only text objects with a Render Style set to Full Perspective can be rotated in X and Y. See “Setting properties for text” on page 85 for more information.

To rotate an object along the Z axis:1. Select the object using the instruc-

tions in “Selecting objects” on page 61.

2. Enable the Rotate tool ( ).

3. Do one of the following:

• While holding down the Shift key, use the up and down arrow keys and rotate the object to the desired posi-tion in the Project window.

• Right-click on the object and rotate it to the desired position in the Project window.

Note: All text objects can be rotated around Z.

Changing positionTo move an object along the X and Y axes:1. Select the object using the instruc-

tions in “Selecting objects” on page 61.

Currently Selected Tool

Modifier Key Rotate Position ScaleAlt Scale Scale RotateCtrl Position Rotate Position

Anark_Studio_User_Guide.book Page 98 Monday, March 19, 2007 10:34 AM

Page 107: Anark Studio4 User Guide

User Reference 99

Changing scale

2. Enable the Position tool ( ).

3. Do one of the following:

• While holding down the left mouse button, click on the object and move it to the desired position in the Project window. Holding down the Shift key as you drag constrains the movement to one axis (i.e., the X axis when the mouse is dragged horizontally and the Y axis when it’s dragged vertically).

• Press the arrow keys on your keyboard to move the object to the desired position in the Project window. The up and down keys move it along the X axis. The left and right keys move it along the Y axis.

To move a group or model along the Z axis:1. Select the group or model using the

instructions in “Selecting objects” on page 61.

2. Enable the Position tool ( ).

3. Do one of the following:

• While holding down the Shift key, use the up and down arrow keys on your keyboard and move the group or model to the desired position in the Project window.

• Right-click on the group or model and move it to the desired position in the Project window.

Note: Text objects with a Render Style set to Flat cannot be moved along the Z axis. See “Setting proper-

ties for text” on page 85 for more information.

Changing scaleTo change the overall scale of an object:1. Select the object using the instruc-

tions in “Selecting objects” on page 61.

2. Enable the Scale tool ( ).

3. Do one of the following:

• While holding down the left mouse button, vertically drag the object to the desired scale.

• Press the arrow keys on your keyboard to reach the desired scale. The up and down keys scale the object along the X axis. The left and right keys scale it along the Y axis.

To scale an object along the Z axis:1. Select the object using the instruc-

tions in “Selecting objects” on page 61.

2. Enable the Scale tool ( ).

3. Do one of the following:

• Hold down the Shift key and use the up and down arrow keys to reach the desired scale.

• Right-click on the object and verti-cally drag it to the desired scale.

Note: Only text objects with a Render Style set Full Perspective can be scaled. See “Setting properties for text” on page 85 for more information.

Anark_Studio_User_Guide.book Page 99 Monday, March 19, 2007 10:34 AM

Page 108: Anark Studio4 User Guide

100 Anark Studio User Guide

Chapter 5Setting Object Properties

Working with obscured objectsWhen working in the 3D space of the Project window, objects that are larger or closer may obscure other objects.

The model obscured by the cylinder can be moved, scaled or rotated using the mouse by clicking in the matting outside the Project window.

To change an obscured model’s proper-ties using the mouse:1. Select the model in the Object out-

line (unless it is already selected).

2. Enable the desired Transform tool.

3. While holding down the mouse but-ton, move the mouse in the matting outside the Project window until the model has the desired setting.

Setting properties for materialsMaterials are used to create the surface appearance of a model. They control the color, shininess and opacity of a model, among other things. Materials do not have timebars of their own, because the duration of a material is always the same as the duration of the model to which it is attached.

When a model is imported into Anark Studio, information about any materials that have been applied to its surface is imported along with the model’s file

into Anark Studio. Primitives created using the buttons on the Basic Objects tab already have materials attached to them. Multiple materials can be applied to the different polygons of a model in 3D modeling programs, but not in Anark Studio itself. See “Chapter 2: Preparing Models, Videos and Images” on page 35 for more information. Materials from other models in the Library cannot be applied to other models.

The model’s material information can be accessed in the Library, for a resource, or, if accessing an instance, by clicking on the triangle next to the model’s name in the Object outline and then clicking on the Expand/Collapse arrow next to Materials.

Material Name – Displays the current name of the Material. For information about renaming objects, see “Renaming objects” on page 63.

Basic PropertiesDiffuse Color – Adjusts the color of the material as viewed in direct light.

Emissive Power – Specifies the intensity of the emissive property of the material. An emissive material appears to give off its own light.

Blending Mode – Controls how the pixels of this material blend with the pixels of the rest of the scene. Blending Modes are based on mathematical operations that compare the color values of the pixels of this material with the color values of the

Anark_Studio_User_Guide.book Page 100 Monday, March 19, 2007 10:34 AM

Page 109: Anark Studio4 User Guide

User Reference 101

Setting properties for materials

pixels of whatever else is in the scene that intersects this material (the base color). Several of the Blending Modes use the Hue, Luminosity or Saturation values of the colors when blending. Those terms are defined in “Setting color properties” on page 116.

Note: Opacity settings (on models, materials, layers or groups) have dif-ferent results with different Blend-ing Modes. In some cases, opacity settings are applied as they normally would be, but in other cases they are simply ignored, while in other cases they are used as an additional factor in the blending calculations.

Anark_Studio_User_Guide.book Page 101 Monday, March 19, 2007 10:34 AM

Page 110: Anark Studio4 User Guide

102 Anark Studio User Guide

Chapter 5Setting Object Properties

Normal – Uses no special Blending Mode and makes only the material color the result.

Screen – Additively blends the material color with the base color by multiply-ing the inverse of the color values to create the result. Screen always creates a lighter final color. The Opacity prop-erty does not affect this mode.

Multiply – Additively blends the mate-rial color with the base color by multi-plying the color values to create the result. Multiply always creates a darker final color.

Overlay – Overlays the material color onto the base color while preserving

the highlights and shadows of the base color.

Bleach – Takes the saturation of the material color and adds it to the base color. The effect is similar to bleaching (lightening) with specific colors.

Ghost – Multiplies the material color’s opacity value (i.e., its alpha channel data) by its luminosity value and mul-tiplies the result with the inverse of the base color to create the final result. The Opacity property does not affect this mode.

Saturate – Doubles the material color’s values and blends them with the base color. The Opacity property does not affect this mode.

Anark_Studio_User_Guide.book Page 102 Monday, March 19, 2007 10:34 AM

Page 111: Anark Studio4 User Guide

User Reference 103

Setting properties for materials

Opacity – Adjusts the transparency of the material. If the opacity is set to 0, the object will be drawn in the scene, but will be invisible. See “Working with opacity” on page 111 for information about the effect of opacity settings on how objects are rendered and the multi-plicative relationship of the Opacity properties of layers, groups, models and materials.

Advanced Properties

Render Mode – Specifies whether the object is displayed as a wireframe, a point cloud, or a solid. Defaults to Solid.

Ambient Color – Adjusts the color of the material as viewed in indirect light.

Enable Specularity – Specifies whether the material will display specular highlights (i.e., glossiness) and enables the Specular Color and Specular Power properties.

Specular Color – Adjusts the color of the material’s reflected highlights. Specular Enable must be checked in order for this color setting to appear.

Specular Power – Specifies the sharpness of the specular highlights of the mate-rial. A higher value creates a tighter and more intense highlight. Specular Enable

must be checked in order for this setting to appear.

Double Sided – Specifies the type of culling to perform on this object. This can be used as an optimization tool to reduce the number of polygons that must be rendered to accurately display this material on an object.

2 Sided – Specifies that no culling will be performed.

1 Sided:Clockwise – Specifies clockwise culling on the object, so that the inte-rior of the model is displayed rather than the exterior.

1 Sided:Counterclockwise – Specifies counterclockwise culling on the object, so that only the exterior of the model is displayed.

Note: If the material is too dark when 1 Sided is set, increase the Emissive Power.

Depth Write – Sets whether the normal depth render order will be enabled for the material. If set to Default, then the opacity of the material will determine whether or not the normal back-to-front render order will be applied. If turned on, then the normal render order will be applied, regardless of the opacity of the material. If turned off, then the normal render order will not be applied to this material. See “Working with opacity” on page 111 for more information.

Quick DefinitionCulling - Culling is the process of elimi-nating the polygons that face away from the viewer and therefore can’t be seen. Culling speeds up the rendering of the scene, since all those unseen polygons use up valuable processing power.

Anark_Studio_User_Guide.book Page 103 Monday, March 19, 2007 10:34 AM

Page 112: Anark Studio4 User Guide

104 Anark Studio User Guide

Chapter 5Setting Object Properties

Setting properties for imagesImages in Anark Studio are the equiva-lent of image or material maps in 3D modeling programs. Any 2D graphic image can be an image map. It may contain a black and white or color graphic or photograph. Any image map information that has been applied to a model is included with the material information when the model is imported into Anark Studio. When an instance of the object is added to the project, the material and image informa-tion are added as instances, too. Images that are imported along with a 3D model can also be attached to the materials of other objects.

For some tips on optimizing the file size and getting the best results from image maps, see “Preparing video clips and graphics as image maps” on page 41.

Images can only be attached to layers, groups or materials. When an image is attached to a layer or a group, it is auto-matically mapped to a newly created model (a rectangle primitive) in both the Object outline and the Library, and the original image is turned into a child object of the new model’s material.

Double-clicking on an image in the Object outline will open it in your default image viewing application.

For a complete list of supported image formats, see “Supported Media Formats” on page 305.

Note: Most video cards can’t support more than four images per model or material, and some can only support two images, so it’s a good idea to use as few images per material as possible. Be aware of the limitations and capabilities of your video card.

Image Name – Displays the current name of the image for the image. For informa-tion about renaming objects, see “Renaming objects” on page 63.

For specific information on the different types of image properties, and how to use them, see the following sections:

“Basic properties (for images)” on page 105

“Advanced properties (for images)” on page 107

“Shared properties (for images)” on page 108

“Mipmapping” on page 109

Anark_Studio_User_Guide.book Page 104 Monday, March 19, 2007 10:34 AM

Page 113: Anark Studio4 User Guide

User Reference 105

Basic properties (for images)

Basic properties (for images)Texture Mapping – Controls the way the image is wrapped around or projected onto the object.

UV Mapping – Shrink wraps the image around the object.

Note: In order to use UV Mapping, objects imported from 3D modeling programs must have UV mapping information already set for them. Anark Studio imports all UV map-ping information from the 3D file and maintains the scale.

Camera Projection – Maps the image to the camera’s view so that the image is projected onto the entire scene as if it were a backdrop, but is only seen on the object. If the object moves, the portion of the image seen on the object will change. Camera Projection maps are best viewed when Ortho-graphic has been turned on for the active camera.

Object Projection – Projects the image onto the object like a slide projector, and fits the image to the dimensions of the object. This is useful for light maps and reflections maps.

Environmental Mapping – Maps the image to a sphere surrounding the

object, which the object then reflects. This is often used to create the look of glass or metal, which reflect what’s around them.

Texture Type – Specifies how the image will affect the appearance of the material.

Diffuse Map – Applies the image to the material’s diffuse color and ambient color.

Opacity Map – Applies the image to the material’s alpha channel (or transpar-ency). See “Creating an Opacity Map” on page 112 for more information.

Specular Map – Applies the image to the material so that it acts as the mate-rial’s specular highlights. The map will additively blend with any other map on the material.

Anark_Studio_User_Guide.book Page 105 Monday, March 19, 2007 10:34 AM

Page 114: Anark Studio4 User Guide

106 Anark Studio User Guide

Chapter 5Setting Object Properties

Light Map – Applies the image to the material as a light map. Light maps are used to simulate real-world lights on materials. This map type is less dra-matic than the Specular Map and will slightly brighten the material without over-brightening. For more informa-tion about creating light maps, see “Creating a Light Map” on page 111.

Emissive Map – Quadruples the color saturation and luminosity (or bright-ness) of the material based on the color information of this image.

SuperCharge Map – Doubles the color saturation and luminosity of the mate-rial based on the color information of this image.

Negative Map – Applies the image to the material in the inverse, resulting in a negative of the image.

U Tiling – Specifies the type of tiling (or repetition) to apply horizontally to the image. Tiling is typically used to create wallpaper-like patterns with a simple image. Tiling works best when the orig-inal image size is a power of 2 (8 x 8 pixels, 64 x 64 pixels, etc.).

Tiled – Repeats the image over and over.

Mirrored – Flips the image repeatedly.

No Tiling – Does not repeat the image.

Anark_Studio_User_Guide.book Page 106 Monday, March 19, 2007 10:34 AM

Page 115: Anark Studio4 User Guide

User Reference 107

Advanced properties (for images)

V Tiling – Specifies the type of tiling (or repetition) to apply vertically to the image. V Tiling uses the same types as U Tiling.

An image with U and V Repeat set to 4 and U and V Tiling set to Tiled (left); the same image with U and V Tiling set to Mirrored (right).

U Repeat – Adjusts the horizontal scale of the image so that it can be repeated on the model (using tiling).

V Repeat – Adjusts the vertical scale of the image so that it can be repeated on the model (using tiling).

An image with a U and V Repeat of .5 (left); the same image with a U and V Repeat of 2 (right).

UV Rotation – Sets the rotation of this image in degrees.

An image with UV Rotation set to 12.

Advanced properties (for images)

U Position – Adjusts the horizontal posi-tion of the image in normalized units. A setting of .5 moves the image over by half of its distance. A setting of 2 moves the image over by twice its distance, which would mean that it is no longer displayed unless U Tiling has been enabled.

V Position – Adjusts the vertical position of the image in normalized units. A setting of .5 moves the image over by half of its distance. A setting of 2 moves the image over by twice its distance, which would mean that it is no longer displayed unless V Tiling has been enabled.

An image on a cube (left); the same image with U and V Position settings of .5 (middle); the same image with U and V Tiling turned off (right).

U Pivot – Sets the horizontal location of the pivot point of the image on the object. Because the pivot point is calcu-lated in global space, a Position U offset must also be set in order to see a differ-ence in the pivot point in the local space of the image. If the U Pivot and V Pivot are set to 0, then the pivot point is located in the bottom left hand corner of the model. Specified in values between 0 and 1.0.

Anark_Studio_User_Guide.book Page 107 Monday, March 19, 2007 10:34 AM

Page 116: Anark Studio4 User Guide

108 Anark Studio User Guide

Chapter 5Setting Object Properties

V Pivot – Sets the vertical location of the pivot point of the image on the object. Because the pivot point is calculated in global space, a Position V offset must also be set in order to see a difference in the pivot point in the local space of the image. If the U Pivot and V Pivot are set to 0, then the pivot point is located in the bottom left hand corner of the model. Specified in values between 0 and 1.0.

An image with a U and V Position of -.5, U and V Pivot of .5, and UV Rotation of 33 (left); the same image with the U and V Pivot set to .25 (right).

Image opacity – Controls whether or not the alpha channel data for an image will contribute to the transparency of a model. For highly complex imported models, the alpha channel data of images may cause the model to be rendered improperly. For example, trans-parency is often added to the skin of character models in order for them to look more realistic. Because this can cause those portions of the model itself to be rendered as transparent, you can use Propagate Image Opacity to tell the renderer not to use the image’s transpar-ency in that instance.

Use Image Alpha – Allows the renderer to decide whether to use an image’s alpha channel data, if any exists.

Force Transparency – Forces the ren-derer to use an image’s alpha channel data.

No Transparency – Prevents the ren-derer from using the image’s alpha channel data.

For more information on how opacity settings are handled in Anark Studio, see “Working with opacity” on page 111.

Shared properties (for images)The contents of this area of the Inspector pane vary considerably. For example, you will see different choices if the image is associated with an object as a material. In this case, see “Mipmapping” on page 109 for information about the available choices

Shared properties, including the compression settings, are automatically applied to all instances of an image. If more than one resource of the same image has been imported into the Library, then the compression settings are applied to all of them. Real-time compression information about the image is displayed in the Inspector palette.

Current compression information for the image is in the Inspector palette.

Image Size Reduction – Reduces the image dimensions in such a way that both file size and the video card memory required for display are reduced. When-ever possible, this should be the first type of compression applied to an

Anark_Studio_User_Guide.book Page 108 Monday, March 19, 2007 10:34 AM

Page 117: Anark Studio4 User Guide

User Reference 109

Mipmapping

image, although it can make the image appear grainier when close up.

Compression Type – Specifies the type of compression algorithm to be applied to the image. There is a trade-off between image quality and finished file size. In general, you should compress images as much as possible while maintaining the level of quality you need.

Lossless – Slightly compresses the file size without any loss of image quality.

JPEG – Compresses continuous tone images such as photographs while maintaining optimal image quality and enables the Compression Quality slider.

Compression Quality – Controls the size of the color palette for the image. If an image uses 256 colors and Compression Quality is set to 50, then only 128 colors will be available in the palette. This property is only available when JPEG has been selected as the Compression Type. Defaults to 75.

Remote Source – Specifies either the URL of a JPEG or PNG image file, or the fully qualified absolute or relative path to it. The relative path must be preceded by ./ to indicate the current directory (or ../ to go up one directory level, etc.). If no Remote Source is specified, then the embedded image (i.e., the image resource in the Library) will be displayed. If Connect to Source is checked, you cannot edit the Remote Source property. This property can be used to load a sequence of images if used in conjunction with a properly written behavior. Because it may take a moment or two to load a remote image, you can use the PreBufferAsset behavior to begin loading the image asset before the image is displayed. See “Setting up dynamic

images” on page 169 for more information.

Connect to Source – Allows you to view a remote image while working in Anark Studio. The Remote Source must also be specified. When Connect to Source is checked, you cannot edit the Remote Source property.

MipmappingMipmaps help improve the visual quality of rendered images. Mipmapping works by creating lower resolution, prefiltered versions of an image that you intend to use as a texture map. When rendering the image, the appropriate resolution mipmap is chosen and thereby the texture pixels (texels) are already down-sampled and filtered when they arrive on the screen.

The downsampled images of the brick wall are shown to the right. Each new image is exactly half the size—in each direction—of the previous image on which it is based.

The computations for the mipmapping are handled on the video card, so it can be rendered quickly.

The three mipmapping algorithms you can choose from are:

• Bi-linear

• Tri-linear

• Tri-linear anisotropic

Anark_Studio_User_Guide.book Page 109 Monday, March 19, 2007 10:34 AM

Page 118: Anark Studio4 User Guide

110 Anark Studio User Guide

Chapter 5Setting Object Properties

The options for bi-linear and tri-linear are the same; with tri-linear anisotropic, you are presented with another option, anisotropy degree.

Bi-linear – Bi-linear filtering uses points from the mipmap to perform bilinear interpolation between the four texels nearest to the point that the pixel represents.

Tri-linear – Tri-linear filtering interpo-lates between the results of bilinear filtering on the two mipmaps nearest to the detail required for the polygon at the pixel.

Tri-linear anisotropic – The tri-linear anisotropic algorithm enhances the image quality of textures on surfaces

that are far away and steeply angled with respect to the camera.

MipMap LOD Bias – LOD is an abbrevia-tion for Level of Detail. LOD bias increases the efficiency of the rendering by decreasing the pixel count in on-screen areas where fewer pixels are needed. Range = -3.0 (full left) to 3.0 (full right). At one extreme (-3.0), features in the distance (far from the camera) will look blurry; at the other extreme (3.0), features in the distance (far from the camera) will look fairly sharp.

Anisotropy Degree – Choose between Low, Medium, and High. A high degree requires more iterations of computing than a low degree.

Quick DefinitionAnisotropy (the opposite of isotropy) is the property of being directionally dependent. Something that is anisotropic may appear different, or have different characteristics in different directions.

Anark_Studio_User_Guide.book Page 110 Monday, March 19, 2007 10:34 AM

Page 119: Anark Studio4 User Guide

User Reference 111

Working with opacity

Working with opacityOpacity is a powerful feature of Anark Studio that helps create a sense of depth and greatly expands the types of effects that can be applied to objects in the scene. When working with the Opacity property of a layer, group, model, text or material, it’s important to keep a couple of concepts in mind.

One is that the Opacity properties of objects have a multiplicative relation-ship. This means that if a model has an opacity value of 50% and both its parent group and layer have an opacity value of 80%, then the model will actually appear to have an opacity of 32% (50% x 80% x 80% = 32%).

The second important concept is the effect of opacity on the render order of the polygons that make up the models in the scene. In order to generate smooth animation for real-time 3D graphics, computer systems must make some initial decisions about how to draw the polygons that compose the objects in the scene, including in what order to render them. Whenever an object is made transparent by setting the opacity to anything other than 100%, the initial render order may no longer be accurate. The same thing may also happen when a complex model with transparent textures is imported into Anark Studio.

During playback, the render order of the objects in the scene is recalculated each time the scene is drawn; however, recal-culating the render order of all the poly-gons of all the objects for every frame would be too processor-intensive for smooth playback.

Anark Studio provides a couple of ways for you to control how a model’s poly-gons should be rendered.

One way is to use the Depth Write property of the material. Depth Write allows you to specify that the initial render order for a particular model’s polygons should be overridden. If you notice that a model – or even a partic-ular material on the model – is not displaying correctly when an opacity setting is changed, then you will have to experiment with the Depth Write setting for each material on the object. If there is only one material on the model, try turning on Depth Write. If there is more than one material on the model, you may need to set Depth Write on for some and off for others. Keep in mind that if the object is rotated, then the render order will be inaccurate again.

Another option is to use the Propagate Image Opacity property of images. Propagate Image Opacity allows you to control whether or not the alpha channel data for an image will contribute to the transparency of a model. If you import a complex model and find that some of the polygons appear to be rendering in the wrong order, setting Propagate Image Opacity to No Transparency may help.

Creating a Light MapLight Maps are a special kind of Texture Type that softly project an image onto the model in order to simulate photo-realistic lighting.

To use Light Maps in Anark Studio and your presentations:1. Import a 3D model into Anark Studio

and drag an instance of it onto the Project window or the Object outline.

2. Import a grayscale image to be used as a Light Map.

Anark_Studio_User_Guide.book Page 111 Monday, March 19, 2007 10:34 AM

Page 120: Anark Studio4 User Guide

112 Anark Studio User Guide

Chapter 5Setting Object Properties

3. Click on the imported Light Map resource in the Library.

4. Set the Texture Mapping to Object Projection.

5. Set the Texture Type to Light Map.

6. Expand out the material of the model you want to apply the Light Map to by clicking on the Expand/Collapse arrow next to it in the Object outline.

7. Drag the Light Map image from the Library onto the model's material.

From left to right: a 3D model, a grayscale image, and the image applied to the model as a Light Map.

Creating an Opacity MapOpacity Maps allow you to create trans-parent holes in an object. In order to do this, Anark Studio needs alpha channel data for the image. The alpha channel specifies the transparency of each pixel in the image, just as the red, green and blue channels together specify the color of each pixel. Some popular image types, such as .jpg, do not have any alpha channel data. They are 24-bit images as opposed to 32-bit images (such as .png and .tga), which include 8 bits of alpha channel data.

In general, if you want to create an Opacity Map, you should use a 32-bit image.

To create an Opacity Map using a 32-bit image:1. Import a 3D model into Anark Studio

and drag an instance of it onto the Project window or the Object outline

2. Import the image to be used as the Opacity Map.

3. Set the Texture Type to Opacity Map.

4. Expand out the material of the model you want to apply the Opacity Map to by clicking on the Expand/Col-lapse arrow next to it in the Object outline.

5. Drag the Opacity Map image from the Library onto the model's material.

From left to right: a 3D model, a grayscale image, and the image applied to the model as an Opacity Map.

If for some reason you only have a 24-bit image to work with, Anark Studio provides a way to create an alpha channel for it so that it can be used as an Opacity Map.

Important: The Make Opacity Image operation that creates the alpha channel for the image turns the image into a grayscale and changes the color data. Once it has been exe-cuted, it cannot be undone inside Anark Studio. You should only use it on 24-bit images that you want to use as Opacity Maps. If you run the operation and decide you want to undo it, you will have to delete the Library resource and reimport the original image.

To create an Opacity Map using a 24-bit image:1. Import a 3D model into Anark Studio

and drag an instance of it onto the

Anark_Studio_User_Guide.book Page 112 Monday, March 19, 2007 10:34 AM

Page 121: Anark Studio4 User Guide

User Reference 113

Setting properties for video

Project window or the Object outline.

2. Import the image to be used as the Opacity Map.

3. Right-click on the image resource in the Library and select Make Opacity Image from the Context menu. The image now has alpha channel data. To do this, Anark Studio creates a grayscale of the image by taking the average of the red, green and blue channels for each pixel and uses the result as both the alpha channel and the other channels.

4. Set the Texture Type to Opacity Map.

5. Expand out the material of the model you want to apply the Opacity Map to by clicking on the Expand/Collapse arrow next to it in the Object outline.

6. Drag the Opacity Map image from the Library onto the model’s material.

Setting properties for videoVideos serve much the same function as images, but instead of encapsulating a single 2D graphic, they contain a video file that can be streamed by Anark Studio. As with images, any video infor-mation that has been applied to a model is included with the material informa-tion when the model is imported into Anark Studio.

Videos can only be attached to layers, groups and materials. When a video is attached to a layer or group, it is auto-matically mapped to a newly created model (a rectangle primitive) in both the Object outline and the Library, and the original video resource in the Library is turned into a child object of the new model’s material.

For a complete list of supported video formats, see “Supported Media Formats” on page 305.

For some tips on optimizing the file size and getting the best results from video clips, see “Preparing video clips and graphics as image maps” on page 41.

Video is streamed remotely rather than embedded with the file data when it’s imported into Anark Studio. See “Chapter 8: Working with Streaming Media and Dynamic Images” on page 165 for more information.

Videos share most of the same properties as images (except compression settings). For a complete description and visual examples of the properties that images share with video, see “Setting properties for images” on page 104. In addition, videos have the following properties.

Basic PropertiesVolume – Adjusts the loudness of the video’s sound. Range = 0 to 100. Defaults to 100, which is 100% of the loudest setting the end user has enabled on his or her system.

Loop – Specifies that the video should continuously loop for the duration of its timebar. Defaults to off.

Anark_Studio_User_Guide.book Page 113 Monday, March 19, 2007 10:34 AM

Page 122: Anark Studio4 User Guide

114 Anark Studio User Guide

Chapter 5Setting Object Properties

Auto Start – Sets whether the video will automatically start playing when it first appears in the Timeline. If Auto Start is off (unchecked) you can set the video to play based on a scripted behavior. Defaults to on (checked).

Advanced Properties

Cue – Specifies a location within the video to begin playing. If Loop is turned on for this video, then this will be the starting point of the video each time it is played. Specified in seconds.

Shared Properties

These settings are automatically applied to all instances of the video. If more than one resource of the same video has been imported into the Library, then these settings are applied to all of them.

Remote Source – Specifies either the URL of the video file or the fully qualified absolute or relative path to it. The rela-tive path must be preceded by ./ to indi-cate the current directory (or ../ to go up one directory level, etc.). See “Under-standing paths for streaming media and dynamic images” on page 166 for more information.

Connect to Source – Allows you to view the video while working in Anark Studio. The Remote Source must also be

specified. If no Remote Source is given or if Connect to Source is not turned on (checked) then the model may be displayed with a rainbow pattern on it instead of the video. If Connect to Source is checked but the connection fails for some reason, then a transparent image is used that makes the object transparent.

Setting properties for soundSound objects in Anark Studio encapsu-late an audio clip. Anark Studio currently supports .wav, .ogg and .aiff/.aif files, which must first be created in other applications. You can then import them into the Library palette as resources using the instructions in “Importing objects” on page 51.

For a complete list of supported sound formats, see “Supported Media Formats” on page 305.

Sound – Displays the current name of the Sound. For information about renaming objects, see “Renaming objects” on page 63.

Basic PropertiesSound Type – Sets whether the sound will be Normal, Polyphonic or Point.

Normal – A Normal sound is played at the specified Volume and Balance set-tings.

Anark_Studio_User_Guide.book Page 114 Monday, March 19, 2007 10:34 AM

Page 123: Anark Studio4 User Guide

User Reference 115

Setting properties for music

Polyphonic – A Polyphonic sound can be played multiple times simulta-neously. This feature would most typi-cally be used with a behavior that calls on the sound based on user actions such as clicking on a button. For exam-ple, if the user clicked a button several times in a row, the sound would be played over itself each time.

Volume – Adjusts the loudness of the sound. Range = 0 to 100. Defaults to 100, which is 90% of the loudest setting enabled on the end user’s system.

Balance – Adjusts the left-to-right balance of the sound. Range = -100 (full left) to 100 (full right). Default = 0. This setting is not available for Point sounds.

Loop – Sets whether the sound will continuously loop. Defaults to off (unchecked).

Auto Start – Sets whether the sound will automatically start playing when it first appears in the Timeline. If Play Sound is off (unchecked), you can set the sound to play based on a scripted behavior. Defaults to on (checked).

Advanced Properties

Cue – Specifies a point within the sound to begin playing. This is only valid the first time the sound is played, so if the sound is looping it will play from the beginning after the first time.

Setting properties for musicMusic objects in Anark Studio encapsu-late a specific music recording. Digital music files must first be created in other applications. You can then import them into the Library palette as resources

using the instructions in “Importing objects” on page 51.

For a complete list of supported music formats, see “Supported Media Formats” on page 305.

Music is streamed remotely rather than embedded with the file data when it’s imported into Anark Studio. See “Chapter 8: Working with Streaming Media and Dynamic Images” on page 165 for more information.

Music Name – Displays the current name of the Music. For information about renaming objects, see “Renaming objects” on page 63.

Basic PropertiesVolume – Adjusts the loudness of the music. Range = 0 to 100. Defaults to 100, which is 100% of the loudest setting enabled on the end user’s system.

Balance – Adjusts the left-to-right balance of the music. Range = -100 (full left) to 100 (full right). Default = 0.

Loop – Sets whether the music will continuously loop for the duration of its timebar. Defaults to off (unchecked).

Auto Start – Sets whether the music will automatically start playing when it first appears in the Timeline. If Auto Start is off (unchecked), you can set the music to play based on a scripted behavior. Defaults to on (checked).

Anark_Studio_User_Guide.book Page 115 Monday, March 19, 2007 10:34 AM

Page 124: Anark Studio4 User Guide

116 Anark Studio User Guide

Chapter 5Setting Object Properties

Advanced Properties

Cue – Specifies a location within the music to begin playing. This is only valid the first time the sound is played, so if the sound is looping it will play from the beginning after the first time.

Shared Properties

The following properties of music are only available for resources in the Library. These settings are automatically applied to all instances of the music. If more than one resource of the same music file has been imported into the Library, then these settings are applied to all of them.

Remote Source – Specifies either the URL of the streaming audio file or the fully qualified absolute or relative path to it. The relative path must be preceded by ./ to indicate the current directory (or ../ to go up one directory level, etc.). See “Chapter 8: Working with Streaming Media and Dynamic Images” on page 165 for more information.

Setting color propertiesAll color properties of objects in Anark Studio (such as the background color of layers and the diffuse, ambient and spec-ular colors of materials) are selected using a color chooser. The standard Windows color chooser allows you to either select a color from a preset group or to create a custom color.

The Windows color chooser uses the RGB color model, which adjusts the mix of red, green and blue to define a color. This is additive color mixing and repre-sents the way colored light (such as that on computer monitors) is mixed.

It also supports the HSL model. They stand for Hue, Saturation, and Luminosity.

Hue describes the color’s shade or tint. It is measured on a circular spectrum running from red to green to blue and returning to red.

Saturation controls the strength or purity of the color. It represents the amount of gray in proportion to the hue. It’s measured as a number from 0 (completely gray, no color) to 240 (fully saturated).

Luminosity refers to the relative light-ness or darkness of the color. It runs from 0 (black) to 240 (white).

To change a color property:On the Inspector palette, click on the color swatch next to the property. A Color chooser will appear. Either select a color from those available or create your own.

Setting properties for behaviorsBehavior scripts that can be run in Anark Studio are just XML (Extensible Markup Language) documents with a .bvs exten-sion. Every behavior can have a unique set of editable properties created for it using scripting and the Edit Custom Parameters dialog. You can then use the

Anark_Studio_User_Guide.book Page 116 Monday, March 19, 2007 10:34 AM

Page 125: Anark Studio4 User Guide

User Reference 117

Setting properties for components

Inspector palette to edit those properties just as you would for an object.

For information about creating editable parameters for behaviors, see “Working with custom properties” on page 76.

The ready-made behaviors available in the Anark Studio Behavior Library already have editable parameters for you to set. For information about using the Anark Studio Behavior Library, see “Accessing the Behavior Library” on page 27.

Shared Properties

The following property of behaviors is only available for resources in the Library. This setting is automatically applied to all instances of the behavior.

Script Type – Specifies the scripting language to be used. Anark Media can only execute JavaScript™, so unless you are developing an application that will not be played back using Anark’s scripting engine, this should always be set to the default of JavaScript.

JavaScript – JavaScript is an open, cross-platform scripting language for the Internet.

Lua – Lua is a free, light-weight pro-gramming language designed for extending applications.

Other – Allows you to specify the scripting language of your choice.

Note: If Script Type is set to Lua or Other, the script editor will not check or highlight the syntax of the script and the script will not be exe-cuted during playback.

Setting properties for componentsComponents, which are based on group objects, have all of the properties of regular groups. They also have several special properties. From the compo-nent’s parent’s Timeline, a component object’s regular group properties appear in the Inspector palette.

Group, Position, Rotation, Scale, Pivot and Opacity are the same for compo-nents as they are for regular groups. The Advanced properties Distance Fade, Fade Near and Fade Far are also the same for components. For information about these properties, see “Setting properties for groups” on page 95.

Anark_Studio_User_Guide.book Page 117 Monday, March 19, 2007 10:34 AM

Page 126: Anark Studio4 User Guide

118 Anark Studio User Guide

Chapter 5Setting Object Properties

When any of these properties are animated, the keyframes are evaluated in the parent Timeline, which would be either the Scene’s Timeline or, if it’s a nested component, the parent compo-nent’s Timeline.

The special component properties Play Mode, Playback Speed and Initial Play State appear in the Inspector palette only when you’re inside the component.

Slide – Displays the name of the current Slide. For information about renaming objects, see “Renaming objects” on page 63.

Playback Speed – Controls the speed at which the component’s Timeline is executed. This affects the speed of the animation for all the objects inside the component, including any animation created by a behavior that uses the contextTime property. A setting of 2 means animated objects will appear to move twice as fast as normal; a setting of .5 means they will appear to move half

as fast as normal, etc. A negative value (e.g., -.3, -2, etc.) makes the component’s Timeline run backwards. This setting does not affect the frame rate of the presentation or how often the scene is updated.

Initial Play State – Controls whether the component will initially play or be paused. Defaults to Play.

Play Mode – Controls how the compo-nent’s Timeline will be played back during this slide.

Stop at end – Sets the component’s Timeline to play through from begin-ning to end once.

Loop – Sets the component’s Timeline to play through from beginning to end continuously for the duration of the component.

Ping Pong – Sets the component’s Timeline to continuously play forward and then in reverse for the duration of the component.

Ping – Sets the component’s Timeline to play forward and back only once.

Play Through – Sets the component to play from beginning to end once and then continue onto the next slide.

Anark_Studio_User_Guide.book Page 118 Monday, March 19, 2007 10:34 AM

Page 127: Anark Studio4 User Guide

6

119

Chapter 6: Working with Actions, Slides and Components

Actions provide an easy way to apply commands to objects. They can be used to quickly create interactivity or to move between different slides in a presentation.

In addition to the Actions interface, you can also use scripting to write custom actions (i.e., behaviors) for objects. See “Chapter 4: Customizing and Extending Anark Studio” on page 71.

Slides represent segments of a presentation. They allow you to break up your project into chunks that can then be displayed in a variety of ways using actions. A Master slide works like a template and allows you to create objects that exist across all slides.

Components are encapsulated time-independent objects. They simplify the process of creating repetitive animation and interactive objects, such as buttons and menu systems, and make them easy to reuse and share.

Anark_Studio_User_Guide.book Page 119 Monday, March 19, 2007 10:34 AM

Page 128: Anark Studio4 User Guide

120 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

Understanding actionsAn action is simply an instruction for an object that is triggered by an event. The instruction can be to change a property value, to link to a Web page, to execute a chunk of code, to load a new slide, etc. The event can be based on system infor-mation such as when the object is attached to the scene, or it can be based on user interaction such as pressing a key or clicking the mouse.

Actions can be applied to any object in the scene (including the Scene object). For each action, there is a Trigger Object that will wait for an event and a Target Object that will perform the action.

When you set up an action, you first choose an object in the Timeline and then create an action for it on the Actions palette. The selected object can be the Trigger, the Target or both; or, it can be neither, acting as a router for the action between the Trigger and Target objects. The Trigger and Target objects can be the same object or completely different objects.

Creating and deleting actionsTo set up an action:1. In the Object outline or the Project

window, select an object.

2. On the Actions tab, click on the New Action button. The new action is added to the end of the list of actions for the object.

3. Select a Trigger Object. The Trigger Object can be the current object or any other object available in the pull-down menu. The Trigger Object will listen for the event to happen. See “Selecting a Trigger or Target object” on page 121 for information about which objects are available.

4. Select an Event. Only events that are valid for the Trigger Object can be selected. For a description of the available events, see “Selecting an event” on page 122.

5. Select a Target Object. The Target Object will perform the action. It can be the currently selected object or any other object available in the pull-down menu See “Selecting a Trigger or Target object” on page 121 for information about which objects are available.

6. Specify the Action to be performed. Only actions that are valid for the Target Object can be selected. Most actions have additional parameters that you will need to set. For a description of the available actions, see “Selecting an action” on page 125.

To delete an action:

Click on the Trash button ( ) at the bottom of the Action tab.

Anark_Studio_User_Guide.book Page 120 Monday, March 19, 2007 10:34 AM

Page 129: Anark Studio4 User Guide

User Reference 121

Understanding Action icons

Understanding Action icons

Action icons indicate whether an object or its children have any actions set for them. When the icon is blue, it means the action is on an object on the Master slide.

= This object has an action.

= A child of this object has an action.

= Both this object and one of its children have an action.

= Both this component and an object within it have an action.

= There is an action within this compo-nent.

Selecting a Trigger or Target objectWhen you create an action, you start by selecting an object. This object can be the Target, the Trigger or both, or it can

act as a “conduit” and be neither. Because slides and components encapsu-late different Timelines, only objects that are likely to be around at the same time as the selected object are available in the Trigger or Target object pull-down. If your presentation has many components or has more than one slide, this means that only the following objects will be available:

Objects on the master slide and on the selected object’s current slide.

If a component is on the current slide, then any objects that are on the component’s master slide.

If the action is on an object inside a component, then objects that are on the master slide of the Scene (or the parent component if it is nested).

If the selected object is on the master slide, then only objects on the master slide (or on the master slide of any master components).

Anark_Studio_User_Guide.book Page 121 Monday, March 19, 2007 10:34 AM

Page 130: Anark Studio4 User Guide

122 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

Specifying paths for Trigger and Target objectsWhen you select a Trigger or Target object for an action, you have the option of using either an Absolute or Relative Reference to the object.

The object selection box lets you use either a relative or absolute reference to the object.

An Absolute Reference locates the object using a direct reference to it. If the object is moved around in the scene, the Abso-lute Reference will be updated to object’s new location. Use the absolute path when you may be rearranging items or actions in your scene, and want the action to always point to the original object, no matter where it ends up in the scene.

A Path Reference locates the object using a hierarchical (DOM-based) path. By default, the displayed Path property will be the relative path specified by walking up the levels of the hierarchy using the parent property of objects. You can also specify a root-level path. Use the Path reference when you want to reuse an object like a component with another object, or wish to move the action to another object and have the object that the action refers to automatically change.

When a component is exported, any references set to Absolute Reference are exported as root-level paths.

When a Playback Module is exported, any references set to Absolute Reference are exported as relative paths.

For information about setting up an action, see “Creating and deleting actions” on page 120.

Selecting an eventAn event is a pre-defined occurrence that happens during playback. Events are used to trigger actions in a presentation. For example, you can use a mouse event to begin an animation sequence, or you can use a key event to pause the presentation.

There are several different types of built-in events. In addition, Time Labels applied to points in the Timeline can be used as events. For more information about Time Labels, see .

The list of available events is determined by the type of object selected as the Trigger Object.

The event selection box lets you choose from a list of events that are available for the Trigger object for an action.

For information about setting up an action, see “Creating and deleting actions” on page 120.

Anark_Studio_User_Guide.book Page 122 Monday, March 19, 2007 10:34 AM

Page 131: Anark Studio4 User Guide

User Reference 123

Selecting an event

In addition to the following list of avail-able events, you can write custom events for a behavior and expose it to the Anark Studio interface using the instructions in “Working with custom events” on page 79.

Attach eventsonAttach – This event is fired when the Trigger object is attached to the scene. Attachment corresponds to the moment when the object’s timebar starts.

onDetach – This event is fired when when the Trigger object is detached from the scene. Detachment corresponds to the moment when the object’s timebar ends.

Key eventsonKeyDown – This event is fired when any key is pressed.

onKeyUp – This event is fired when any key is released.

Loading eventsonLoadProgress – This event is fired continuously as a Playback Module is loading. For more information about loading Playback Modules, see “Loading components dynamically” on page 132.

onLoadError – This event is triggered when a Playback Module cannot prop-erly load. For more information about loading a Playback Module, see “Loading components dynamically” on page 132.

onLoadComplete – This event is triggered when a Playback Module has finished loading. For more information about loading a Playback Module, see “Loading components dynamically” on page 132.

Anark_Studio_User_Guide.book Page 123 Monday, March 19, 2007 10:34 AM

Page 132: Anark Studio4 User Guide

124 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

Mouse eventsonMouseDown – This event is fired when the left mouse button is pressed while over the Trigger object.

onMouseUp – This event is fired when the mouse button is released while over the Trigger object.

onGroupedMouseOver – This event is fired when the mouse moves over the Trigger object exclusively. Unlike the onMouseOver event, this will not be fired if the mouse moves from one child to another child of the Trigger object. For example, if the Trigger object is a group that contains a number of models, if the mouse moves off one of the models onto another of the models, onGroupedMouseOver will not be called.

onGroupedMouseOut – This event is fired when the mouse moves off the Trigger object exclusively. This will not be fired if the mouse moves from one child to another child of the Trigger object. For example, if the Trigger object is a group that contains a number of models, if the mouse moves off one of the models onto another of the models, onGroupedMou-seOut will not be called.

onMouseClick – This event is fired when the mouse button is both pressed and released while over the Trigger object.

onMouseDblClick – This event is fired when the mouse button is double-clicked while over the Trigger object.

onMouseWheel – This event is fired when the mouse wheel is turned (spun) while over the Trigger object.

onRightMouseDown – This event is fired when the right mouse button is pressed while over the Trigger object.

onRightMouseUp – This event is fired when the right mouse button is released while over the Trigger object.

onRightMouseClick – This event is fired when the right mouse button is both pressed and released while over the Trigger object.

onMiddleMouseDown – This event is fired when the middle mouse button is pressed while over the Trigger object.

onMiddleMouseUp – This event is fired when the middle mouse button is released while over the Trigger object.

onMiddleMouseClick – This event is fired when the middle mouse button is both pressed and released while over the Trigger object.

Time eventsonPlay – This event is triggered when the presentation or component begins playing.

onPause – This event is triggered when the presentation or component has been paused.

onLoop – This event is triggered when the presentation or component begins another loop of playback.

Update eventsonUpdate – This event is triggered every time the scene is refreshed. The scene is updated a maximum of 30 times per second on fast machines; on slower machines the refresh rate may be lower. objects or children.

Media eventsonMediaBuffered – This event is fired when the Trigger object, which is either a music or video file, has loaded enough information to make it ready to play, but is not yet completed.

Anark_Studio_User_Guide.book Page 124 Monday, March 19, 2007 10:34 AM

Page 133: Anark Studio4 User Guide

User Reference 125

Selecting an action

onMediaComplete – This event is fired when the Trigger object, which is a music or video file, has finished playing.

onMediaError – This event is fired when the Trigger object, which is either a music or video file, cannot properly load.

Selecting an actionAn object can perform an action itself, it can tell another object to do something, or it can tell the system to do something.

The list of available actions is deter-mined by the type of object selected as the Target Object.

Action Additional parameters Can be applied to

Set Property – Sets a property of the Target object to a specified value.

Any object property can be set here. For a complete listing of the available properties for each object type, see “Chapter 5: Setting Object Properties” on page 81. Setting the Value Type to From Another Property allows you to dynamically match the specified prop-erty of the Target object to the value of a different object property. For more information, see “Dynamically match-ing a property value using an action” on page 131.

Model Group Component Image Material Scene Behavior Layer Text Light/Camera Video Music Sound

Load – Loads a specified Playback Module. The content of the loaded .am file will only appear in the spec-ified Slide.Loading Anark Playback Modules requires a valid license key. Please contact your Anark sales representa-tive for licensing information.For information about creating Play-back Modules, see “Exporting and importing components” on page 60.

Slide - Sets the slide that the loaded .am file will appear in. If playback exits the slide and then goes back to it at some point, the specified section would have to be loaded again in order to appear. URI - The URI (Uniform Resource Identifier) for the .am file. URI is the generic term for all types of names and addresses that refer to objects on the World Wide Web. A URL is one kind of URI. Relative paths can be used. See “Loading components dynamically” on page 132 for more information.Do not share buffer data - When checked, specifies that the heavy buffer data from the Playback Module being loaded will not be shared. To optimize memory usage, it is generally recommended that this be left unchecked.

Model Group Component Image Material Behavior Layer Text Light/Camera Video Music Sound

Anark_Studio_User_Guide.book Page 125 Monday, March 19, 2007 10:34 AM

Page 134: Anark Studio4 User Guide

126 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

Detach – Detaches the Target object from the scene.

Note: The Scene object cannot be detached.

n/a Model Group Component Image Material Behavior Layer Text Light/Camera Video Music Sound

Fire Event – Enables any object to fire an event based on another event. This action would typically be used to fire a custom event on a behavior as part of an action.

Event – Specifies the event to be fired. Model Group Component Image Material Scene Behavior Layer Text Light/Camera Video Music Sound

Alert – Displays a message box con-taining the Description text and an OK button.

Description – Sets the text string to be displayed when the alert is called.

Model Group Component Image Material Scene Behavior Layer Text Light/Camera Video Music Sound

Action Additional parameters Can be applied to

Anark_Studio_User_Guide.book Page 126 Monday, March 19, 2007 10:34 AM

Page 135: Anark Studio4 User Guide

User Reference 127

Selecting an action

Output – Sends the Description text to the debug console in Windows. It’s useful when debugging an Anark Media presentation. To view the output in Windows, you need to run either a development applica-tion or a debugging application such as Sysinternals’ DebugView© freeware (available at http://www.sysinternals.com).

Description – Sets the text string to be displayed in the debug console.

Model Group Component Image Material Scene Behavior Layer Text Light/Camera Video Music Sound

Beep – Causes a beep to sound. n/a Model Group Component Image Material Scene Behavior Layer Text Light/Camera Video Music Sound

External Command – Provides a way for an Anark Media presenta-tion to communicate with the browser. This action is only avail-able on Windows.The specified Command and Value text is passed to the HTML script, where the strings must be defined using the onExternalCommand HTML event. Please note, the internal and the external commands are disabled unless you possess a valid license key. Please contact your Anark sales representative for licensing informa-tion.

Command – Sets the command text string to be passed to the HTML script. Value – Sets the value text string to be passed to the HTML script.

Model Group Component Image Material Scene Behavior Layer Text Light/Camera Video Music Sound

Action Additional parameters Can be applied to

Anark_Studio_User_Guide.book Page 127 Monday, March 19, 2007 10:34 AM

Page 136: Anark Studio4 User Guide

128 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

Navigate – Navigates to the speci-fied URL. You can optionally set Flags and a Target frame.

URL – Sets the URL, fully qualified path or UNC (Universal Naming Con-vention) location of the resource to display.TargetFrame – Windows only. Speci-fies the name of an HTML frame in which to display the resource or file. If the named frame is not currently avail-able, the document opens in a new window.PostData – Windows only. Specifies data to send to the server during the HTTP POST transaction. For example, the POST transaction is used to send data gathered by an HTML form to a program or script. If this parameter does not specify any post data, the Navigate action issues an HTTP GET transaction. This parameter is ignored if the URL is not an HTTP URL.Headers – Windows only. Specifies additional HTTP headers to send to the server. These headers are added to the default Internet Explorer headers. The headers can specify things like the action required of the server, the type of data being passed to the server, or a static code. Multiple headers can be specified, separated by a semicolon (;). This parameter is ignored if the URL is not an HTTP URL.

Model Group Component Image Material Scene Behavior Layer Text Light/Camera Video Music Sound

Action Additional parameters Can be applied to

Anark_Studio_User_Guide.book Page 128 Monday, March 19, 2007 10:34 AM

Page 137: Anark Studio4 User Guide

User Reference 129

Selecting an action

Execute Scriptlet – Specifies a small snippet of code to be executed.

Scriptlet – Clicking on this property opens a small scripting window that allows you to enter a brief script.This can be used to create a simple cus-tomized behavior for an object. For example, the following code, if applied to a rectangle or cube as part of an onLoadProgress event, could be used to create a loading progress bar:scale.x = latestEvent.per-centDone * 3

This action can also be used to modify an onLoadProgress event. For example, the following code could be used as a Scriptlet to modify a key event so that the code would only be executed when the Up key was pressed:if(latestEvent.keyCode = up)

position.x =+1

When in a Scriptlet, the this keyword refers to the Target object that is exe-cuting the action. In addition, parent refers to the parent of the object that is executing the action.

Model Group Component Image Material Scene Behavior Layer Text Light/Camera Video Music Sound

Go to Time – Jumps playback to the specified Time.

Pause – Controls whether playback should continue or pause. Time – Sets the time in the current time context to which to jump. Go to Time can only jump to another time in the current slide.

Components Scene

Play – Makes the presentation, com-ponent or media file play. It won’t have any effect unless the item was paused.

n/a Component Scene Video Music Sound

Pause – Makes the presentation, component or media file pause. It won’t have any effect unless the item was currently playing.

n/a Component Scene Video Music Sound

Action Additional parameters Can be applied to

Anark_Studio_User_Guide.book Page 129 Monday, March 19, 2007 10:34 AM

Page 138: Anark Studio4 User Guide

130 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

Making actions active and inactiveThe Active toggle ( ) next to each action allows you to make the action inactive or to reactivate it. This is partic-ularly useful for controlling whether or not an action will be active for all instances of an object on the Master slide. See “About Master slides” on page 134 for more information.

Copying and pasting actionsActions can be copied or cut from one object and then pasted onto another object, or even the same object. Because actions are executed in the order they

are listed in, you can use copy/paste to reorder them when needed. Pasted actions are added to the end of the Actions list.

While any action can be pasted onto any object, the action will only be valid under the following circumstances:

The Trigger and Target objects must be active at the same time as the object that now has the action.

The path to the Trigger and Target objects from the current object must still be valid. See “Specifying paths for Trigger and Target objects” on page 122 for more information.

Seek – Repositions a media file (video, sound or music) to a speci-fied location and continues playing. If the media is currently stopped or paused, it is repositioned to the loca-tion but doesn’t begin playing until set to play again. This only works with high quality, low compression formats; high compression formats such as MPEG-4 and .wmv do not support seeking.

Seek Time – Specifies the time in the media file, in seconds, to which to seek.

Video Music Sound

Reverse Play – Makes the presenta-tion or component begin playing in reverse.

n/a Component Scene

Go to Label – Jumps playback to the specified Time Label. Go to Label can only jump to a Time Label in the current slide. See for more infor-mation.

Time Label – Selects the Time Label to which to jump playback.

Component Scene

Go to Slide – Jumps playback to the specified slide.

Slide – Selects the slide to which to jump playback from among the Target Scene or component’s slides.

Component Scene

Next Slide – Jumps playback to the next slide.

n/a Component Scene

Previous Slide – Jumps playback to the previous slide in the presenta-tion’s slide list.

n/a Component Scene

Preceding Slide – Jumps playback to the last viewed slide.

n/a Component Scene

Action Additional parameters Can be applied to

Anark_Studio_User_Guide.book Page 130 Monday, March 19, 2007 10:34 AM

Page 139: Anark Studio4 User Guide

User Reference 131

Dynamically matching a property value using an action

To copy or cut and paste an action:1. Select an action in the Actions pal-

ette.

2. Do one of the following:

• Copy the action by selecting Edit > Copy Action or pressing Ctrl + C.

• Cut the action by selecting Edit > Cut Action or pressing Ctrl + X.

3. Select the object to paste the action on.

4. Do one of the following:

• Select Edit > Paste Action or press Ctrl + V.

• Right-click in the Actions palette for the item in the Object outline and select Paste Object from the Context menu.

The pasted action is added to the end of the list of actions for the object.

Dynamically matching a property value using an actionWhen you create a Set Property action, you have the option of selecting a Value Type. The default is to set a specific value, which is appropriate for most situ-ations. Under certain circumstances, however, you may want to use the From Another Property option. The From Another Property value allows you to match the property of the Target object to the current value of a different object’s property.

Among other things, this can be used to dynamically draw values from the custom properties of a behavior, to synchronize the movement of objects, or to quickly align one or more objects based on user interaction.

Only similar property types can be selected. For example, if you want to set a vector property such as Position for the

Target object, you can match it to any other vector property (Scale, Position, Pivot, etc.). Similarly, if you want to set the Brightness property of a light, you can match it to any other floating-point property, including Emissive Power or Opacity.

Working with time labelsA Time Label is a marker for a particular point in time in the presentation. They can be applied to either the Scene or to a component object, although they cannot be added to the Master slide. Time Labels can be used in actions in two ways.

They can be used as a time marker in a Go to Label action. During playback, the specified event will cause the presentation to jump to the Time Label.

They can be used as an event that executes some other kind of action.

To insert a new Time Label:1. Select the Scene or a component in

the Object outline. To insert a Time Label on a component, you must be inside the component’s Timeline. For more information, see “How the Scene and component Timelines work” on page 138.

2. Move the Playhead to the location on the Timeline where you want to place the Time Label.

3. In the Time Pane, right-click on the Timeline bar for the Scene or compo-nent and select Insert Time Label from the Context menu.

The Time Label will be added at the current location of the Playhead.

Anark_Studio_User_Guide.book Page 131 Monday, March 19, 2007 10:34 AM

Page 140: Anark Studio4 User Guide

132 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

To rename a Time Label:1. Double-click on the Time Label’s

name in the Time pane and enter a new name for it.

2. Press Enter.

To edit a Time Label:Right-click on the Time Label and select Edit Time Label from the Context menu.

To delete a Time Label:Right-click on the Time Label and select Delete from the Context menu.

Creating a Go to Label actionThe Go to Label action is only available when the Scene object or a component has been selected as the Target object. Any available object can be used as the Trigger object. For more information about setting up Time Labels, see “Working with time labels” on page 131.

To set up a Go to Label action:1. Select an object in the Object outline.

2. On the Actions tab, click on the New Action button.

3. Select a Trigger Object that will listen for an event.

4. Select an Event. For a description of the available events, see “Selecting an event” on page 122.

5. Select the Scene or a component as the Target Object. If you are setting up a Go to Label action for a compo-nent, you must be inside the compo-nent Timeline.

6. From the Actions pull-down menu, select Go to Label.

7. Select a Time Label. You can option-ally set the Scene or component to pause.

Using a Time Label as an eventTime Labels can be used as events for actions. When the Playhead reaches the given Time Label during playback, the event is fired and the specified action is executed.

Because time labels are applied to the scene, you must select the Scene or the component as the Trigger object.

To set up a Time Label event for an action:1. Select an object in the Object outline.

2. On the Actions tab, click on the New Action button.

3. Select the Scene or component in the Object outline as the Trigger Object. If you are setting up a Time Label event for a component, you must be inside the component Timeline.

4. From the Event pull-down menu, select a time label from the Time Labels folder.

5. Select a Target Object.

6. Specify the action to be performed. Most actions have additional param-eters that you will need to set. For a description of the available actions, see “Selecting an action” on page 125.

Loading components dynamicallyComponents that have been exported as Playback Modules can be dynamically loaded using the Load action. This enables you to create small, modular presentations that open quickly. You can then load only the objects that are needed for a particular slide.

Note: Loading Anark Playback Mod-ules requires a valid license key. Please contact your Anark sales rep-

Anark_Studio_User_Guide.book Page 132 Monday, March 19, 2007 10:34 AM

Page 141: Anark Studio4 User Guide

User Reference 133

Understanding slides

resentative for licensing informa-tion.

The parent object to which the Playback Module is attached determines several important features of the Playback Module:

The duration of the Playback Module is the same as the duration of its parent.

If the parent is on a Master slide, then the Playback Module is also treated as being on the same Master, and its properties are linked across all slides.

If the parent is not on a Master slide then the Playback Module is treated as being on the current slide only.

First, a component must be exported as a Playback Module (.am) file using the instructions in “Exporting and importing components” on page 60.

To set up a Load action:1. Select an object in the Object outline.

2. On the Actions tab, click on the New Action button.

3. Select a Trigger Object that will listen for an event.

4. Select an Event. For a description of the available events, see “Selecting an event” on page 122.

5. Select a Target Object. This is the object to which you want the loaded component attached. Typically, com-ponents would be attached to either a layer or to other models, although they can also be attached to cameras, lights and sounds.

6. From the Action pull-down menu, select Load.

7. Specify a URI (Uniform Resource Identifier) for the .am file. URI is the generic term for all types of names

and addresses that refer to objects on the World Wide Web. A URL is one kind of URI. Relative paths can be used.

Understanding slides

Slides are used to encapsulate segments of a presentation. The Scene object and components have an associated list of slides displayed in the Slide palette.

Slides provide the clock that controls the timing of actions for the objects in the scene or component. This clock is repre-sented by the Timeline. Each time a new frame is generated, the objects in the scene or component ask the clock “what time is it?” and then determine what state they need to be in based in part on that information.

When a new slide is loaded, it has a different Timeline. It may contain a completely different set of objects, or it may contain some or all of the same objects that were in the last slide. Even if the objects are the same, they may have a completely different way of behaving because they now have a different Timeline.

The Timeline and Project window only display the content of the currently

Anark_Studio_User_Guide.book Page 133 Monday, March 19, 2007 10:34 AM

Page 142: Anark Studio4 User Guide

134 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

active slide. When you add objects by dragging them onto either the Project window or the Timeline, they are added to the currently active slide. If you are working on the Master slide, the object is added to all the slides in the project, as well.

To move from slide to slide during play-back, you must either set up an action using one of the Slides actions (Activate, Next, Previous or Preceding) or set the scene or component’s Play Mode to Play Through. For information about setting the Play Mode for the scene or compo-nent, see “Setting properties for the scene or slide” on page 83.

The duration of each slide can be as long or as short as you want it to be. Each slide’s duration is determined based on the length of the timebars of the objects that are in it.

Adding slidesWhen a project is first created, only one slide appears on the Slide tab. You can create an unlimited number of slides. When you create a new slide by adding one, it contains all of the objects, properties, animation and actions that are on the Master slide. See “About Master slides” on page 134 for more information.

To add a new slide:Right-click on any slide and select Add Slide from the Context menu.

Deleting slidesBecause only one slide can be selected at a time, you can delete only one slide at a time.

To delete a slide:Right-click on a slide and select Delete Slide from the Context menu.

Rearranging slidesThe order of slides in the Slide list deter-mines which slide is displayed when the presentation begins playing and which slide is displayed when using a Next Slide or Previous Slide action.

To rearrange slides:Click and drag a slide to the desired loca-tion on the Slide tab.

Duplicating slidesIn order to copy a slide and all of its contents, you simply duplicate it.

To duplicate a slide:1. Select a slide.

2. Right-click and choose Duplicate Slide from the Context menu.

The new slide will be placed immedi-ately after the original slide. You can then rearrange the slide wherever you like using the instructions in “Rear-ranging slides” on page 134.

About Master slidesThe Master slide lets you share objects and properties across all associated slides. It’s particularly useful for objects like streaming music or video that you want to continuously play between slides, and for objects used to navigate between slides.

When an object is on the Master slide, by default all of its properties and animation keyframes are linked to the instances of the object in the regular slides. Object properties that are linked across slides appear in blue. You can unlink any properties that need to func-tion independently.

While you must edit the Master slide in order to add objects to it, once an object is on the Master slide, you can edit it on

Anark_Studio_User_Guide.book Page 134 Monday, March 19, 2007 10:34 AM

Page 143: Anark Studio4 User Guide

User Reference 135

Accessing and exiting the Master slide

any other slide and the changes are made to all instances on all other slides.

Important: Just as edits to Master objects are made to the object on all other slides, deleting a Master object on any slide will delete it from all slides.

The Scene or component starts off with one Master slide and a default regular slide. You can then add as many regular slides as you want, but there can only be one Master slide for each component or for the Scene object.

The Master slide starts off with a default layer, camera and light. When you want an object to appear on all or most slides, or when you want to share an object’s properties across slides, you should add it to the Master slide. You can deactivate the object on any slide on which you don’t want it to appear using the instruc-tions in “Using the Active toggle and button” on page 64.

Accessing and exiting the Master slideIn order to add objects or otherwise edit the Master slide, you must open it for editing.

To access the Master slide:

Click on the Edit Master button on the Slide tab. Only the contents of the Master slide will appear in the Timeline and Project window.

To exit the Master slide:

Click on the Leave Master button on the Slide tab. The most recently viewed slide will be active and its contents will be displayed in the Timeline and Project window.

Linking and unlinking propertiesBy default, the properties of an object on the Master Slide are linked to the instances of that object on all slides in the project. Animation keyframes for objects on the Master Slide are also linked across all instances. Changes to one instance of the same object are made simultaneously to the other instances in other slides.

If you want a property on an object on the Master Slide to function indepen-dently, you need to manually unlink it using the Inspector. You can re-link it later.

There are several properties of objects that are never linked.

The length of an object’s timebar.

The state of its Active toggle.

The Playback Speed, Initial Play State and Play Mode properties of the Scene and components.

When an object property is linked to the Master slide, it appears in blue.

Anark_Studio_User_Guide.book Page 135 Monday, March 19, 2007 10:34 AM

Page 144: Anark Studio4 User Guide

136 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

For more information about working with objects and properties on the Master Slide, see “Understanding slides” on page 133.

When properties are linked, they appear in blue. Unlinked properties are in black.

To unlink a property:1. Select the object using the instruc-

tions in “Selecting objects” on page 61.

2. In the Inspector, right-click on the object property you want to unlink and select Unlink Property from Mas-ter Slide from the Context menu.

To link a property across slides:1. Select the object using the instruc-

tions in “Selecting objects” on page 61.

2. In the Inspector, right-click on the object property you want to link and select Link Property to Master Slide from the Context menu.

How objects are copied between slidesCopying and duplicating objects only affects the current slide. For example, if an object that happens to be on the Master slide is copied to a regular slide, it will only be copied to the regular slide.

When an object is copied between slides, all of its children, properties, animation

and actions are copied to the slide as well. There is one exception to this rule, however. If an object that is on the Master slide contains objects that are not on the Master slide, and the object is copied or duplicated on the Master, then only the master object is copied.

When copying an object to the Master slide, only “master” objects are copied. For exam-ple, the Cone object is not on the Master slide and is therefore not copied on either the Master slide or on a regular slide.

See “About Master slides” on page 134 for more information.

How objects are attached between slidesWhile objects that are not on the Master slide can be attached to objects that are, the reverse is not true. In order to main-tain the object hierarchy between slides, an object on the Master slide cannot be attached to an object that is not on the Master slide.

Using componentsComponents are encapsulated time-independent objects. They can be thought of as miniature scenes within a scene. Components simplify the process of creating repetitive animation and interactive objects, such as buttons and

Anark_Studio_User_Guide.book Page 136 Monday, March 19, 2007 10:34 AM

Page 145: Anark Studio4 User Guide

User Reference 137

Using components

menu systems, and make them easy to reuse and share.

Components provide a group of one or more objects with an independent clock (or multiple clocks if new slides are added), allowing them to operate in more than one Timeline at the same time. When an object is made into a component, the Component object still has a timebar in the current Timeline. The objects that belong to the compo-nent have their own timebars that exist in the component’s independent Time-line, which can be accessed by going inside the component.

Components can be nested inside other components. Because components func-tion just like miniature scenes, they have one or more associated slides.

The Butterfly component contains the wings and body. The flapping of the wings has been animated in the component’s local time and can be looped continuously.

An example of using a component to easily create repetitive animation is a butterfly fluttering around on the screen. You could create a group that contained a model of a butterfly and set a couple of keyframes for the wings to animate them flapping. If you then make the butterfly group into a compo-nent and set the component’s Play Mode to Loop, the wings will continuously flap. In the Scene’s Timeline, you could then animate the component group moving around in the scene. When the presentation is previewed, the butterfly will flap its wings as it flutters around the screen.

For more information about Timelines, see “How the Scene and component Timelines work” on page 138. For more information about slides, see “Under-standing slides” on page 133.

Anark_Studio_User_Guide.book Page 137 Monday, March 19, 2007 10:34 AM

Page 146: Anark Studio4 User Guide

138 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

Anark Media Component (.amc) files can be imported into a project using the instructions in “Exporting and importing components” on page 60.

To create a component from an item in the Object outline:1. Right-click on an object in the Object

outline. Groups, models, sounds, lights, cameras, music and text objects can be made into compo-nents.

2. Select Make Component from the Context menu.

The object and any attached children are now encapsulated within the compo-nent group and are automatically placed on the Master slide inside the Compo-nent’s Timeline.

Note: Only music and sound objects that are not attached directly to the Scene object can be turned into Components.

To edit a component, do one of the following:

Double-click on the component in the Object outline.

Right-click on the component in the Object outline and select Edit Compo-nent from the Context menu.

To exit a component:Click on the icon of the Scene or desired Component or Scene in the Bread-crumbs bar.

How the Scene and component Timelines work

The Scene’s Timeline (top) and the compo-nent’s Timeline (bottom).

The Scene’s Timeline displays all the objects that are attached to the scene and its children. While it shows the timebars of components, it does not display the timebars of the objects that are inside a component. Each Compo-nent object’s Timeline displays the time-bars of the objects inside that component.

The currently active Timeline deter-mines what objects are visible, what new objects will be added or attached to, what can be selected and what anima-tion will be viewable in the Project window.

Only the objects belonging to the active Timeline can be selected, even though other objects in other Time-lines may be visible in the Project window.

In the Scene or parent Timeline, a component object as a whole can be selected, but not the individual objects within it.

Anark_Studio_User_Guide.book Page 138 Monday, March 19, 2007 10:34 AM

Page 147: Anark Studio4 User Guide

User Reference 139

Playback in different Timelines

When you go into a different Timeline, the current location of the Playhead determines what objects in other Time-lines will be visible in the Project window. For example, if the Playhead is currently at 4 seconds, but several objects in the Scene Timeline don’t begin their duration until 5 seconds, those objects will not be visible in the Project window when you go into the Component Timeline.

Playback in different TimelinesWhen you play a project using the Play button ( ), the animation from the active slide will be executed, but not the animation in any components.

When you drag the Playhead along the time measure (called scrubbing), only the animation for the currently active Timeline is executed.

When you preview using the F12 key, all the animation from the active slide will be executed, including any components.

Working with slides, components and breadcrumbsBoth slides and components provide Timelines for objects, but it’s important to understand the distinctions between them.

Components allow objects to exist in more than one Timeline at the same time. Using the example of a butterfly, the wings can continuously flap in the component time context while the butterfly as a whole moves around the screen in the parent time context.

Inside each component, there is at least one slide. Slides encapsulate a set of states for the objects in either the Scene or a component. The state of an object

includes its duration, its property settings, and any associated actions and animation. The butterfly component might contain two slides: flapping and resting.

Components can be nested inside other components, making Timelines hierar-chical. In addition, multiple slides mean that Timelines can also operate in parallel, making them branched. As you create components and slides in Anark Studio, the Breadcrumbs bar indicates your current location among the different Timelines and helps you navi-gate through them. The current slide is shown in parentheses.

The Breadcrumbs bar lets you navigate out of components. The Table of Contents com-ponent contains two slides, Active and Inac-tive, and the Open-Close Button component contains two slides, Over and Idle.

Understanding the duration of componentsBecause components are encapsulated “mini-scenes,” their duration is deter-mined a little differently than that of the other objects in the scene.

A component has a timebar in the Scene’s Timeline (or its parent’s Timeline if it’s a nested component). This timebar determines when the component is active within its parent’s Timeline, just as it does for any other object.

However, the component object does not have a timebar in the Component Timeline. The timebars of the objects inside the component determine how long the component actually lasts.

Anark_Studio_User_Guide.book Page 139 Monday, March 19, 2007 10:34 AM

Page 148: Anark Studio4 User Guide

140 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

Specifically, the component begins at 0 seconds and lasts until the end of the timebar at the latest point on the time measure.

The Butterfly component is active in the scene for 4 seconds (top) while the content of the component lasts for one second (bot-tom).

This seems fairly simple until you consider that components are often used to create interactive elements like menu systems and could conceivably have a longer duration than the presentation itself. A component that is longer than the main presentation’s duration will be cut off at the end of the main presenta-tion, unless the Scene’s Timeline has been paused or it has been looped.

Adding and attaching objects to componentsThere is a difference between attaching an object to a component and adding an object so that it will share the compo-nent’s unique Timeline. The Timeline you are currently in controls which of these operations is done.

When working in the Scene’s Timeline, you can only attach objects to the component object; you cannot add

them so that they are inside the compo-nent. This means that you cannot move an object that is already in the Object outline into the component. Likewise, when working in the component’s Time-line, you can only add objects to the component. You can’t access anything that uses the parent Timeline.

To add an object to the component:1. Make sure you are in the compo-

nent’s Timeline.

2. Select an item in the Library or Stor-age palette or in a Windows Explorer window.

3. Do one of the following:

• Drag it onto the bar of the Compo-nent or an object inside the Compo-nent.

• Drag it onto the Project window. It will be attached to the Component object.

Copying objects in componentsCopying objects inside a component works much like copying other objects in the project. You can duplicate them using key commands and menu options, and by holding down the Ctrl or Command key and dragging them, as explained in “Copying and duplicating objects in the project” on page 58. Objects can also be copied from the Scene’s Timeline or the parent Timeline into a component and vice versa.

Anark_Studio_User_Guide.book Page 140 Monday, March 19, 2007 10:34 AM

Page 149: Anark Studio4 User Guide

User Reference 141

Copying objects in components

Anark_Studio_User_Guide.book Page 141 Monday, March 19, 2007 10:34 AM

Page 150: Anark Studio4 User Guide

142 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

Anark_Studio_User_Guide.book Page 142 Monday, March 19, 2007 10:34 AM

Page 151: Anark Studio4 User Guide

User Reference 143

Copying objects in components

Anark_Studio_User_Guide.book Page 143 Monday, March 19, 2007 10:34 AM

Page 152: Anark Studio4 User Guide

144 Anark Studio User Guide

Chapter 6Working with Actions, Slides and Components

Anark_Studio_User_Guide.book Page 144 Monday, March 19, 2007 10:34 AM

Page 153: Anark Studio4 User Guide

7

145

Chapter 7: Animating Objects

Every object in an Anark Studio project has certain proper-

ties that can be animated over time. The object’s built-in set of properties, such as Position, Scale and Opacity, appear on the Inspector tab when the object is selected.

When you are ready to start animating objects, you turn on the Animation toggle for the properties you want to animate to add them to the Timeline. You can then set animation keyframes for them.

In addition to keyframed animation, you can also write custom behaviors using scripting and create some editable parameters for them that can be animated as described in “Working with custom properties” on page 76.

Objects can be animated in relation to each other using groups and hierarchical attachments or they can be animated individually.

Anark_Studio_User_Guide.book Page 145 Monday, March 19, 2007 10:34 AM

Page 154: Anark Studio4 User Guide

146 Anark Studio User Guide

Chapter 7Animating Objects

Animation is created by setting different values for a property at different points in time. In Anark Studio, the values are set in the Inspector palette or items are dragged in the Project window to change the values. The Timeline tab is used to access those points in time of the presen-tation.

The points in time where the values are set are called keyframes. At least two keyframes are needed for a property to be animated. Anark Studio interpolates the change in the values between keyframes and generates the additional frames needed to create smooth anima-tion effects.

Note: Behavior scripts that operate on a property that has been ani-mated using keyframes may override those animation settings. See “How behaviors affect animation” on page 237 for more information.

Using the Animation toggle

When you are ready to start animating an object, the first step is to turn on the Animation toggle for any property you want to animate. When the animation toggle is turned on for a property, a keyframe is set for it at the current loca-

tion of the Playhead and the property is added to the Object outline.

Turning on the Animation toggle for a prop-erty adds the property to the Object outline and sets a keyframe.

You can turn on the toggle for a single property at a time or for all of an object’s properties at once by turning on the Master Animation toggle.

Turning on the Master Animation toggle for an object in the Inspector palette turns on the toggle for all of its properties and sets a keyframe for each.

When the Animation toggle is turned off for a property that has keyframes already set for it, the keyframe information is saved but inactive. When the Animation toggle is turned off for a property, any

Anark_Studio_User_Guide.book Page 146 Monday, March 19, 2007 10:34 AM

Page 155: Anark Studio4 User Guide

User Reference 147

Overview of the Time pane

changes made to its value affect only the default (i.e., static) settings of the object.

Tip: The Master Animation toggle for an object can be used together with the autokeyframing features to quickly enable animation and then set keyframes for all of an object’s properties as you make changes. For information about autokeyframing, see “Autokeyframing” on page 154.

Overview of the Time pane

A. Time measure – A scalable gauge of time for the project.

B. Timebar – Indicates the duration (or “lifetime”) of an object.

C. Keyframes – Used to animate objects.D. Scalable scroll bar – Both scrolls and

scales the Timeline.E. Playhead – Points to the current time

in the Project window. The Playhead also controls where keyframes are inserted.

Scaling the TimelineThe Timeline features a scalable scroll bar that allows you to expand or shrink

the amount of the Time measure visible in the palette.

Because you can change the scale of the Timeline to display just a short section of a presentation, the entire presenta-tion, or anything in between, the tick marks on the Time measure can repre-sent less than a hundredth of a second up to a whole minute or more.

To expand or contract the Time measure:Do one of the following:

Click and drag the start or end handle of the scroll bar until the desired section of the Time measure is in view.

Press the plus (+) or minus (-) key. Plus zooms in; minus zooms out.

Hold down the Ctrl key and roll the mouse wheel up or down.

The scalable scroll bar on the Timeline allows you to zoom in or out to control how much of the presentation is currently in view.

To return to the default display of the Time measure:Double-click on the scalable scroll bar.

Anark_Studio_User_Guide.book Page 147 Monday, March 19, 2007 10:34 AM

Page 156: Anark Studio4 User Guide

148 Anark Studio User Guide

Chapter 7Animating Objects

Using the timebarAll objects and behaviors (with the exception of the scene and materials) have a timebar that controls their start time and end time in the project. The timebar can be moved and resized to change the duration, start time and end time of the object or behavior.

To help you sort and keep track of different objects, the color of each timebar can be changed and comment text can be added. You can also display or hide start and end handles for timebars.

To select a timebar:Click on the timebar. Selecting a timebar selects the object as well.

To move a timebar:Click on the timebar to select it and drag the bar to the desired location in the Time pane. Holding down the Shift key as you drag enables snapping. The edges of the timebar will snap to the edges of other timebars and to the Playhead, but not to keyframes.

To display or hide timebar handles:1. Select any timebar.

2. Right-click and select either Show Timebar Handles or Hide Timebar Handles from the context menu.

Timebars with start and end handles dis-played (top) and hidden (bottom).

To change the color of a timebar:1. Do one of the following:

• Right-click on the timebar and select Change Timebar Color from the Context menu.

• Select Timeline > Change Timebar Color.

2. Select the desired color from the Color window or press the Define Custom Colors button to create your own colors.

3. Click OK.

To insert or edit comment text:1. Right-click on the timebar and select

Edit Comment Text from the Con-text menu. The cursor will move to the comment area of the timebar.

2. Enter the desired text.

3. Press Enter or click outside the time-bar.

Resizing timebarsWhen you resize a timebar, you are changing the duration of the object or behavior in the scene.

The end of the timebar of the last layer in the scene will set the duration of the final project. See “Duration of the project” on page 59 for more information.

Parent objects control several aspects of the duration of their children.

With the exception of layers, sounds and music, when an item is added to the project, its timebar is set to the same times as its parent’s timebar (holding down the Ctrl key overrides this, as described in “How the Ctrl key affects adding objects” on page 54). For details about how layers, sounds and music are handled, see “The duration

Anark_Studio_User_Guide.book Page 148 Monday, March 19, 2007 10:34 AM

Page 157: Anark Studio4 User Guide

User Reference 149

Resizing timebars

of added objects” on page 54.

If either edge of the parent timebar is aligned with the edges of its child objects, repositioning or resizing the parent’s timebar moves the children’s along with it. If the edges are not aligned, then moving the parent’s timebar will reposition the children’s timebar but it won’t resize it.

If the parent object’s timebar is made shorter than any of its child objects, the timebar of the child object will be grayed out where the parent object’s timebar ends. The child’s duration in the scene will be shortened according to its parent object.

A parent object with the same end time as its child objects (top); a parent object with a shortened end time that affects its child objects (bottom).

There are two ways to resize timebars:

Using the mouse to drag the timebar’s edges or handles.

Using the square bracket keys ([ and ]) on the keyboard.

To resize a timebar using the mouse:Click on the start or end of the object’s timebar and drag it to the desired loca-tion in the Time pane. Holding down the Shift key as you drag enables snap-ping. Timebar edges snap to other edges, to keyframes and to the Playhead.

Anark_Studio_User_Guide.book Page 149 Monday, March 19, 2007 10:34 AM

Page 158: Anark Studio4 User Guide

150 Anark Studio User Guide

Chapter 7Animating Objects

To resize a timebar using the keyboard:Press [ to move the start of a selected object’s timebar to the current location of the Playhead. All of the object’s chil-dren will move along with it, with two exceptions:

The timebars of locked objects are not moved.

The timebars of objects inside compo-nents are not moved.

Pressing Ctrl + [ will move the timebar of the selected object without affecting its children.

Press ] to move the end of a selected object’s timebar (and all of its children’s) to the current location of the Playhead. The same two exceptions noted above still apply.

Pressing Ctrl + ] will move the end of the selected object’s timebar alone.,

Note: When working on large projects with many objects, it’s a good idea to keep the duration of objects as short as possible in order to save memory and improve perfor-mance. However, you must be cau-tious when changing the duration of behaviors. Because the instruc-tions contained within a behavior are only executed during the behav-ior’s duration, shortening a behav-ior’s duration could create unexpected results. For example, if a behavior that makes a model glow during mouseovers is attached to a model, and you shorten the behav-ior’s timebar but not the model’s, then the model will stop glowing during mouseovers as soon as the behavior’s duration is over.

Working with cameras and the timebarOnly one camera can be active for a layer at a given time. This means that if there is more than one camera for a layer, their timebars should not overlap. If there is some overlap between time-bars, Anark Studio arbitrarily decides which one is active.

Only one camera can be active for a layer at a given time, so the timebars for cameras should not overlap.

In this example, the order for the active cameras is:

1. Zoom

2. Fog

3. Normal

Using the Playhead

A. Playhead handleB. Playhead lineThe Playhead marks the current time in the Project window, acts as the starting point for playback mode and controls the placement of keyframes.

Dragging the Playhead is one way of previewing the animation, as explained in “Scrubbing with the Playhead” on page 160. It also may affect the duration of objects that are added to the project. See “How the Ctrl key affects adding objects” on page 54 for more information.

Anark_Studio_User_Guide.book Page 150 Monday, March 19, 2007 10:34 AM

Page 159: Anark Studio4 User Guide

User Reference 151

Using the Playhead

To move the Playhead, do one of the following:

Click and drag the Playhead handle to the desired location on the time measure.

Click on the location on the time measure where you want the Playhead to reside. The Playhead will jump to that location.

To move the Playhead using snapping:Hold down the Shift key while dragging the Playhead to the desired location on the time measure. The Playhead will snap to either the keyframe or the handle of a timebar that is closest to it in the Time pane. If the Timeline Snapping Grid is enabled in the Application Prefer-ences, the Playhead will also snap to the tick marks on the time measure.

You can also snap the Playhead to the tick marks without dragging with the mouse.

Use the period (.) and comma (,) keys

to snap to every tick mark.

Hold down the Shift key (Shift + < and Shift + >) to snap the Playhead to the nearest tall tick mark.

To move the Playhead without updating the scene:Hold down the Ctrl key while dragging the Playhead to the desired location on the time measure. The scene is not updated when the Playhead is moved this way, meaning no keyframes are evaluated and objects are neither attached nor detached from the scene.

Tip: This feature is particularly useful when you are animating a scene. If you made changes to an object but forgot to move the Playhead to a new location on the time measure, just hold down Ctrl and drag the Playhead to the location you want. You can then set keyframes at the new location by pressing F6.

Anark_Studio_User_Guide.book Page 151 Monday, March 19, 2007 10:34 AM

Page 160: Anark Studio4 User Guide

152 Anark Studio User Guide

Chapter 7Animating Objects

Using keyframesThere are two types of keyframes in Anark Studio: property keyframes and master keyframes.

Master keyframes are just handles that give you easy access to the property keyframes that have been set for an object. Unlike property keyframes, they don’t control any actual values. Master keyframes appear on the timebars of all animated objects except for the Scene and materials, which don’t have time-bars; for these objects, master keyframes appear on their Object bars instead.

Master keyframes have the following features:

When you select a master keyframe, all the keyframes for the object that reside at that moment in time will be selected.

When you drag a master keyframe, all the keyframes for the object that reside at that moment in time will move along with it.

Deleting a master keyframe on the timebar or Object bar deletes all the keyframes for the object at that moment in time.

When you drag a standard keyframe to a new location in time, a new master keyframe will be created for it on the timebar.

You can set the interpolation for all the keyframes represented by a master keyframe using the Set Keyframe Inter-polation dialog.

Property keyframes control the actual data of an object property such as opacity or position.

To animate a property requires at least two keyframes, each with a different value for the property. Anark Studio calculates the difference between the values of the keyframes and generates the necessary intermediate frames to create the animation of the object.

Anark Studio uses time-based animation rather than frame-based animation to ensure accurate timing of time-sensitive content such as video and music.

Setting keyframesThe value of the first property keyframe set for an object will override any previous settings. Keyframes can be set for an object both before and after its duration (i.e., outside the bounds of its timebar). Anark Studio will interpolate between the keyframe before the object’s start handle and the first keyframe on or after it, so that the object begins its dura-tion in the middle of the interpolation. Likewise, it will interpolate between the last keyframe on the timebar and the first keyframe after it. The only excep-tion is for components.

If there are no keyframes set outside an object’s timebar, then the object will begin its duration at the value of the first keyframe and will end its duration at the value of the last keyframe.

For information about setting default values for objects, see “Chapter 5: Setting Object Properties” on page 81. For information about components, see “Using components” on page 136. For information about interpolation, see “Controlling keyframe interpolation” on page 157.

Anark_Studio_User_Guide.book Page 152 Monday, March 19, 2007 10:34 AM

Page 161: Anark Studio4 User Guide

User Reference 153

Setting keyframes

To insert the first keyframe for an object:1. Move the Playhead to the desired

location on the time measure.

2. Select an object in the Timeline tab.

3. Edit the desired property using the Inspector palette. If editing position, rotation or scale, you can also drag the object to the desired setting in the Project window.

4. Do one of the following:

• Turn on the Master Animation toggle for the instance of the object, which will automatically turn on the toggle for all the object’s properties.

• If you only want to animate a couple of properties, select the prop-erties in the Timeline tab and turn on their Animation toggles.

A keyframe will automatically be added at the location of the Playhead.

To insert subsequent keyframes:1. Move the Playhead to the desired

location in the time measure.

2. Select an object in the Timeline tab.

3. Edit the desired property using the Inspector palette. If editing position, rotation or scale, you can also drag the object to the desired setting in the Project window.

4. Do one of the following:

• To insert keyframes for a single property, right-click on the Prop-erty bar in the Time pane and select Insert Keyframe from the Context menu.

• To insert keyframes for all of an object’s properties that have the Animation toggle turned on, right-click on the object’s timebar in the Time pane and select Insert Keyframe from the Context menu.

Anark_Studio_User_Guide.book Page 153 Monday, March 19, 2007 10:34 AM

Page 162: Anark Studio4 User Guide

154 Anark Studio User Guide

Chapter 7Animating Objects

AutokeyframingThere are two ways to automatically set keyframes for more than one property at a time. One way is to deliberately set keyframes for all properties that have been changed using a key command or menu option. The other way is to turn on autokeyframing so that every time the Playhead is moved and an object property is subsequently changed, keyframes are set. Keyframes are auto-matically set for every property that had changes made to it. Only the currently selected object will have keyframes set for it (i.e., its children will not).

To automatically set keyframes for changed properties:1. Enable autosetting keyframes by

doing one of the following:

• Click on the Autoset Keyframes

button ( ) on the toolbar.

• Choose Timeline > Autoset Keyframes.

• Press K.

2. Make sure the Animation toggle has been turned on for all properties you want to set keyframes for.

3. Move the Playhead to the desired location in the time measure.

4. Edit the desired properties using the Inspector palette. If editing position, rotation or scale, you can also drag the object to the desired setting in the Project window. When the mouse button is released or Enter is pressed, the change is committed and the keyframe is added.

Tip: If Autoset Keyframes is on, you can quickly override existing key-frames by moving the Playhead pre-

cisely on top of an existing keyframe and setting a new value for a prop-erty. Hold down the Shift key while dragging the Playhead to snap it to the keyframe.

If you don’t move the Playhead but you do change object properties and set new keyframes, the new keyframes will be written over any existing keyframes.

To manually set keyframes for changed properties:1. Move the Playhead to the desired

location in the time measure.

2. Select an object in the Timeline tab.

3. Make sure the Animation toggle has been turned on for any property you want to set keyframes for.

4. Edit the desired properties using the Inspector palette. If editing position, rotation or scale, you can also drag the object to the desired setting in the Project window.

5. Do one of the following:

• Press F6.

• Select Timeline > Set Changed Keyframes.

If you don’t move the Playhead but you do change object properties and set new keyframes, the new keyframes will be written over any existing keyframes.

To override an existing keyframe:You can easily override an existing keyframe with a new one. Move the Playhead to the location of the keyframe(s) you want to override, edit the properties you want to change in the Inspector (or in the Project window using a Transform tool) and set a new keyframe using any method described above.

Anark_Studio_User_Guide.book Page 154 Monday, March 19, 2007 10:34 AM

Page 163: Anark Studio4 User Guide

User Reference 155

Selecting keyframes

Selecting keyframesTo select a keyframe:Click on the keyframe icon in the Time pane. Selected keyframes are darkened.

To select multiple keyframes:Do one of the following:

Click and drag a selection box around the keyframes you want to select.

Press Ctrl as you click on the keyframes.

To select all keyframes for an object or property:Press Shift and click on the Property or Object bar in the Object outline.

Deleting keyframesTo delete a keyframe:Select a keyframe (or keyframes) and do one of the following:

Right-click on the keyframe or on the Object or Property bar in the Time pane and select Delete Selected Keyframe(s) from the Context menu.

Press Delete or Backspace.

Choose Timeline > Delete Selected Keyframes.

Deleting a master keyframe on the timebar or Object bar deletes all the keyframes for the object at that moment in time.

To delete all of a property’s keyframes, whether they are selected or not:Right-click on the Property bar in the Time pane and select Delete All Channel Keyframe(s) from the Context menu.

Turning keyframes on and offTo deactivate a property’s keyframes:Turn the Animation toggle off for a property that has keyframes set. The keyframes will no longer be visible or active, but the keyframe information is saved until you close Anark Studio.

To reactivate a property’s keyframes:Turn the Animation toggle on for a property that has inactive keyframes. The keyframes will be visible and active again.

Anark_Studio_User_Guide.book Page 155 Monday, March 19, 2007 10:34 AM

Page 164: Anark Studio4 User Guide

156 Anark Studio User Guide

Chapter 7Animating Objects

Moving keyframesKeyframes can be dragged along the Timeline in order to change the timing of their animated properties. Keyframes can only be dragged within their current row.

For very precise control of keyframe times, a dialog is also available to edit the time for individual keyframes down to the millisecond.

To move a keyframe:1. Select the keyframe(s).

2. Click and drag the selected key-frame(s) to the desired position.

To move keyframes using snapping:Hold down the Shift key while dragging the keyframe(s) to the desired location on the time measure. If you are moving multiple keyframes, then the keyframe that you clicked on for dragging will be the “snap to” keyframe. The keyframe(s) will snap to the nearest element from among the following:

A keyframe not in the same row as the “snap to” keyframe.

The handles of a timebar.

The Playhead.

The ticks on the Time measure (if Timeline Snapping Grid is enabled in the Application Preferences.

To edit a keyframe’s time:1. Double-click on a keyframe. Even if

more than one keyframe is selected, only the keyframe that is double-clicked on will be edited.

2. In the Set Keyframe Time dialog, enter the desired time and click OK.

Copying and pasting keyframesKeyframes contain information about both the property they control (e.g., Diffuse Color, Pivot Point, U Position, etc.). This “self knowledge” provides you with a couple of options for copying and pasting keyframes.

Keyframes can be copied and pasted into different places within the same property.

Keyframes can be copied from one object’s property to another object’s corresponding property. For example, a keyframe for a material’s Diffuse Color could be pasted into the Diffuse Color for a light.

This flexibility allows you to set keyframe data for a single object and then use it for several other objects. However, keyframes from more than one object cannot be copied at one time.

To copy and paste keyframes:1. Select the desired keyframe(s). A sin-

gle keyframe or multiple keyframes from multiple properties can be selected, but only one object’s key-frames can be copied at a time. If key-frames from more than one object are selected, the copy operation will fail.

2. Do one of the following:

• Choose Edit > Copy.

• Press Ctrl + C.

• Right-click on the Object or Prop-erty bar and select Copy Selected Keyframe(s) from the Context menu.

This copies the selected keyframe(s) to the clipboard.

3. Position the Playhead in the desired location.

Anark_Studio_User_Guide.book Page 156 Monday, March 19, 2007 10:34 AM

Page 165: Anark Studio4 User Guide

User Reference 157

Controlling keyframe interpolation

4. Select the desired object. The copy operation will be successful only if the object has a corresponding property.

5. Do one of the following:

• Choose Edit > Paste.

• Press Ctrl + V.

• Right-click and select Paste Keyframe(s) from the Context menu.

The keyframe or keyframes will be pasted into the appropriate properties for the object. The leftmost pasted keyframe will be placed at the current location of the Playhead. All other keyframes are offset accordingly.

Controlling keyframe interpolationThere are two types of interpolation that keyframes can perform in Anark Studio: linear and smooth. Linear interpolation is the simplest to understand. It goes from the starting value of one keyframe to the starting value of the next keyframe in a straight line. There is a uniform rate of change between the keyframes. For spatial properties, this can give a “mechanical” look to animations, which may be undesirable.

Smooth interpolation is more complex because it uses two additional control values (Ease In and Ease Out) to create a nonlinear curve that produces a nonuni-form rate of change between the keyframes. This can be used to create smoother animation effects for spatial properties, and gradual starts and stops for any property.

You can mix linear interpolation with smooth interpolation among the

different keyframes for a property, and you can even mix linear interpolation with smooth interpolation on a single keyframe.

Each time a keyframe is added, Anark Studio creates it with a default interpola-tion of either linear or smooth. You can then adjust the Ease In and Ease Out values for individual keyframes if you need to.

Animation using Smooth interpolation (top) eases into and out of the keyframes, while animation using Linear interpolation (bot-tom) changes uniformly between keyframes.

To specify whether the default setting for keyframes will be linear or smooth:1. Choose Edit > Application Prefer-

ences (Ctrl + P).The Preferences dia-log will open.

2. Set the desired Default Interpolation value and click OK.

Anark_Studio_User_Guide.book Page 157 Monday, March 19, 2007 10:34 AM

Page 166: Anark Studio4 User Guide

158 Anark Studio User Guide

Chapter 7Animating Objects

The interpolation of any existing keyframes will not be changed; however, the interpolation of any new keyframes will be set to this value.

To set the interpolation for a keyframe (or multiple keyframes):1. Select the keyframe(s).

2. Do one of the following:

• Right-click on a selected keyframe and select Set Interpolation from the Context menu.

• Select Timeline > Set Interpolation.

The Keyframe Interpolator dialog box will open.

3. Set the desired values and click OK.

Properly controlling keyframe interpola-tion requires an understanding of how the different values affect the “change curve.”

Tip: One of the best ways to gain an understanding of the range of inter-polation settings is to try different combinations of them for both a spatial property (such as position) and a nonspatial property (such as opacity) on an object in Anark Stu-dio.

Ease In – Controls how slowly the object decelerates from the value of the previous keyframe toward the value of this keyframe. If Ease In is set to a high value, the change will be more gradual (hence the term “Ease In”). If Ease In is set to a low value, the change will be fairly rapid. A value of 0 makes this portion of the keyframe linear, meaning there will be a completely uniform rate of change.

Any Ease In setting for the first keyframe for a property is ignored because there is no previous keyframe value to work with. The value of the first keyframe will override any static values that have been set; this means that the object will begin its duration at the value of the first keyframe. For information about setting static values for objects, see “Chapter 5: Setting Object Properties” on page 81.

Ease Out – Controls how quickly the object accelerates from the starting value of the keyframe toward the value of the next keyframe. As with Ease In, if Ease Out is set to a high value, the change will be more gradual. If Ease Out is set to a low value, the change will be fairly rapid. A value of 0 makes this portion of the keyframe linear, meaning there will be a completely uniform rate of change.

Any Ease Out setting for the final keyframe for a property is ignored, since the value of the next keyframe must be known in order to create the change. An object property remains at the value of the final keyframe for the rest of the duration of the object.

Anark_Studio_User_Guide.book Page 158 Monday, March 19, 2007 10:34 AM

Page 167: Anark Studio4 User Guide

User Reference 159

Playing back a presentation

Playing back a presentationThere are several ways to play back a presentation.

To see just the animation of a scene (without executing behaviors), you use the Playback controls or scrub with the Playhead. This displays animation for the current slide, but not for any components, because they have a sepa-rate Timeline.

To see the execution of all the elements in a presentation, including behaviors, actions and animation of components, you have to preview the presentation in another application using the F12 key. When previewing, the content of the first slide is displayed initially. In order to view the content of the other slides, you must set up some actions to navigate through the slides.

For more information about setting up actions, see “Creating and deleting actions” on page 120. For more informa-tion about previewing a project, see “Previewing a presentation” on page 174.

Using dynamic keyframesDynamic keyframes enable you to create dynamic animation effects. Regular, static keyframes have a set value, but dynamic keyframes have a dynamically calculated value. Specifically, they are always set to the value of the property

when the object exited the previous slide.

Dynamic keyframes are useful for smoothly animating an unlinked prop-erty between slides because no matter what the property value is for the object when it leaves one slide, a dynamic keyframe at the beginning of the next slide ensures that the object’s animation will pick up exactly where it left off. For the same reason, dynamic keyframes are also useful for slide-to-slide animation of unlinked properties for objects that have behaviors applied to them that allow for user interaction, such as Draggable.

Dynamic keyframes appear in green.

To set a dynamic keyframe:1. Select one or more static keyframes

using the instructions in “Selecting keyframes” on page 155.

2. Right-click and select Make Key-frames Dynamic from the Context menu.

To make a dynamic keyframe static:1. Select one or more dynamic key-

frames using the instructions in “Selecting keyframes” on page 155.

2. Right-click and select Make Key-frames Dynamic from the Context menu.

Anark_Studio_User_Guide.book Page 159 Monday, March 19, 2007 10:34 AM

Page 168: Anark Studio4 User Guide

160 Anark Studio User Guide

Chapter 7Animating Objects

How dynamic keyframes are executedWhen dynamic keyframes are played back inside Anark Studio, their dynamic property isn’t evident. They are executed with the value of the original static keyframe. In order to see the dynamic execution of a keyframe you must preview it. In addition, the presentation must meet the following criteria:

Because only objects on the Master slide are persistent between slides, the animated object must be on the Master slide and the keyframed property must be unlinked (otherwise the keyframes in each slide would be identical). For information about unlinking proper-ties, see “Linking and unlinking prop-erties” on page 135.

There must be more than one slide. For more information about setting up slides, see “Understanding slides” on page 133.

There must be a way to jump from one slide to another. This is done by creating an action that uses Go to Slide, Next Slide or Previous Slide.

Playback controlsThe Playback controls in the application toolbar allow you to preview the presentation.

Playback controls

Rewind – Rewinds the Playhead to the beginning of the project and, if currently set to Play, continues playing.

Stop – Stops playback at the current loca-tion of the Playhead.

Play – Begins playback at the current location of the Playhead. Holding down the Space bar also begins playback at the current location. Releasing the Space bar stops playback and returns the Playhead to the previous location. Pressing the Enter key also begins playback from the current location; pressing it again stops playback and leaves the Playhead at the new location.

Loop – Enables looping mode for play-back so that at the end of the presenta-tion, the Playhead will jump back to the beginning and continue playback mode.

Scrubbing with the PlayheadDragging the Playhead along the time measure is called scrubbing. Scrubbing allows you to preview any keyframed animation in the current Slide, but it does not execute behaviors. In order to view the full content of the project, you’ll need to press F12 to preview it.

For more information about previewing a project, see “Previewing a presenta-tion” on page 174.

Anark_Studio_User_Guide.book Page 160 Monday, March 19, 2007 10:34 AM

Page 169: Anark Studio4 User Guide

User Reference 161

Scrubbing with the Playhead

Anark_Studio_User_Guide.book Page 161 Monday, March 19, 2007 10:34 AM

Page 170: Anark Studio4 User Guide

162 Anark Studio User Guide

Chapter 7Animating Objects

Anark_Studio_User_Guide.book Page 162 Monday, March 19, 2007 10:34 AM

Page 171: Anark Studio4 User Guide

User Reference 163

Scrubbing with the Playhead

Anark_Studio_User_Guide.book Page 163 Monday, March 19, 2007 10:34 AM

Page 172: Anark Studio4 User Guide

164 Anark Studio User Guide

Chapter 7Animating Objects

Anark_Studio_User_Guide.book Page 164 Monday, March 19, 2007 10:34 AM

Page 173: Anark Studio4 User Guide

8

165

Chapter 8: Working with Streaming Media and Dynamic Images

Music and video files can be streamed from anywhere on

the Web, since they are accessed using a URL, or they can be placed in a local directory with the final presentation if it’s being used in a non-Web-based application such as a kiosk, CD-ROM, screen saver or standalone application.

Because there is a latency issue when buffering streaming media files over the Web, some additional steps are needed to avoid a pause during playback while the media is preb-uffered. A behavior that starts the prebuffering process and allows you to loop a portion of the presentation until the media is ready to play is included in the Behavior Library, and instructions for using it are included in “Setting up streaming files” on page 167 in the section that covers Web-based applications.

Non-Web-based applications do not have significant latency issues with streaming media because the files are typically available locally.

Images can be dynamically loaded from remote sources. When an image is added to the project, a default image is always embedded in the data of the presentation. The default image is the same as the Library resource for the image. However, the Remote Source property of images can also be used to load JPEG or PNG images remotely. If, during playback, you don’t want the default image to be displayed, you can use the same prebuffering behavior that is used by streaming media files to ensure that the remote image is loaded before the image is displayed. See “Setting up dynamic images” on page 169 for more information.

Anark_Studio_User_Guide.book Page 165 Monday, March 19, 2007 10:34 AM

Page 174: Anark Studio4 User Guide

166 Anark Studio User Guide

Chapter 8Working with Streaming Media and Dynamic Images

Working with proxy videoWhile you are working on a project in Anark Studio, it’s recommended that you work with a proxy video with low compression and high quality so that you can preview, or “scrub,” the video using the Playhead, as explained in “Scrubbing with the Playhead” on page 160. MPEG-4 and other high-com-pression codecs aren’t meant to be scrubbed so they don’t offer this ability. Instructions for working with a proxy video are included in “Adding streaming media files to a project” on page 167.

Understanding paths for streaming media and dynamic imagesBecause the data of music and video files is not embedded in the project file, Anark Studio must access the media file each time the project is loaded, pre-viewed or played in order to display the video or play the music. It uses the Remote Source property of the Library resource to access the file. Similarly, when you dynamically load an image, Anark Client must access the image using the Remote Source property.

The Remote Source may be specified as either the URL of the media or image file or the fully qualified absolute or relative path to it. The following table shows sample paths to a video file from an Anark project file located one directory up.

Use the following guidelines for deciding which type of path to use:

In general, you should use the relative path. Relative paths point to the loca-tion of the files in relation to the current file. While you are working on your project, it will be the location of the media or image file in relation to the .amw file. When you are ready to publish your project, it will be the loca-tion of the media or image file in rela-tion to the Anark Media, projector, or screen saver file. The benefit of relative paths is that even if the files get moved to a different server, it won’t break the path (except for screen savers which must always be located in a specific directory). The relative path must be preceded by ./ to indicate the current directory (or ../ to go up one directory level, etc.).

Working Directory for Project File

C:\Projects\Web\Anark.com\

Relative Path to video

./Demo/myFile.avi

URL to video

http://www.anark.com/Demo/myFile.avi

Absolute Path to video

C:\Projects\Web\Anark.com\Demo\myFile.avi

Anark_Studio_User_Guide.book Page 166 Monday, March 19, 2007 10:34 AM

Page 175: Anark Studio4 User Guide

User Reference 167

Adding streaming media files to a project

If the file will be streamed or loaded in a Web-based application and the streaming media or image file is located on a different server than the .am file, use the URL.

If the file will be streamed or loaded in a non-Web-based application and the streaming media or image file is located on a different server than the Anark Media, projector or screen saver file, use the absolute path, which describes the full navigation path to a file.

Note: Universal Naming Convention (UNC) paths, which are often used to navigate to files on a network, cannot be used as the Remote Source.

Adding streaming media files to a projectTo add video or music to a project:1. Do one of the following:

• Import the video or music file as a resource in the Library using the instructions in “Importing objects” on page 51. If you are working with a proxy video file (i.e., one that can be scrubbed with the Playhead), you will need to import the low compression version while you are working on the project, and later reference the higher compression version when you are ready to publish it.

• Create a video or music resource by dragging on the Video ( ) or Music ( ) button on the Basic Objects tab. You can drag it onto the Object outline or onto the Project window. Set the Remote Source for the music or video. If you have both

high and low compression versions, you should set this to the low compression version while you are working on the project and the higher compression version when you are ready to publish it.

2. Attach the video to either a material on a model or to a layer or group by dragging it onto one of these items in the Object outline. If the video is attached to a layer or a group, a model (a rectangle primitive) will automatically be created for it both in the Object outline and in the Library. Attach the music object to the Scene. If you are going to stream the media over the Web, you should make sure the start time of the music or video object begins at least a few seconds into the presentation.

Setting up streaming filesIf you imported the video or music, Anark Studio used the absolute path to its current location as the Remote Source property. When you’re ready to publish the presentation, you need to make sure the Remote Source property is set to the media file’s final location. In most cases, this will be the relative path. However, if the media file will be located on a different server than the .am file, you must specify the absolute path or the URL. Even if you are streaming the file in a non-Web-based application, latency issues may arise if the media file and the .am file are not on the same server or computer. If that’s the case, you may need to use the instructions for streaming in a Web-based application. Lastly, it’s always a good idea to clean out the Library before you publish a presentation.

Anark_Studio_User_Guide.book Page 167 Monday, March 19, 2007 10:34 AM

Page 176: Anark Studio4 User Guide

168 Anark Studio User Guide

Chapter 8Working with Streaming Media and Dynamic Images

While Anark Studio allows you to stream up to five media files in a project, keep in mind the bandwidth constraints of your audience and use the minimum number that will be effective.

To stream video or music in a non-Web-based application:1. Select the video or music resource in

the Library.

2. On the Inspector palette, set the Remote Source property to the fully qualified relative or absolute path to the video or music file.

3. Right-click in the Library and select “Delete Unused Resources” from the Context menu.

To stream video or music in a Web-based application:1. Select the video or music resource in

the Library.

2. On the Inspector palette, set the Remote Source property to the media file’s final file location. This should be the relative path unless the media file and the .am file are not on the same server, in which case this should be the URL. You must do this for each file that will be streamed. If HTTPS is used, port 443 is used by default. To specify a different port, the URL must be followed by a colon and a port number (e.g., https://www.anark.com:444).

3. On the Storage palette, select the PreBufferAsset behavior from the Miscellaneous folder on the Behavior Library tab and drag it onto the Library palette.

4. Attach the PreBufferAsset behavior to either the scene or the layer that con-tains the video or music object. It’s a good idea to place the start handle of the behavior at the beginning of the

project so it can begin prebuffering immediately.

PreBufferAsset behavior

5. In order to avoid a noticeable pause during playback, a section of the pre-sentation would need to be looped while the system is prebuffering the streaming file(s). If you don’t mind the pause, you can skip ahead to step 6. Otherwise, you can use the follow-ing optional steps to loop a section of the animation while the media is being buffered.

a. Turn on Use Buffer Loop? by checking it.

b. Set Buffer Loop Beg. and Buffer Loop End to any period of time in the presentation that doesn’t intersect the timebar for any media file to be streamed. This would typically be a small section of animation at either the very beginning or very end of the scene that could function as a “loading” screen.

c. If the looping animation is at the beginning of the scene, then when the streaming media is ready to begin playing, the system will

Anark_Studio_User_Guide.book Page 168 Monday, March 19, 2007 10:34 AM

Page 177: Anark Studio4 User Guide

User Reference 169

Distributing streaming media files

automatically stop looping and will continue playing the rest of the presentation from that point. However, if the looping animation is at the end of the scene, you will need to specify that the presenta-tion should jump back so it can finish playing the rest of the scene. To tell the system where to jump back to, turn on Use Continue Jump? by checking it and set a value for Continue Time.

d. If the looping animation is at the end of the scene, you must drag the end handle of the PreBufferAs-set behavior object past the last keyframe for the animation.

6. Set the Lib. Asset Name parameters to the names of up to five resources in the Library. The resources can include any combination of video, music and images.

7. Clean out the Library by right-click-ing in the Library and selecting “Delete Unused Resources” from the Context menu.

Distributing streaming media filesAs a general rule, you can decide where to locate your streaming files based on whatever directory structure works best for your implementation. The only exception is for Macintosh projector files. If you want to distribute music or video files used in a Mac projector file on a CD-ROM rather than streaming them across the Web, they must be placed in a special directory.

In all cases, be sure you have set an appropriate relative path to the media file using the Remote Source property before exporting the project.

To distribute streaming media with Macintosh projector files:Mac OS X packages multiple directories into one .app file so that they look like a single application to the user. When you create an Anark Studio projector file for the Macintosh, unless you are going to stream music or video over the Web, any media files in the project need to go inside the contents of one of the “hidden” directories inside the exported .app projector file.

1. Because you will be placing the media file in the same directory with the .am file, be sure to set the Remote Source property of the video or music object in the Library accordingly before saving and exporting (e.g., .\myVideo.avi).

2. Locate the exported .app projector file in a Macintosh Finder window.

3. Control-click on the application icon and select “Show Package Contents” from the context menu. This will open the Contents directory in a new Finder window.

4. Open Contents/Resources.

5. Copy the streaming media file to the Resources directory.

The .app file can now be distributed as a single stand-alone application.

Even though Anark Studio only runs on the PC, you can create and distribute Macintosh projector files. A tutorial explaining how to do this is available on the Anark Web site (www.anark.com).

Setting up dynamic imagesThe PreBufferAsset behavior can be used to load a remote image so that the default image that is embedded in the project won’t be displayed. Up to five assets can be prebuffered with a single

Anark_Studio_User_Guide.book Page 169 Monday, March 19, 2007 10:34 AM

Page 178: Anark Studio4 User Guide

170 Anark Studio User Guide

Chapter 8Working with Streaming Media and Dynamic Images

PreBuffer Asset behavior. The assets can include any combination of video, music and images.

To prebuffer images:1. Select the image resource in the

Library.

2. On the Inspector palette, set the Remote Source property to the image’s final location. This should be the relative path unless the image file and the .am file are not on the same server, in which case this should be the URL. If HTTPS is used, port 443 is used by default. To specify a different port, the URL must be followed by a colon and a port number (e.g., https://www.anark.com:444).

3. On the Storage palette, select the PreBufferAsset behavior from the Miscellaneous folder on the Behavior Library tab and drag it onto the Library palette.

4. Attach the PreBufferAsset behavior to either the scene or the layer that con-tains the image object (or any other asset you want to load). It’s a good idea to place the start handle of the behavior at the beginning of the project so it can begin prebuffering immediately.

5. In order to be sure that the default image will not be displayed, a section of the presentation will need to be looped while the system is prebuffer-ing the assets. Turn on Use Buffer Loop? by checking it.

6. Set Buffer Loop Beg. and Buffer Loop End to any period of time in the pre-sentation that doesn’t intersect the timebar for any object you want to prebuffer. This would typically be a small section of animation at either the very beginning or very end of the scene that could function as a “load-ing” screen.

7. If the looping animation is at the beginning of the scene, then when all the assets are loaded and are ready to begin playing, the system will automatically stop looping and will continue playing the rest of the pre-sentation from that point. However, if the looping animation is at the end of the scene, you will need to specify that the presentation should jump back so it can finish playing the rest of the scene. To tell the system where to jump back to, turn on Use Con-tinue Jump? by checking it and set a value for Continue Time.

8. If the looping animation is at the end of the scene, you must drag the end handle of the PreBufferAsset behav-ior object past the last keyframe for the animation.

9. Set the Lib. Asset Name parameters to the names of up to five resources in the Library.

10. Clean out the Library by right-click-ing in the Library and selecting “Delete Unused Resources” from the Context menu.

Anark_Studio_User_Guide.book Page 170 Monday, March 19, 2007 10:34 AM

Page 179: Anark Studio4 User Guide

User Reference 171

Setting up dynamic images

Anark_Studio_User_Guide.book Page 171 Monday, March 19, 2007 10:34 AM

Page 180: Anark Studio4 User Guide

172 Anark Studio User Guide

Chapter 8Working with Streaming Media and Dynamic Images

Anark_Studio_User_Guide.book Page 172 Monday, March 19, 2007 10:34 AM

Page 181: Anark Studio4 User Guide

9

173

Chapter 9: Viewing and Distributing Anark Media Files

Anark Studio allows you to quickly preview a project in a browser or Anark Player while you are working on it. To dis-tribute a finished presentation, it must be exported to one of several interactive file formats that are available or to video. During export, Anark Studio compresses and compiles the project into a presentation file that can be viewed in a Web browser or media player, as a screen saver, or as a standalone application.

In addition, Anark Media presentations can be made SCORM-conformant. SCORM is an abbreviation for Shar-able Content Object Reference Model. It is a set of specifica-tions and standards aimed at making learning content reusable, accessible and interoperable. SCORM-conformant presentations can only be viewed on Windows computers, however.

Anark_Studio_User_Guide.book Page 173 Monday, March 19, 2007 10:34 AM

Page 182: Anark Studio4 User Guide

174 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

Previewing a presentationYou can preview a project at any time while you are working on it.

When you preview a project, you can see the execution of all its elements, including behaviors, actions and anima-tion. The content of the first slide is displayed initially. In order to view the content of other slides, you must set up some actions to navigate through the slides.

In order to preview a project, Anark Studio must create appropriate files for each application. These are automati-cally saved in the same directory as the .amw file that is created when a project is saved. The following files are created:

If you select Internet Explorer as your preview application, both an HTML and an Anark Media file are created.

If you select either Anark Player or Anark Player - Software as your preview application, then only an Anark Media file is created.

If you select Custom, you can select a presentation exporter that you prefer. Output files will be created accord-ingly, depending on your selection.

Note: If you select Anark Player - Soft-ware as your preview application for a project that has Force Hardware set as the Playback Preferred Renderer, you will receive an error message when you attempt to preview. For more information about setting the Playback Preferred Renderer, see “Export Options” on page 22.

For more information about setting up actions, see “Creating and deleting actions” on page 120. For information about viewing an exported presenta-

tion, see “Distributing a presentation” on page 183.

To preview a project you are working on:Do one of the following:

Press the F12 key.

Choose File > Preview.

The presentation will open in the preview application specified in the Project Settings. The default setting is Anark Player, but you can also select Internet Explorer instead. For more information, see “Editing project settings” on page 19.

Setting rendering optionsIn order for Anark Media presentations to be played on the largest possible number of computers, Anark provides three rendering options:

DirectX

OpenGL

Software

As you are developing a presentation in Anark Studio, you can view it in the Project window using any of the avail-able rendering engines. You can set which rendering engine to use in the Anark Studio Preferences dialog (under Edit > Application Preferences).

When you are ready to publish your presentation, you can set the Playback Preferred Renderer property in the Project Settings dialog. This property sets a flag in the exported presentation that can be read by the playback application to determine how it will handle the presentation.

Content set to “Auto” will use the renderer selected in the Anark Client Control Panel on the viewer’s machine. However, the viewer can

Anark_Studio_User_Guide.book Page 174 Monday, March 19, 2007 10:34 AM

Page 183: Anark Studio4 User Guide

User Reference 175

Software renderer limitations

change the renderer for that presenta-tion using the context menu in the playback application.

Content set to “Force Hardware” will use whichever hardware renderer is selected in the Anark Client Control Panel. However, if Software is selected in the control panel, it will automati-cally choose either OpenGL or DirectX. Users will not be allowed to choose the Software renderer from the context menu for that presentation.

Content set to “Force Software” will ignore the Anark Client Control Panel setting and will always play back in the Software renderer mode. Users will not be allowed to choose OpenGL or DirectX from the context menu for that presentation. See “Software renderer limitations” below when considering forcing presentations to play in Software.

In cases where the Anark Client Control Panel is not present on a viewer’s machine, such as projectors and screen savers or when Anark Player is distrib-uted on CD ROM, the playback applica-tion will find an available renderer on the viewer’s machine in this order:

a. OpenGL

b. DirectX

c. Software

When exporting to AVI video, the Play-back Preferred Renderer setting (Edit > Project Settings) will be used to render to video. There is no way to manually switch renderers while the project is rendering to video.

Note: OpenGL is able to evaluate floating-point numbers more pre-cisely than DirectX does, which can lead to slight differences in render-

ing or to unexpected results in behaviors. In DirectX, if you set a value for an object to an exact deci-mal point (e.g., 123.456) the value returned may not be that exact deci-mal value (123.45600123173828 would be returned instead).

Software renderer limitationsWhile the Software renderer has a wider playback audience than hardware rendering options, there are some limita-tions to the renderer that need to be considered when targeting a presenta-tion for Software rendering:

Software rendering is considerably slower than hardware acceleration. Frame rates will be much lower than with OpenGL and DirectX on large presentations.

Image mirroring is not available. Images that are set to Mirror will default to Tiled.

Individual U and V Tiling options are not available. If either the U or V coor-dinate is set to Tiled, the entire image will tile. Both U and V need to be set to No Tiling for no tiling to occur on the image.

Spot lights are not available. Any Spot lights in a presentation will default to Point lights.

Specular Material settings are not avail-able. They will be ignored.

Point Material rendering is not available. Any objects set to Point rendering will not be rendered in Software.

Wireframe rendering is not shaded in Software. This is different from OpenGL and DirectX, which draw shaded wirefame lines.

Anark_Studio_User_Guide.book Page 175 Monday, March 19, 2007 10:34 AM

Page 184: Anark Studio4 User Guide

176 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

The accuracy of U and V Position and Repeat values is limited based on the texture map size. Accuracy is only guaranteed within a range of +/-32 for images that are sized at 256 (e.g., a U and V Position value of 8 and a U and V Repeat value of 8). Any decrease in the texture map size will increase the accuracy range, while an increase in texture size will decrease the accuracy range.

Materials are limited to a maximum of 2 textures, regardless of the hardware maximum number of allowable textures.

Choosing a distribution formatThere are several things to consider when deciding on a format (or formats) for distribution of your presentation.

If you have designed an interactive presentation, you should select one of the interactive formats: HTML, Anark Media, projector or Windows screen saver.

If your presentation doesn’t contain any interactive elements, then you can export it to video. Exported video files do not contain any audio, however.

To distribute your project via the Web, export it to HTML.

For CD-ROM, kiosk or standalone program applications, you can export it as a Windows projector file.

To distribute your project as a Windows screen saver, export it as a screen saver (.scr).

Exporting a presentationIn order to distribute a finished presenta-tion, you must first export it.

To export a project:1. Do one of the following:

• Choose File > Export Presentation.

• Press Ctrl + Shift + S.

2. Create a name for your file and select a location.

3. Select the types of files to create from among the following:

• Anark Media – Creates an Anark Media file that uses .am as its file extension. Unlike the .amw file that is created when you save a project, the .am file cannot be edited because it has been compressed and has data embedded in it. It can only be opened in Anark Client. You can use this option if you will be embed-ding the .am file in an existing HTML page. For more information, see “Embedding Anark Media in an existing HTML file” on page 186.

• HTML page – Creates both an Anark Media file and an HTML file, which has the Anark Client ActiveX Control already embedded in it. Keep the HTML file in the same directory as the .am file when you distribute the presentation or else you will have to edit the SRC param-eter in the HTML file with the Anark Media file’s new location using the guidelines in “Editing the HTML document” on page 184.

• AVI Video – Creates an Audio Video Interleave (.avi) file that can be viewed in an appropriate media player. This option should only be used with non-interactive presentations. No audio is included in the exported video file. The

Anark_Studio_User_Guide.book Page 176 Monday, March 19, 2007 10:34 AM

Page 185: Anark Studio4 User Guide

User Reference 177

Exporting to Anark Player

available compression settings will depend on the codecs you have installed on your computer. See “Exporting to video” on page 178 for more information.

• Windows Screen Saver – Creates a .scr file that can be used as a screen saver on a user’s computer. It includes both the Anark Media data and the application required to view it. If you select this option, an export dialog will open that allows you to enter information about the presentation and the author. For more information about these options, see “Exporting to screen saver” on page 180.

• Projector – Windows only. Creates a .exe file that can be run as a standa-lone application. It includes both the Anark Media data and the Anark Media projector application required to view it, bundled into a single file. If you select this option, an export dialog will open that allows you to enter information about the executable file that will be viewable by the end user. For more information about these options, see “Exporting to projector” on page 182.

Note: If you are exporting your project to any format other than video, you will need to distribute any streaming music or video files that were used in your presentation along with the exported Anark Media file. See “Setting up streaming files” on page 167 for more information.

Exporting to Anark PlayerExporting a project for Anark Player creates a single .am file. There are no additional settings to configure.

The file can be distributed along with the Anark Player application that can play it back, or it could be embedded in an existing HTML page.

Exporting to Internet ExplorerWhen you export a project to HTML, both an HTML and an Anark Media (.am) file are created. While there are no additional settings to configure during export, you can customize or change several settings in the exported HTML document. See “Editing the HTML document” on page 184 for more information.

Anark_Studio_User_Guide.book Page 177 Monday, March 19, 2007 10:34 AM

Page 186: Anark Studio4 User Guide

178 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

Exporting to videoWhen exporting a project to video, there are several things to configure, including its dimensions and timing and the compression, if any, to apply to it.

Note: When exporting to video, you will need to make sure that the project is rendering in OpenGL. See “Editing project settings” on page 19 for more information.

Video Export SettingsThe Video Export Settings dialog will appear after you have selected a name and location for the video file.

Width – Specifies the width in pixels of the exported video.

Height – Specifies the height in pixels of the exported video.

Note: Because some video codecs will only work with dimensions that are a multiple of four, you can only set the video’s Width and Height to val-ues that are a multiple of four.

The Width and Height default to the current size of the Project window (rounded down to the nearest multiple of four.) The Project window size is set using the Scale Mode property on the Anark Studio Preferences dialog, as explained in “Editing project settings” on page 19. The Scale Mode preference controls the appearance of the exported video in the following ways:

If the presentation Scale Mode is set to either Scale to fit or Fixed aspect ratio, the Width and Height for the video will initially be set to your Project window’s current width and height. You can then change the Width and Height in the Video Export Settings dialog to whatever you want.

If the Scale Mode is set to either Fixed aspect ratio or Fixed size, the models in the scene will not be scaled if the video export Size is different from the Anark Studio Project window size. Instead, the content will be cropped or blank space will be added to accommodate the Width and Height you specify in

Anark_Studio_User_Guide.book Page 178 Monday, March 19, 2007 10:34 AM

Page 187: Anark Studio4 User Guide

User Reference 179

Exporting to video

If the Scale Mode is set to Scale to fit, then the models in the scene may be scaled up or down to so that they appear to take up the same amount of space to fit the new Width and Height you specify in the Video Export Settings dialog.

FPS – Specifies how many frames per second will be generated for the uncom-pressed video file. Most video codecs have an additional FPS setting that allows you to further compress the number of frames for the finished video file. Range = 1 to 1000. Defaults to 30, which is adequate for most applications. Values above 30 may be used for special applications such as HDTV.

Start Time – Sets the point in the presen-tation’s Timeline for video capture to begin. Specified in seconds. Defaults to 0.

Stop Time – Sets the point in the presen-tation for video capture to stop. Speci-fied in seconds. Defaults to the current presentation length. For information about how the presentation length is determined, see “Duration of the project” on page 59.

Continuous Capture – When checked, this specifies that the Stop Time will not be used; instead, video capture will continue until the Stop Rendering button is pressed on the Video Export screen.

Video CompressionThe Video Compression Settings dialog will appear after you have clicked Next on the Video Export Settings dialog.

This dialog allows you to select and/or configure the video codec application to be used on your video file. The list of available codecs depends on the codecs you have installed on your computer.

The two Codec Options, Quality and KeyFramesPerSec, are available for some but not all codecs. Additionally, some codecs have a Configure button that links to a dialog with further compres-sion options. Refer to the compression application’s product documentation for more information about configuring it. For information about the latest version of QuickTime, visit Apple’s QuickTime Tools and Tips Web site at:

http://www.apple.com/quicktime/tools_tips/

Anark_Studio_User_Guide.book Page 179 Monday, March 19, 2007 10:34 AM

Page 188: Anark Studio4 User Guide

180 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

Video Export screenThis screen appears after you have clicked Finish on the Video Compres-sion Settings dialog.

The Video Export screen displays the presentation as it is being captured to video.

Stop Rendering – If the Continuous Capture check box was enabled in the Video Export Settings dialog, this button allows you to stop video capture when-ever you want as you view a presenta-tion on the screen.

Important: The Video Export screen must remain on top when you are rendering a project as a video. If you launch another application, bring another application forward or min-imize the video export screen, the rendered video file may contain unwanted artifacts.

Exporting to screen saverWhen exporting a project as a screen saver, you can specify the information you want to appear in the Configuration Setting dialog for the screen saver.

The screen saver will use the Scale Mode property (from the Anark Studio

Preferences dialog, as explained in “Editing project settings” on page 19) to determine the dimensions of the exported screen saver.

If the Scale Mode is set to Scale to fit, the screen saver will cover the viewer’s full screen.

If the Scale Mode is set to Fixed size, the specified Width and Height settings will be used.

If the Scale Mode is set to Fixed aspect ratio, the current width-to-height ratio will be maintained and white space will be added to the borders if needed.

Export to Anark Media Screen SaverThe Export to Anark Media Screen Saver dialog will appear after you have selected a name and location for the screen saver file.

Screen Saver Name – Sets a name for the screen saver that will appear in the Display Properties dialog on the Screen Saver tab and in the Configuration Setting dialog. However, due to the way Windows looks for the file name to use, the File name of the screen saver may be used instead. In order for the Screen Saver Name to be used instead of the file

Anark_Studio_User_Guide.book Page 180 Monday, March 19, 2007 10:34 AM

Page 189: Anark Studio4 User Guide

User Reference 181

Exporting to screen saver

name, the file name must meet the following criteria:

The number of characters for the file name can only be a maximum of eight characters long, plus the .scr file extension.

There can be no spaces in the file name.

Capital letters should be avoided.

If any of the following were used as the file name, they would appear instead of the Screen Saver Name: Rain Bow, rain bow, or rainbowsaver. However, rainbow would enable the Screen Saver Name to be used.

Description – Allows you to write a brief description of the application that will appear in the Configure Settings dialog.

Author – Sets the author name that will appear in the Configure Settings dialog.

Configure SettingsThe Configure Settings dialog is avail-able to the end user from the Display Properties dialog’s Screen Saver tab. It allows the user to specify a hot spot (or exit) area and set whether key presses will exit the screen saver.

Anark_Studio_User_Guide.book Page 181 Monday, March 19, 2007 10:34 AM

Page 190: Anark Studio4 User Guide

182 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

Exporting to projectorWhen exporting a presentation to the projector format, you can set several properties for the Windows executable file, including the application name and author, a brief description and a custom icon.

Export to Anark Media ProjectorThe Export to Anark Media Projector dialog will appear after you have selected a name and location for the .exe or application file.

Application Name – Sets a name for the application that will appear in the title bar and in the About box.

Author – Sets the author name that will appear in the About box of the application.

Description – Allows you to write a brief description of the application that will appear in the About box.

Application Icon – Allows you to specify a custom icon for the application which will appear in the title bar. This option is only available on computers running

Windows 2000 and Windows XP. Defaults to the Anark Media icon. You can browse to any single icon file that contains a single image (i.e., icon files with multiple images cannot be used).

Viewing a presentationYou can view an exported project in whatever export format you choose.

During playback, the content will be played from 0 seconds to the final end handle of the last layer. Even if the first layer’s start time begins after 0 seconds, playback will begin with a blank screen at 0 seconds, and even if the timebars of other objects extend past the last layer’s, nothing past the last layer’s end handle will be displayed.

To view the exported presentation:How you view an exported presentation depends upon the export format(s) and what types of files were created.

For HTML files, double-click on the HTML file to launch it in your default browser or open the file from the desired browser.

To play a project in Anark Player, double-click on the Anark Media file (.am) or open it from Anark Player.

Note: Anark Player 2 cannot play Anark Media files created in older versions of Anark Studio (i.e., earlier than Anark Studio 2).

You can preview a screen saver in Windows by selecting it on the Screen Saver tab on the Display Properties control panel and pressing the Preview button.

For video files, double-click on the video file or open it from the desired media player.

Anark_Studio_User_Guide.book Page 182 Monday, March 19, 2007 10:34 AM

Page 191: Anark Studio4 User Guide

User Reference 183

System requirements for viewing a presentation

For projector files, double-click on the executable or application file.

For information about the file types that are created with each of the export formats, see “Exporting a presentation” on page 176.

System requirements for viewing a presentationAnark Media can be viewed in several distribution formats, each of which has its own system requirements.

Anark Client for PC browsersAnark Client installed

Microsoft Windows 98 SE, Windows 2000, Windows Me or Windows XP

PentiumII processor @ 300 MHz (or better)

128 MB of RAM or more

DirectX 7.0 or later installed

Windows Media Player 7 or later installed

Microsoft Internet Explorer 5.0 or later installed

Minimum of 4 MB of free disk space

Anark Player and projector (.exe) for the PC

Microsoft Windows 98 SE, Windows 2000, Windows Me or Windows XP

PentiumII processor @ 300 MHz (or better)

128 MB of RAM or more0

DirectX 7.0 or later installed

Windows Media Player 7 or later installed

Minimum of 4 MB of free disk space

Note: Anark Player must be included with the Anark Media file, but does not have to be installed on the viewer’s computer. See “Preparing Anark Media for a CD-ROM” on page 190 for more information.

Windows screen saverMicrosoft Windows 98 SE, Windows 2000, Windows Me or Windows XP

PentiumII processor @ 300 MHz (or better)

128 MB of RAM or more

DirectX 7.0 or later installed

Windows Media Player 7 or later installed

Microsoft Internet Explorer 5.0 or later installed

Minimum of 4 MB of free disk space

VideoThe video format you choose for export determines the viewer’s system requirements.

Distributing a presentationAs part of your project planning, decide on an export format. Later, export the project and then deploy the exported files. See “Exporting a presentation” on page 176 for more information.

To distribute an Anark Player project, you need to include both the .am file and the AMPlayer.exe (Windows executable) file. Additionally, you can set up a command line or configuration file to control some settings for the presentation. See “Command line and configuration file options (Windows)” on page 192 for more information. If any video, music

Anark_Studio_User_Guide.book Page 183 Monday, March 19, 2007 10:34 AM

Page 192: Anark Studio4 User Guide

184 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

or remotely sourced images are included in the presentation, you will need to make those files available as well. See “Chapter 8: Working with Streaming Media and Dynamic Images” on page 165 for more information.

For Web distribution, you will need to place both the .am file and the .html file on your Web server. If for some reason you need to put the HTML and .am files in different directories, you will have to edit the SRC parameter in the HTML file with the Anark Media file’s new location using the guidelines in “Editing the HTML document” on page 184. If any video, music or remotely sourced images are included in the presentation, you will need to make those files available as well. See “Chapter 8: Working with Streaming Media and Dynamic Images” on page 165 for more information.

For Windows screen savers, you only need to provide the exported .scr file. Including streaming files in screen savers is not recommended because of the very slow playback.

To distribute a video presentation, you only need to provide the exported video file.

To distribute a projector file, just include the .exe file. Additionally, you can set up a command line or configu-

ration file to control some settings for the presentation. See “Command line and configuration file options (Windows)” on page 192 for more information. If any video, music or remotely sourced images are included in the presentation, you will need to make those files available as well. See “Distributing streaming media files” on page 169 for more information.

Editing the HTML documentWhen an Anark Studio presentation is exported to HTML, the correct HTML tags are inserted into the HTML docu-ment. These tags tell the viewer’s browser what plug-in to use to run the specified presentation. Optional settings are available to control some display properties for the browser.

Unless you need to store the .am file in a different directory or on a different server than the HTML file that is created during export, you don’t need to edit any of the properties for the HTML tags, although you may want to change some of the optional settings such as back-ground color.

The HTML document must contain the <OBJECT> tags, including various param-eters, that are required by Internet Explorer on Windows.

Refer to the following example to see which parameters must be included.

Anark_Studio_User_Guide.book Page 184 Monday, March 19, 2007 10:34 AM

Page 193: Anark Studio4 User Guide

User Reference 185

Editing the HTML document

Sample HTML object tags and parameters.

Required OBJECT attributesOBJECT NAME and ID are the name and ID of the Anark Client object. They can be set to anything you want, but when Anark Studio exports a presentation it defaults to player. Keep in mind that if you want to use the ActiveX control properties, you will need to refer back to whatever OBJECT NAME you specified here. See “Working with ActiveX control methods and properties” on page 189 for more information.

CODEBASE will be set to the following http://install.anark.com/client/version4/windows-ie/en/

AMClient.cab#version=4,0,0,35607. It specifies the location of Anark Client so that it can be downloaded if it is not already available on the user’s computer. The version number (in this case, 4,0,0,35607, although it will change with subsequent versions) can be changed to a different version of Anark Client.

CLASSID must be set to CLSID:051D0E35-F4E3-4c8d-B411-AB0875F4C683. This is a unique iden-

tifier for Anark Client that the browser uses to determine what application to use to display the content. If you want to distribute presentations that were created in Anark Studio 3.5 or earlier in Anark Client 4.0, you will need to change the CLASSID. See “Running older presentations in Anark Client 4.0” on page 186 for more informa-tion.

WIDTH and HEIGHT can be set as either a percentage of the browser window, frame or table cell (e.g., width = "100%" height = "100%") or a specific pixel width (as shown). This controls the width and height of the Anark Client container window.

SRC must be set to either the relative path (if on the same server) or the URL (if on a different server) of the Anark Media file, which uses the .am exten-sion. Anark Media files that will be viewed exclusively on Windows machines can also be loaded into the HTML page using the load ActiveX control function. See “Working with ActiveX control methods and proper-ties” on page 189 for more informa-tion.

<OBJECT NAME="player" ID="player" CLASSID="CLSID:051D0E35-F4E3-4c8d-B411-AB0875F4C683"

codebase="http://install.anark.com/client/version4/windows-ie/en/AMClient.cab#version=4,0,0,35607"

width=640 height=480 >

<PARAM NAME="SRC" VALUE="project.am">

<PARAM NAME="BackgroundColor" VALUE="#FFFFFF">

<PARAM NAME="ScaleMode" VALUE="Exact">

<PARAM NAME="PresWidth" VALUE="640">

<PARAM NAME="PresHeight" VALUE="480">

<PARAM NAME="Splash" VALUE="false">

<PARAM NAME="BorderColor" VALUE="#FFFFFF">

</OBJECT>

Anark_Studio_User_Guide.book Page 185 Monday, March 19, 2007 10:34 AM

Page 194: Anark Studio4 User Guide

186 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

Optional attributes for OBJECT tagsScaleMode can be set to Free, Exact or Aspect. This controls the type of window scaling that can be used. Free allows scaling in any direction. Exact disables scaling so that the presenta-tion only displays at an exact pixel size and with the application border. Aspect allows scaling and always maintains the aspect ratio. If you change these values in the HTML document, they will override the Scale Mode settings in Anark Studio.

PresWidth and PresHeight must be set as a specific pixel width. These settings are only used if the ScaleMode has been set to Fixed or Aspect. If you change these values in the HTML document, they will override the Presentation Size settings in Anark Studio.

Splash specifies that a splash screen and progress bar will be displayed while the presentation loads. Defaults to true. Set to false if you don’t want them to be displayed.

BackgroundColor can be set to any standard HTML color string or to a hexadecimal value (0xRRGGBB). This setting only controls the color of the splash screen that is displayed during loading.

BorderColor can be set to any stan-dard HTML color string or to a hexa-decimal value (0xRRGGBB). This setting controls the color of the border between the Anark Client container and the presentation window.

Embedding Anark Media in an existing HTML fileIf you want to embed the Anark Media file in an existing HTML file, just copy

and paste the content of the <OBJECT> tag from the previous section into your HTML file. You can edit or add any optional attributes you want. Make sure that the SRC parameter is set to either the relative path or the URL of the Anark Media file.

Tip: An easy way to copy the proper tags is to export the presentation to HTML, open the generated HTML file with a text editor and copy the complete text of the <OBJECT> tag from the generated file into your existing HTML file. For more infor-mation about exporting to HTML, see “Exporting a presentation” on page 176.

Running older presentations in Anark Client 4.0If you have existing presentations that were created in Anark Studio 3.5 or earlier and you want to distribute them for playback in Anark Client 4.0, it’s a good idea to bring them into Anark Studio 4.0 first. Once they have been saved and exported in Anark Studio 4.0, they will automatically be ready for distribution in Anark Client 4.0.

However, if you don’t want to bring them into Anark Studio 4.0 first, you can edit the CLASSID tag in the existing exported HTML file. Simply change the old CLASSID (CLSID:131EB16C-BD58-443f-8151-6DFBB0DA1778) to the current CLASSID:

051D0E35-F4E3-4c8d-B411-AB0875F4C683

Working with HTML eventsThe Windows version of Anark Client supports three HTML events: onExternalCommand, onProgress and onStateChange.

Anark_Studio_User_Guide.book Page 186 Monday, March 19, 2007 10:34 AM

Page 195: Anark Studio4 User Guide

User Reference 187

Working with HTML events

HTML EventsCommand Values Description

onExternal-Command

( commandString, parameterString )

Provides a connection point in the browser to which an Anark Media file can send commands.ExampleThe following would be entered in the HTML script:<SCRIPT FOR="player" EVENT="onExternalCom mand(command, value)" LANGUAGE="JavaScript">if

(command == "show alert")

{

alert(value);

}

</SCRIPT>You would need to either create an External Command Action using the instructions in “Creating and deleting actions” on page 120, or you could create a behavior script that included the following: externalCommand( "show alert", "Howdy!" )

See the documentation of “externalCommand” on page 209 for more information about how to use externalCommand. Please note, the internal and the external commands are dis-abled unless you possess a valid license key. Please contact your Anark sales representative for licensing information.

onProgress ( readyState, percentageCom-

plete )

Provides a connection point for an Anark Media file to send loading status information to the browser that can be used to display a loading page or a loading status indicator. The readyState value returns the current status of the loading process:

0 = unknown state1 = starting to load2 = in progress 3 = complete4 = loading error

The percentageComplete value returns a number between 0 and 100, indicating the current percentage of the presentation that has been prebuffered. ExampleThe following would be entered in the HTML script:<SCRIPT FOR="player"

EVENT="onProgress(readyState, percentageCom

plete)" LANGUAGE="JavaScript">

if (readyState == 3)

{

alert( "Loading Complete" );

}

</SCRIPT>

Anark_Studio_User_Guide.book Page 187 Monday, March 19, 2007 10:34 AM

Page 196: Anark Studio4 User Guide

188 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

onState-Change

( newState ) Provides a connection point for Anark Client to send informa-tion about its current state to the browser, which can use it to find out whether Anark Client is ready to begin playing or not.0 = unknown state1 = Anark Player is starting up2 = Anark Player is playing3 = Anark Player is paused4 = fatal errorExampleThe following would be entered in the HTML script:<SCRIPT FOR="player"

EVENT="onStateChange( state )" LANGUAGE="JavaS-cript">

if (state == 3)

{

alert( "Paused" );

}

</SCRIPT>

HTML EventsCommand Values Description

Anark_Studio_User_Guide.book Page 188 Monday, March 19, 2007 10:34 AM

Page 197: Anark Studio4 User Guide

User Reference 189

Working with ActiveX control methods and properties

Working with ActiveX control methods and propertiesSeveral Windows ActiveX control methods are available that allow you to communicate with an Anark Media

presentation from an HTML page or other applications that support ActiveX containers. In addition, there are several properties for the ActiveX control object.

ActiveX Control MethodsFunction Values Description

internalCommand ( string, string )

Provides a way for the browser to communicate with an Anark Media file. When this function is called in the HTML script, it generates an event that is passed to the onCom-mand event handler in the Anark Media file.ExampleThe following would be entered in the HTML script.player.internalCommand ( "navigate", "www.yahoo.com")

The following would be entered in the .bvs script.function onCommand( inMsg, inParam )

{

if ( inMsg = "navigate" )

navigate ( inParam );

}See “Using the onCommand function” on page 233 for infor-mation about the onCommand event. Please note, the inter-nal and the external commands are disabled unless you possess a valid license key. Please contact your Anark sales representative for licensing information.

load ( URL ) Loads the specified Anark Media file and begins playing. The URL value should be set to the URL or relative path to the Anark Media file you want to load.Exampleplayer.load( "./Demos/anarkDemo1.am" )

play Plays the currently loaded Anark Media file.Exampleplayer.play( )

stop Stops the currently loaded Anark Media file and rewinds it to the beginning.Exampleplayer.stop( )

restart Restarts the currently loaded Anark Media file from the beginning.Exampleplayer.restart( )

Anark_Studio_User_Guide.book Page 189 Monday, March 19, 2007 10:34 AM

Page 198: Anark Studio4 User Guide

190 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

Preparing Anark Media for a CD-ROM

For the majority of situations, you will probably want to use projector files to

ActiveX Control PropertiesProperty Description

pause Sets the player to pause a presentation. It also returns its current value.Example//set player to pause

player.pause = true;

//assign a variable name to the pause state

var pauseState = player.pause;

splash Specifies whether the Anark splash screen will be displayed while a presentation loads. It also returns its current value. Defaults to true.Example//turn off splash screen

player.splash = false;

//assign a variable name to the splash state

var splashState = player.splash;

state Returns the current state of the Anark Player. This property can be used by other pro-grams that are using the ActiveX control in order to test the state of the Anark Player to find out whether it’s ready to begin playing or not.0 = unknown state1 = Anark Player is starting up2 = Anark Player is playing3 = Anark Player is paused4 = fatal error

loop Specifies whether the presentation should loop. It also returns its current value.0 = false1 = true

length Returns the length of the presentation in milliseconds.

renderer Sets the renderer to be used to play the presentation. It also returns its current value.1 = Auto2 = OpenGL3 = DirectX4 = Software

scaleMode Sets the presentation’s Scale Mode. It also returns its current value. For more infor-mation about the Scale Mode property, see “Editing project settings” on page 19.0 = Scale to fit16 = Fixed size32 = Fixed aspect

rate Sets the clock rate of Anark Player. This affects the speed of the animation for all the objects in the scene. A setting of 2 means animated objects will appear to move twice as fast as normal; a setting of .5 means they will appear to move half as fast as nor-mal, etc. A negative value (e.g., -.3, -2, etc.) makes the scene run backwards. This set-ting does not affect the frame rate of the presentation or how often the scene is updated. It also returns its current value.

Anark_Studio_User_Guide.book Page 190 Monday, March 19, 2007 10:34 AM

Page 199: Anark Studio4 User Guide

User Reference 191

Running a presentation on a CD-ROM by double-clicking

play Anark Media as a standalone appli-cation, on a CD-ROM or in a kiosk. You need to include both the Anark Media data and the Anark Player application that can display it in a single executable file.

When preparing an Anark presentation file for playback on a CD-ROM, consider implementing Auto Run.

To do this, you set up an AutoRun file using the instructions in “Running a presentation on a CD-ROM automati-cally (Windows)” on page 191.

Running a presentation on a CD-ROM by double-clickingDo one of the following:

If you’re distributing your project as a projector file, simply place the exported projector file (.exe) in the desired directory on your CD-ROM. It can be in the root directory or any other directory.

If you’re distributing your project as an Anark Player file, place the .am file (which must be named index.am) and the AMPlayer.exe in the desired direc-tory on your CD-ROM. It can be in the root directory or any other directory.

If you want to customize Anark Player settings, you can create a configuration file (.cfg) in any text editing program (e.g., Wordpad, Notepad, etc.) and name it Startup.cfg. Just include it in the direc-tory with the other files. Configuration file settings are only used by the Windows version of Anark Player. See “Setting up a configuration file for a projector file” on page 195 for more information.

Creating hybrid CD-ROMs that will run on both Windows and Macintosh is a specialized application that requires CD

burning software with that particular capability. A tutorial explaining how to do this is available in the Knowledge Base on the Anark website.

Running a presentation on a CD-ROM automatically (Windows)1. You’ll need to create an AutoRun file.

AutoRun is a feature of the Microsoft Windows operating system that automatically runs an application on the CD-ROM when it is inserted into the drive. To create an AutoRun file, create a new document in any text editing program (e.g., Wordpad, Notepad, etc.) and name it Autorun.inf. Add the following text to the file:

Replace filename.exe with the name of the projector file you want to launch.

2. Save the Autorun.inf file and place it in the root directory of the CD-ROM, along with the .exe projector file.

Note: You can find more infor-mation about creating an AutoRun-enabled CD-ROM on Microsoft’s developer Web site: http://msdn.microsoft.com/.

To customize the AutoRun file (Windows):You can add other command line options to the Autorun.inf file. For example, the following commands would run AMPlayer.exe in full screen mode and would not display a splash screen while loading:

[autorun]

OPEN=filename.exe

[autorun.x86]

OPEN=filename.exe

Anark_Studio_User_Guide.book Page 191 Monday, March 19, 2007 10:34 AM

Page 200: Anark Studio4 User Guide

192 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

[autorun]OPEN=AMPlayer.exe -view Full -disable Splash

[autorun.x86]OPEN=AMPlayer.exe-view Full -disable Splash

See “Command Line Options” on page 193 for a complete listing of commands.

Note: Publishing content in kiosk applications is a specialized proce-dure that is not covered here, although the process for running a projector file would be the same as for a CD-ROM.

Command line and configuration file options (Windows)Several settings for the Windows version of Anark Player and projector files can be controlled using either a configuration file (.cfg) or command line settings in either an AutoRun file or a batch file (.bat). Configuration file and command line settings are only used by the Windows version of Anark Player. Both command line settings and configura-tion file settings will override project settings that were made in Anark Studio (e.g., the presentation size and border color). Command line settings will also override any configuration file settings.

Anark_Studio_User_Guide.book Page 192 Monday, March 19, 2007 10:34 AM

Page 201: Anark Studio4 User Guide

User Reference 193

Command line and configuration file options (Windows)

Command Line OptionsCommand Options Description

-help Displays information about the product. This is only valid when running in a command line interface.

-f, -file Loads the specified file on launch.

-i, -ignore Ignores the configuration file, if any.

-w, -width Sets the width of the Anark Player frame in pixels.

-h, -height Sets the height of the Anark Player frame in pixels.

-pw, -pwidth, -presentationwidth

Sets the width of the presentation in pixels.

-ph, -pheight, -presentationheight

Sets the height of the presentation in pixels.

-s, -scale Free|Exact|Aspect Sets the type of window scaling that can be used.Free – Allows scaling in any direction. Exact – Disables scaling so that the presentation only dis-

plays at an exact pixel size and with the application border.

Aspect – Allows scaling and always maintains the aspect ratio.Defaults to Free.

-v, -view Normal|Full| Compact

Sets the view properties of the window.Normal – Displays the application window and screen

borders. Full – Expands the window to take up the full screen. Compact – Displays without the window borders.Defaults to Normal.

-b, -bordercolor Sets the color of the border surrounding the presentation during playback. Specified as any standard HTML color string (e.g., “yellow,” “green,” etc.) or a hexadecimal value (0xRRGGBB).

-q, -quiet Specifies that the program will not attempt to register the .am file extension on the viewer’s computer. This would apply only to .am files distributed with Anark Player.

-d, -disable Exit, Switch, Splash

Disables certain features for an entire session, even if another presentation without these settings is opened. Exit disables exiting from the program. This option should only be used in kiosk applications where you don’t want the viewer to be able to close the program. Switch disables the viewer’s ability to toggle between viewing modes. Splash disables the display of the load-ing page and status bar. All three options can be used at once.

-coop, -cooperativeMode

0, 1 Specifies whether Anark Client will pause playback when it is in the background. Defaults to 1, which means it will cooperate with the OS and pause playback in order to save processor power for other applications. Setting this to 0 means it will not pause when in the background and will continue to use processor resources.

Anark_Studio_User_Guide.book Page 193 Monday, March 19, 2007 10:34 AM

Page 202: Anark Studio4 User Guide

194 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

Configuration File OptionsSection Keyword Description

Version FileVersion Specifies the version of this file; 1 is currently the only supported value. The FileVersion must be specified in a configuration file.

Presentation File Specifies the name of the presentation file or the path to it.

Width Sets the width of the presentation in pixels.

Height Sets the height of the presentation in pixels.

BorderColor Sets the color of the border surrounding the presentation during playback. Specified as any standard HTML color string (e.g., “yel-low,” “green,” etc.) or a hexadecimal value (0xRRGGBB).

Scale Sets the type of window scaling that can be used. Free – Allows scaling in any direction. Exact – Disables scaling so that the presentation only displays at

an exact pixel size and with the application border. Aspect – Allows scaling and always maintains the aspect ratio.Defaults to Free.

Options View Sets the view properties of the window. Normal – Displays the application window and screen borders. Full – Expands the window to take up the full screen. Compact – Displays without the window borders.Defaults to Normal.

Quiet Specifies that the program will not attempt to register the .am file extension on the viewer’s computer. 0 = off (default); 1 = on.

DisableExit Disables exiting from the program. This option should only be used in kiosk applications where you don’t want the viewer to be able to close the program. 0 = off (default); 1 = on.

DisableSwitching Disables the viewer’s ability to toggle between viewing modes. 0 = off (default); 1 = on.

DisableSplash Disables the display of the loading page and status bar. 0 = off (default); 1 = on.

Width Sets the width of the Anark Player frame in pixels.

Height Sets the height of the Anark Player frame in pixels.

Anark_Studio_User_Guide.book Page 194 Monday, March 19, 2007 10:34 AM

Page 203: Anark Studio4 User Guide

User Reference 195

Setting up a configuration file for a projector file

Setting up a configuration file for a projector fileTo create a configuration file for a projector file, open a new document in any text editing program (e.g., Wordpad, Notepad, etc.) and name it Startup.cfg.

A configuration file can have three sections: [Version], [Presentation] and [Options].

Except for the FileVersion, which must be specified in every configuration file, you only need to specify the settings you want to change from the defaults. For example, the following configuration file allows scaling that maintains the current aspect ratio, displays the presen-tation without window borders and will not ask the user to register the .am file extension.

[Version]

FileVersion = 1

[Presentation]

Scale = Aspect

[Options]View = Compact

Quiet = 1

Note: The disable settings (Disable-Exit, DisableSwitching and Disable-Splash) are persistent for an entire session, so even if the viewer opens another presentation without any disable settings, the previous file’s settings will apply.

Setting up a configuration file for Anark Player (Windows)If you are distributing your project for Anark Player, there are a couple of differ-ences in how you would set up a config-uration file.

Unless a File is specified, Anark Player will look for default.am or index.am in

the root directory, so you either need to name your file one of those names or you need to specify a file name.

For example, the following configura-tion file would run Test.am located within the Content folder. It would also allow scaling in any direction.

[Version]

FileVersion = 1

[Presentation] File = ./Content/Test.am

Scale = Free

Anark Player featuresAnark Player includes several menus and keyboard shortcuts. A Context menu is available on Windows machines when the viewer right-clicks in the Anark Player window.

A Rendering Engine option is also avail-able from the Context menu. It controls how the currently loaded Anark Media presentation will be rendered. The options are the same as for the “Anark Client Context menu” on page 197.

Note: Anark Player 2 cannot play Anark Media files created in older versions of Anark Studio (i.e., earlier than Anark Studio 2).

Menu Options Shortcut

File

Open Ctrl + O

Recent

Exit

View

Normal EscF9

Compact F10

Full Screen F11

ControlPlay/Pause Ctrl + P

Restart Ctrl + R

Help About

Anark_Studio_User_Guide.book Page 195 Monday, March 19, 2007 10:34 AM

Page 204: Anark Studio4 User Guide

196 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

About the Anark Client controlsAnark Client provides both a control panel and a context menu that allow users to control some settings for presentations.

Anark Client Control Panel

The Anark Client Control Panel provides controls for presentation playback, script debugging and automatic updating, and information that can be used for trouble-shooting.

To access the Anark Client Control Panel:From a browser window running an Anark Media application, right-click and select Preferences from the Context menu.

PreferencesClient Version – Allows users to select which version of Anark Client to view or set preferences for. Users who have an older version of Anark Client on their computers in addition to Anark Client 4.0 will have a pulldown menu available.

Preferred Renderer – Controls how Anark Media presentations will be rendered on this computer.

DirectX – Uses DirectX for rendering the scene.

OpenGL – Uses OpenGL for rendering the scene.

Software – Uses software rendering.

For a description of OpenGL, DirectX and Software, see “Setting rendering options” on page 174.

Note: Anark Media presentations that were created in Anark Studio 2.0.1 or earlier have Auto set as their Pre-ferred Renderer.

Automatically check for updates – When enabled, this allows the Anark Client application to check for the latest version of Anark Client. If a newer version is found, the user will be prompted to install the update.

Update Now – Tells Anark Client to immediately check for the latest version of Anark Client. If a newer version is found, the user will be prompted to install the update.

Enable Script Errors – Sets whether or not script errors will be reported to the user when playing a presentation. This setting is useful for debugging custom behavior scripts.

ComponentsThis tab contains information about the currently installed version of Anark Client.

SystemThis tab displays relevant system information such as video card data, driver versions and available OpenGL extensions.

AboutThis tab contains a description of the Anark Client application.

Anark_Studio_User_Guide.book Page 196 Monday, March 19, 2007 10:34 AM

Page 205: Anark Studio4 User Guide

User Reference 197

Anark Client Context menu

Anark Client Context menuThe Anark Client Context menu is avail-able by right-clicking anywhere in an Anark Media presentation.

Restart – Restarts the currently loaded Anark Media file from the beginning.

Pause/Play – If currently playing, then pauses the currently loaded Anark Media file. If currently paused, plays the currently loaded Anark Media file.

Rendering Engine – Controls how the currently loaded Anark Media presenta-tion will be rendered.

OpenGL – Uses OpenGL for rendering the scene.

DirectX – Uses DirectX for rendering the scene.

Software – Uses software rendering.

For a description of OpenGL, DirectX and Software, see “Setting application preferences” on page 17.

Preferences – Opens the Anark Client Control Panel.

Creating SCORM-conformant presentationsSCORM (Sharable Content Object Refer-ence Model) is a set of specifications and standards aimed at making learning content reusable, accessible and interop-erable. Anark Media presentations can easily be made SCORM Version 1.2 conformant (specifically, they are SCO-RTE1-conformant). Currently, SCORM-conformant Anark Media can only be viewed on Windows machines.

SCORM has two essential parts: a SCORM-conformant Learning Manage-ment System (LMS) and the learning unit called a Sharable Content Object (SCO). A SCO is a standardized unit of learning content that typically contains

text and may contain graphics. All SCOs must be able to communicate with an LMS.

An LMS is a system that keeps learner information, can launch and communi-cate with SCOs, and can interpret instructions that tell it which SCO comes next. When set up for SCORM conformance, an Anark Media presenta-tion and its accompanying HTML page become a SCO. As such, they are able to communicate with the Application Protocol Interface (API) provided by an LMS, and issue two commands: LMSIni-tialize and LMSFinish.

A JavaScript file, APIWrapper.js, which is included with the Anark Studio down-load, provides the link between the SCO and the LMS.

The APIWrapper.js file is located in the Anark installation directory inside the Third-party/SCORM folder.

When you are ready to distribute your finished project, you must include three files: the Anark Media file, the HTML file and APIWrapper.js.

To prepare a presentation for SCORM conformance: 1. Import the behavior SCORM.bvs into

the project by dragging it from the Storage palette onto the Library pal-ette. SCORM.bvs is located in the Storage palette under Behavior Lib > Miscellaneous.

2. Drag an instance of the SCORM behavior from the Library onto the object that you want to have start the lesson. This could be either the Scene or an object that will function as a start button.

3. With SCORM selected in the Timeline, set the LMS Message

Anark_Studio_User_Guide.book Page 197 Monday, March 19, 2007 10:34 AM

Page 206: Anark Studio4 User Guide

198 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

property in the Inspector palette to LMSInitialize.

4. Do one of the following:

• If you attached the behavior to the Scene object, set the On Event prop-erty to onAttach.

• If you attached the behavior to an object that will act as a start button, set the On Event property to one of the mouse events: onMouseDown, onMouseUp, onMouseOver, onMouseClick or onMouseOut.

5. Drag a second instance of the SCORM behavior from the Library onto the object that you want to have end the lesson. It’s recom-

mended that you attach it to an object that will function as a “fin-ished” or “done” button.

6. With SCORM selected in the Time-line, set the LMS Message property in the Inspector palette to LMSFinish.

7. Set the On Event property to one of the mouse events: onMouseDown, onMouseUp, onMouseOver, onMouseClick or onMouseOut.

8. Save the presentation by choosing File > Save.

9. Choose File > Export and select Inter-net Explorer under Save as Type. Enter a name and click Save.

Anark_Studio_User_Guide.book Page 198 Monday, March 19, 2007 10:34 AM

Page 207: Anark Studio4 User Guide

User Reference 199

Creating SCORM-conformant presentations

10. Open the HTML that was created along with the .am file and enter the following script within the <BODY> tag:

Note: This code is also viewable from within the comments of SCORM.bvs.

11. Ensure the JavaScript file APIWrap-per.js is located in the same directory as the HTML file that will play the Anark presentation.

<SCRIPT FOR="player" EVENT="onExternalCom mand( command, msg )" LANGUAGE="Javascript" SRC=”APIWrapper.js”></SCRIPT>

Anark_Studio_User_Guide.book Page 199 Monday, March 19, 2007 10:34 AM

Page 208: Anark Studio4 User Guide

200 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

Anark_Studio_User_Guide.book Page 200 Monday, March 19, 2007 10:34 AM

Page 209: Anark Studio4 User Guide

User Reference 201

Creating SCORM-conformant presentations

Anark_Studio_User_Guide.book Page 201 Monday, March 19, 2007 10:34 AM

Page 210: Anark Studio4 User Guide

202 Anark Studio User Guide

Chapter 9Viewing and Distributing Anark Media Files

Anark_Studio_User_Guide.book Page 202 Monday, March 19, 2007 10:34 AM

Page 211: Anark Studio4 User Guide

10

203

Chapter 10: Using Scripting

Scripted behaviors allow you to create completely custom-ized interactive elements for a project. They also can be used to add procedural animation (that is to say, animation based on mathematical formulas) to your project. This creates many exciting possibilities for Anark users who are willing to write scripts.

Animation created in the Anark Studio interface uses static keyframes that control a single parameter for a single moment in time. Procedural animation allows you to create dynamic keyframes that can change based on runtime infor-mation.

This section of the manual explains how to write custom behaviors for Anark Studio. Information about editing existing scripts is covered in “Editing behaviors” on page 73.

Note: Scripted behaviors that operate on a property that has animation set for it in Anark Studio may override those animation settings. See “How behaviors affect animation” on page 237 for more information.

Note: Scrubbing with the Playhead will not execute any behaviors in Anark Studio. To see behaviors being exe-cuted you must either view the final presentation or preview using the F12 key. See “Previewing a presenta-tion” on page 174 for more information.

Anark_Studio_User_Guide.book Page 203 Monday, March 19, 2007 10:34 AM

Page 212: Anark Studio4 User Guide

204 Anark Studio User Guide

Chapter 10Using Scripting

Overview of scriptingAnark Studio behavior scripts use JavaScript™. JavaScript, which conforms to the ECMAScript standard, was developed by Netscape and Sun Microsystems as an open, cross-platform scripting language for the Internet. It’s an object-oriented program-ming language, organized into statements and comments. Objects in object-oriented languages are defined as collections of properties, attributes of properties, and methods (which are functions that are built into the object).

Using Anark Studio, you can create or import all of the built-in objects that are needed for a project, such as layers, cameras, lights, groups, models and materials. You can then attach behavior scripts to add interactivity or highly complex animation to the objects in the project.

Scripting resourcesBefore you start writing scripts, you’ll need to be familiar with JavaScript terminology and syntax. While this section of the manual provides an overview of the syntax and terminology used in Anark Studio scripts, there are numerous in-depth JavaScript tutorials available on the Web, and shelves of books have been written on the subject as well.

Scripting syntax

Dot syntaxA period or dot (.) is used to indicate the properties or methods related to an object. It can also be used to identify the path to a particular object. In the following example, this.parent.position.z = -600; identifies the path to a property of this.parent (in this case, the Z axis position).

this.parent.position.z = -600;

For more information about using this.parent, see “Using the parent property of a behavior” on page 224.

Curly bracesCurly braces ({}) are used to group statements into blocks. Blocks are generally treated as a single statement and are used to define functions and conditionals. In the following example, the items in curly braces are treated as a part of the definition of the function onMouseOver:

function onMouseOver( ){ // Rotate the attached object. this.parent.rotation.x += 5; this.parent.rotation.y += 3; this.parent.rotation.z += 1;

}

Anark_Studio_User_Guide.book Page 204 Monday, March 19, 2007 10:34 AM

Page 213: Anark Studio4 User Guide

User Reference 205

Scripting syntax

Equal signA single equal sign (=) is used to assign values to variables; it is the assignment oper-ator. The variable to the left of the equal sign is assigned the value to the right of the equal sign. In the following example, the Z axis position of fogCamera is set to -600.

scene.backgroundLayer.fogCamera.position.z = -600;

Two equal signs together are the equality operator (==), which is used to compare two values to find out if they are equal. In the following example, this.value will be eval-uated and, if it is exactly equal to 4, LoopMusic will be played. It does not assign the value 4 to this.value.

if (this.value == 4){ LoopMusic.play();

}

ParenthesesParentheses ( ) are used to contain arguments passed to functions and to override the order of precedence for a set of expressions.

When calling a function, ensure that you always include the parentheses and any required arguments. Calling a function without parentheses causes the text of the function to be returned instead of the results of the function.

The following example uses the argument inEvent as a placeholder for all the data collected during the onUpdate function.

function onUpdate( inEvent ){

}

The following example shows how parentheses are used to change the order of prece-dence. In this case, the 2+3 operation will be run before the value it returns is multi-plied by 4:

var bob = ( 4 * (2+3));

SemicolonsSemicolons (;) are used to terminate statements, as in the following examples:

var mxp = Mouse.x;

this.parent.rotation.y += ( mxp - Mouse.x ) / 3;

With the exception of function definitions, use a semicolon after every line to be executed.

Uppercase and lowercase lettersAnark scripts are case sensitive. For this reason, the following two examples are not equivalent:

function Drag( inEvent )

function DRAG ( inEvent )

Anark_Studio_User_Guide.book Page 205 Monday, March 19, 2007 10:34 AM

Page 214: Anark Studio4 User Guide

206 Anark Studio User Guide

Chapter 10Using Scripting

For constructors (e.g., new Array, new Vector, etc.) the first letter of the object type being created must be capitalized. For example:

this.mousePos = new Vector( Mouse.x - 40, -( Mouse.y - 30 ), 0 );

CommentsComments make your scripts easier to read – even for yourself. Use them to add notes to yourself or other programmers, and to document what you intended an action to do. Comments can be specified in two ways. Any amount of text between /* and */ is a comment. Also, any text between // and the end of the current line is a comment. For example:

// this is a single line comment./* This is a multi-linecomment.*/

/*Here's another comment. */ // So is this.

Data typesJavaScript has just a few data types. Because JavaScript is loosely typed, a variable can hold any data type and can be reassigned to a different data type at any time.

NumbersNumbers can be specified as either an integer or a floating-point value. Internally, JavaScript sees all numbers as floating-point numbers. Integers include positive and negative whole numbers and 0. They can be specified as decimal, octal (prefixed by a zero) or hexadecimal (prefixed by zero and a lower or upper case x).

Octal integers can only contain digits 0-7. Hexadecimal integers can contain digits 0-9 and the letters A-F (upper or lower case), which represent digits 10-15. Octal and hexa-decimal numbers cannot be written in exponential notation.

Floating-point numbers are decimal integers followed by a period and the fractional portion of the number. Exponential notation can be used by adding an e or E to the end of a floating-point number followed by a decimal integer that does not exceed 3 digits.

StringsA string is made up of any number of alphanumeric characters or spaces. Strings must be declared by placing the characters in double quotes ("") or single quotes (' '). If one type of quotation mark is part of the actual text, enclose the text in the other type of quotation mark.

BooleanThe Boolean data type can only have two values: true or false. Boolean values are the result of any comparison statement, and they are especially useful in conditional statements.

Anark_Studio_User_Guide.book Page 206 Monday, March 19, 2007 10:34 AM

Page 215: Anark Studio4 User Guide

User Reference 207

Global functions

NullThe Null data type can have only one value: null. If a variable is assigned the value null, then it has no valid data. This can be used to erase the contents of a variable without deleting the variable. Unlike some other languages, null and 0 (zero) are not the same value in JavaScript.

UndefinedThe Undefined data type is returned whenever you use an object property that does not exist or use a variable that has been created but has no assigned value.

ObjectAn object is a compound data type that contains any number of properties and methods. Dot syntax (.) is used to access a named property or method of an object.

ArrayAn array is a compound data type that enables you to store multiple data, based on a numbered position as in an index. The numbering of the index always starts at 0.

Global functionsThe Anark Studio scripting environment includes several global functions that can be called at any time in the script. Global functions provide a way to communicate directly with the user via dialog boxes and alerts and provide a method for communi-cating with the Web browser. They use different syntax than the built-in event handler functions and user-defined functions in that they do not require that you use the function keyword and may require some specific arguments.

Function Arguments Description

alert ( alertString ) Displays a message box containing the alertString text and an OK button. It also causes a beep to sound.Exampleif ( this.parent.type == "Group" )

{

theParticle = theParticleGroup.models[0];

}

else if ( this.parent.type == "Model" )

{

alert("Cannot add this Behavior to a model.");

}

Anark_Studio_User_Guide.book Page 207 Monday, March 19, 2007 10:34 AM

Page 216: Anark Studio4 User Guide

208 Anark Studio User Guide

Chapter 10Using Scripting

confirm ( messageString )

Displays a confirmation dialog box containing the mes-sageString text and OK and Cancel buttons. Examplevar theReturn = confirm ("Do you want to quit?")

if ( theReturn == 1 )

{

play = stop;

}

else

{

play = loop;

}

beep N/A Causes a beep to sound.

prompt ( messageString, defaultText )

Displays a dialog box containing the messageString text and an edit box with the defaultText text. It then returns the text entered in the edit box.Examplevar userName = prompt ("Enter name", "Name" );

alert("Welcome " + userName + "!");

output ( debugString ) Sends the debugString text to either the debug console in Windows or to the console on the Macintosh. It’s useful when debugging an Anark Media presentation. To view the output on a Macintosh, run the Console application (in Utilities). To view the output in Windows, you need to run either a development application or a debugging application such as Sysinternals’ DebugView freeware (available at http://www.sysinternals.com).

Function Arguments Description

Anark_Studio_User_Guide.book Page 208 Monday, March 19, 2007 10:34 AM

Page 217: Anark Studio4 User Guide

User Reference 209

Global functions

externalCommand ( command-String, parame-

terString )

This function is only available on Windows. It provides a way for an Anark Media presentation to communicate with the browser. When this function is called in a behavior script, the strings are passed to the HTML script, where the strings must be defined using the onExternal-Command HTML event. ExampleexternalCommand( "show alert", "Howdy!" )

The following would be entered in the HTML script.<SCRIPT FOR="AnarkClient" EVENT="onExternal

Command(command, value)" LANGUAGE="Java

Script">

if (command == "show alert")

{

alert(value);

}

</SCRIPT>See “Working with HTML events” on page 186 for infor-mation about the onExternalCommand event. Please note, the internal and the external commands are dis-abled unless you possess a valid license key. Please con-tact your Anark sales representative for licensing information.

Function Arguments Description

Anark_Studio_User_Guide.book Page 209 Monday, March 19, 2007 10:34 AM

Page 218: Anark Studio4 User Guide

210 Anark Studio User Guide

Chapter 10Using Scripting

navigate ( URL, navFlags, targetFrame,

postData, headers )

Navigates to the specified URL.ArgumentsURLRequired. Specifies the URL, fully qualified path or UNC (Universal Naming Convention) location of the resource to display.navFlagsOptional. Windows only. Specifies a number that con-trols how the resource will be handled. Flags can be used together in an or statement (i.e., 1 | 2 would specify that the resource should be opened in a new window but should not be added to the history list). 0 = No special handling.1 = Open the resource or file in a new window.2 = Do not add the resource or file to the history list. The new page replaces the current page in the list.10 = If the navigation fails, attempt autosearch of com-mon root domains (.com, .edu, etc.). If this attempt also fails, pass the URL to a search engine.20 = Cause the current browser bar to navigate to the given item, if possible. targetFrameOptional. Windows only. Specifies the name of an HTML frame in which to display the resource or file. If the named frame is not currently available, the document will open in a new window.postDataOptional. Windows only. Specifies data to send to the server during the HTTP POST transaction. For example, the POST transaction is used to send data gathered by an HTML form to a program or script. If this parameter does not specify any post data, the Navigate function issues an HTTP GET transaction. This parameter is ignored if the URL is not an HTTP URL.headersOptional. Windows only. Specifies additional HTTP headers to send to the server. These headers are added to the default Internet Explorer headers. The headers can specify things like the action required of the server, the type of data being passed to the server, or a static code. This parameter is ignored if the URL is not an HTTP URL. Multiple headers can be specified, separated by a semicolon (;). Examplenavigate ( "http://www.anark.com", 0, "MyAnarkWindow");

Function Arguments Description

Anark_Studio_User_Guide.book Page 210 Monday, March 19, 2007 10:34 AM

Page 219: Anark Studio4 User Guide

User Reference 211

Keywords

Keywords

Assigned keywordsThe following keywords have specific uses within the language, so they cannot be used as variables, functions or labels (i.e., constants):

Reserved keywordsThe following keywords are reserved for future uses:

ObjectsObjects in JavaScript are collections of properties, attributes of properties and methods (functions that are built into the object).

JavaScript intrinsic objectsSeveral types of objects are intrinsic to JavaScript. Because these terms have specific uses within the language, they cannot be used as variables, functions or labels:

break do for null try

case delete function return typeof

catch else if switch var

continue eval in this void

debugger false instanceof throw while

default finally new true with

abstract double goto native static

boolean enum implements package super

byte export import private synchronized

char extends int protected throws

class final interface public transient

const float long short volatile

Array Function Math Object

Boolean Global Number RegExp

Date Error String

Anark_Studio_User_Guide.book Page 211 Monday, March 19, 2007 10:34 AM

Page 220: Anark Studio4 User Guide

212 Anark Studio User Guide

Chapter 10Using Scripting

Anark Studio intrinsic objectsAnark Studio has five categories of special intrinsic objects. These objects are collec-tions of properties, methods (i.e., built-in functions) and default values. Most of the object types include instructions for creating a new instance of the object, called a constructor, based on its set of default values and the information passed to the constructor during scripting. The bits of information passed to the constructor are called arguments. For a complete list of the properties, methods and constructor argu-ments for each object type, see “ Scripting Object Reference” on page 243.

The five categories of objects are Assets, Nodes, Utilities, AKEvents and Miscellaneous. Assets are “resource” objects that are either imported into Anark Studio from an external source (such as images) or are created internally (such as the scene). Nodes are a special type of asset that have a physical presence in the scene. Utilities are “helper” objects that allow you to access system data or work with the properties of assets. AKEvents provide access to Event objects, which enable interactivity. The Miscella-neous objects are specialized objects that allow you to work with the time elements of the project and the environment that is executing the presentation.

Because these terms have specific uses within the language, they cannot be used as variables, functions or labels:

Specifying paths in scriptingWhen specifying any kind of file path in scripting, you can use forward slashes or backslashes. If you use backslashes, you must escape the backslashes in order for the path to be read properly.

Either of the following examples would work:

player.container.launch( "explorer .\\Reports\\Data.pdf", 0 )

player.container.launch( "explorer ./Reports/Data.pdf", 0 )

Assets Nodes Utilities AKEvent MiscScene Layer Color LatestEvent Player

Behavior Camera Vector XMLNodeMaterial Light Rotation XMLImage Group Matrix PresentationVideo Model Mouse TimeContextMusic Sound Key Timer*

Window ContainerMemory

* The Timer object is reserved but is not currently accessible.

Anark_Studio_User_Guide.book Page 212 Monday, March 19, 2007 10:34 AM

Page 221: Anark Studio4 User Guide

User Reference 213

Operators

OperatorsOperators are terms and symbols that are used to calculate a new value from one or more values.

Arithmetic OperatorsSymbol Operator Read from… Description

+ Addition L to R Adds the value of one numeric expression to another or concatenates two strings.

-- Decrement R to L Decrements the value of a variable by one. If the operator appears after the variable, the decrement is not per-formed until after the expression has been evaluated. If the operator appears before the variable, the decrement is performed before the expression is evaluated.

/ Division L to R Divides the value of one expression by the value of another.

++ Increment R to L Increments the value of a variable by one. If the operator appears after the variable, the increment is not per-formed until after the expression has been evaluated. If the operator appears before the variable, the increment is performed before the expression is evaluated.

% Modulus L to R Divides the value of one expression by the value of another and returns the remainder.

* Multiplication L to R Multiplies the value of two expressions.

- Subtraction L to R Subtracts the value of one expression from another.

- Unary negation R to L Indicates the negative value of an expression.

Logical OperatorsSymbol Operator Read from… Description

, Comma L to R Causes two expressions to be executed sequentially.

?: Conditional (ternary)

R to L Executes one of two statements depending on a condition.

== Equality L to R Compares two expressions to determine if they are equal.

> Greater than L to R Compares two expressions to determine if one is greater than another.

>= Greater than or equal to

L to R Compares two expressions to determine if one is greater than or equal to another.

=== Identity L to R Compares the value of two expressions to determine if they are equal in value or of the same data type.

!= Inequality L to R Compares the value of two expressions to determine if they are unequal.

< Less than L to R Compares two expressions to determine if one is less than another.

<= Less than or equal to

L to R Compares two expressions to determine if one is less than or equal to another.

&& Logical AND L to R Compares two expressions and, if and only if both return TRUE, it returns TRUE; otherwise, it returns FALSE.

Anark_Studio_User_Guide.book Page 213 Monday, March 19, 2007 10:34 AM

Page 222: Anark Studio4 User Guide

214 Anark Studio User Guide

Chapter 10Using Scripting

Object model overviewAnark Studio uses a Document Object Model (DOM) hierarchy that provides a struc-ture for creating, attaching and accessing all the elements of the project using scripting. Using the object model, you can:

Create new nodes and assets and set attachments for them.

Create objects based on resources in the Anark Studio Library.

Access and set the properties of any object by tracing them down through the

! Logical NOT L to R Performs logical negation of an expression. If the expres-sion evaluates to TRUE, it returns FALSE; if the expres-sion evaluates to FALSE, it returns TRUE.

|| Logical OR L to R Compares two expressions and, if either or both evalu-ates to TRUE, returns TRUE.

!== Nonidentity L to R Compares the value of two expressions to determine if they are not equal in value or of the same data type.

Assignment OperatorsSymbol Operator Read from… Description

= Assignment R to L Assigns the value of an expression to the right of the operator to the variable on the left of the operator.

+= Addition Assignment

R to L Adds the value of an expression to the value of a variable and assigns the result to the variable.

/= Division Assignment

R to L Divides the value of a variable by the value of an expres-sion and assigns the result to the variable.

%= Modulus Assignment

R to L Divides the value of an expression by the value of a vari-able and assigns the remainder to the variable.

*= Multiplication Assignment

R to L Multiplies the value of an expression by the value of a variable and assigns the result to the variable.

-= Subtraction Assignment

R to L Subtracts the value of an expression from the value of a variable and assigns the result to the variable.

Keyword OperatorsOperator Read from… Description

delete R to L Deletes a property from an object or removes an element from an array.

instanceof R to L Returns a Boolean value that indicates whether or not an object is an instance of a particular class.

new R to L Creates a new object.

typeof R to L Returns a string that identifies the data type of an expression.

void R to L Prevents an expression from returning a value.

Logical OperatorsSymbol Operator Read from… Description

Anark_Studio_User_Guide.book Page 214 Monday, March 19, 2007 10:34 AM

Page 223: Anark Studio4 User Guide

User Reference 215

Creating objects using scripting

hierarchy.

Create variable name “handles” for any object to make them easier to access.

Create and access utilities and miscellaneous objects that are not available in the Anark Studio interface.

The following graphic outlines how nodes and assets can be attached and accessed:

This structure is very similar to the tree-view structure of the Object outline in the Anark Studio interface. The primary difference, however, is that the full hierarchy includes the “collections” of object types such as layers, cameras and groups. The collections serve as access points to the hierarchy.

Creating objects using scriptingAny object type that can be added to the Anark Studio Library palette can also be created using scripting.

Scripting object constructor

In the example above, a new camera instance is created. The instance is given the vari-able name this.perspectiveCamera and is attached to MyLayer. The variable name acts as a handle for the object so it can be easily addressed in the script.

Anark_Studio_User_Guide.book Page 215 Monday, March 19, 2007 10:34 AM

Page 224: Anark Studio4 User Guide

216 Anark Studio User Guide

Chapter 10Using Scripting

Note: Because JavaScript cannot access objects by name if they begin with a num-ber, you should avoid naming any object that way. That includes the variable name and the Library asset name.

An object created in scripting will not appear in the Object outline or anywhere else in the Anark Studio interface. The object will appear in the scene only when the behavior script is executed, which is when the F12 button is used or when the final project is viewed. See “Distributing a presentation” on page 183 for more information about viewing the project.

Not all objects that are accessible through scripting require a constructor, because they are always available. These include the Scene, Window, Presentation, Key and Mouse. In addition, the TimeContext object, which provides the clock for independent groups, can only be created using the Anark Studio interface, although it can be accessed through scripting.

For a complete list of the properties, methods, constructors and arguments for each object type, see “ Scripting Object Reference” on page 243.

Using variablesIt’s generally a good idea to create variable names for objects when you create them in scripting. Variables are just conveniently named placeholders for whatever data you assign to them. In scripting, variables are used to create easy-access handles for specific objects, properties of objects or the values currently assigned to a property, and to set the scope for them.

While you can create an object without creating a variable name for it, you would only be able to address it through its parent tree. For example, you could create the fogCamera with the following line.

new Camera ( "fogCamera", "myLayer" );

You would then have to walk down the hierarchy of objects in order to change any property of fogCamera.

scene.myLayer.fogCamera.fov = 90;

Creating a variable name saves you from having to do this and also allows you to set the scope of the object. If you create an object without a variable name, you can always name it later to make it easier to access.

this.fogCamera = scene.myLayer.fogCamera;

Note: Using the this keyword defines the scope of the variable. For more informa-tion about variable scope, see “Defining the scope of objects and variables” on page 218.

Anark_Studio_User_Guide.book Page 216 Monday, March 19, 2007 10:34 AM

Page 225: Anark Studio4 User Guide

User Reference 217

Addressing objects and properties using scripting

Addressing objects and properties using scriptingAs the Object model hierarchy chart on page 215 illustrates, there is a collection of each object type that can be used to access a particular object. The following is an example of a hierarchy tree:

- scene Accesses the scene, which is the root object - layers Accesses the collection of layers - Background Accesses the particular layer instance, Background - groups Accesses the collection of groups - BlueCircles Accesses the particular group instance, BlueCircles - models Accesses the collection of models

- RedSpots Accesses the particular model instance, RedSpots

Most of the time you do not need to use the collections to access the properties of objects. For example, you could access the X position property of the RedSpots model by walking through the parent-child attachments of the instances of objects within the hierarchy.

scene.Background.BlueCircles.RedSpots.x = -300;

In the Anark Studio interface, it would look like this:

More typically, you would create a variable name for the RedSpots model such as this.spotsModel, so that you could access its properties more easily.

this.spotsModel.x = -300;

If, however, you gave any two different type objects the same name in the scene graph, and you didn’t create a variable name for them, you would have to walk through each collection of objects in addition to the instance names in order to get to the particular object you want to reach. For example, if you named both a layer and a group “backgroundGroup,” you would have to access each collection and object.

scene.layers.backgroundGroup.groups.backgroundGroup.position.z = -500;

Because this adds to the complexity of your code and makes it more likely that you could confuse objects, giving different type objects the same name is not recommended.

Likewise, if you gave more than one object of the same type the same name in the scene graph without giving it a variable name (so that you could limit its scope), then it would be difficult to specify which object you wanted to access. Doing so is not recommended unless you are familiar with arrays and accessing objects through their index numbers.

The process of walking down the scene hierarchy to address objects is analogous to using an absolute path. Alternatively, you can use the parent property of objects to

Anark_Studio_User_Guide.book Page 217 Monday, March 19, 2007 10:34 AM

Page 226: Anark Studio4 User Guide

218 Anark Studio User Guide

Chapter 10Using Scripting

create a relative path to an object. See “Using the parent property of a behavior” on page 224 for more information.

Defining the scope of objects and variablesWhen creating variables, it’s important to consider the scope you want each variable to have. Variables can have two levels of scope: local to a function and local to a behavior. In order to avoid scripting errors, you should create elements with as narrow a scope as possible.

Function scopeIf a variable is created with function-level scope, it will be available only to the func-tion that contains it. Function-level scope is created by using the var keyword.

var redBalls = 15

In this example, let’s assume that redBalls was created in an onMouseDown function. You can now create another variable named redBalls in another function in this behavior script and there would be no conflict between the two, thanks to the func-tion-level scope.

Behavior scopeCreating variables with behavior-level scope is the equivalent of creating “class objects” in JavaScript and C++.

Behavior-level scope is created by using the this keyword.

this.redBalls = 15

In this example, redBalls is now a global variable in this script and can be accessed anywhere within it, no matter what function is being called, using the variable name this.redBalls. When used this way, this refers back to the behavior object itself and makes the variable into a property of the behavior script. This means that other scripts can interact with the variable using the object model.

Note: There are a couple of exceptions to this rule. The three special event handlers associated with the XML object (onLoadProgress, onLoadComplete and onLoad-Error) operate differently. When inside a function that uses those event handlers, the this keyword refers to the XML object instead of the behavior object. In addition, when using the Execute Scriptlet action in the Anark Studio interface, this refers to the object that is executing the action. For more information about Scriptlets, see “Selecting an action” on page 125.

Working with the global keywordThe global keyword provides access to the global object where global variables and functions are stored. Any variable created without either the var or this keywords is a global variable. It is used primarily to test whether a specific global variable exists. The Collision Shell behavior script included in the Anark Studio Behavior Library uses the global keyword to test whether there are any already existing collision shells:

function onAttach( )

Anark_Studio_User_Guide.book Page 218 Monday, March 19, 2007 10:34 AM

Page 227: Anark Studio4 User Guide

User Reference 219

Creating dynamic properties for objects

{ var theShells = global._collisionShells || ( global._collisionShells = []);

if ( this.parent.intersect ) { theShells[ theShells.length ] = this; }

Creating dynamic properties for objectsAll Asset objects in Anark Studio can have dynamic properties created for them using dot syntax. When a new property is created, it is added to the object model for that object. In the following example, a new property, squishFactor, is created for the beachBall group.

scene.myLayer.beachBall.squishFactor = 5;

Now squishFactor is a property of the beachBall model, just as position and opacity are. Other scripts and functions can access this property by using the object model in the same way.

Event objects can also have dynamic properties; however, the properties can only be set to the number, string, Boolean and object data types. For a complete list of the available data types in JavaScript, see “Data types” on page 206.

Understanding dynamic objectsDynamic objects are those that have been created using scripting or by dynamically loading a Playback Module, as described in “Loading components dynamically” on page 132.

Note: Loading Anark Playback Modules requires a valid license key. Please contact your Anark sales representative for licensing information.

In scripting, an object created by any of the following methods is a dynamic object:

new Model();Object.copy();Object.load( "foo.am" );

The parent object to which the dynamic object is attached determines several features of the dynamic object:

The duration of the dynamic object is the same as the duration of its parent.

If the parent is on a Master slide, then the dynamic object is also treated as being on the same Master, and its properties are linked across all slides.

If the parent is not on a Master slide then the dynamic object is treated as being on the current slide only.

Anark_Studio_User_Guide.book Page 219 Monday, March 19, 2007 10:34 AM

Page 228: Anark Studio4 User Guide

220 Anark Studio User Guide

Chapter 10Using Scripting

However, if the dynamic object is inside a loaded component (i.e., inside a Playback Module) then its Master/non-Master state is maintained from when it was exported from Anark Studio.

Attaching dynamic objects to componentsA component can have children that are inside the component and therefore share its time context, and children that are outside of it and don’t. When an object is attached to the component in scripting, it attaches from the outside. The only way to attach a dynamic object to the inside of a component is to attach it to an object which is already on the inside of the component.

Animating copied dynamic objectsIf an object has been created by being copied in a behavior script, the animation tracks start at the start time of the parent object and are clipped to the end time of the parent object. If the parent object has already “started,” the animation displays as though it had started along with the parent object.

If the parent object does not have a timebar (because the parent itself is a dynamic object not yet attached to the scene), then when it is attached, the timebar of the child (and all descendants) is synchronized with the new parent.

For example, if an object has an animation track that animates its position.x prop-erty from 0 to 100 over 10 seconds, and a copy of that object is attached to a parent object 4 seconds after the parent started, the object copy should begin at x = 40 units, and continue to move at a rate of 10 units/second.

Understanding how script-controlled properties are handledIf a property for an object is changed using scripting, Anark Client has to decide how to handle the property during playback when moving between slides. Anark Client uses the following rules to determine whether to reset the value to the setting in the Anark Studio Inspector or whether to maintain the value set in the script.

If an object is not on the Master slide, the property reverts to the original setting (the value in the Anark Studio Inspector) when slides change. For example, if the posi-tion of an object is changed on Slide 1, it will reset to the original position on Slide 2.

If the object is on the master slide, the property stays at the scripted value when slides change. An exception to this rule is when the property has different settings in Anark Studio in one slide or more slides (in Anark Studio terms, this means the prop-erty has been “unlinked”). In that case, the property will revert to the value specified in the Anark Studio Inspector when slides change.

These rules apply whether the object was created in Anark Studio or dynamically via scripting.

Anark_Studio_User_Guide.book Page 220 Monday, March 19, 2007 10:34 AM

Page 229: Anark Studio4 User Guide

User Reference 221

Understanding functions

Understanding functionsBehavior scripts are made up of one or more functions, which are procedures that are defined once and can be executed multiple times. Anark Studio scripting provides two different types of built-in functions – global functions and event handler functions – and you can also create your own functions.

Global functions allow you to do things like create HTML links, write simple alert messages, communicate with the Web browser, and jump to a location in the presen-tation, but they do not add true interactivity to the objects in a project. For more information about them, see “Global functions” on page 207.

Event handler functions and user-defined functions are key elements of behavior scripts because they provide the cues for the action and interactivity of the scene.

Creating functionsAll nonglobal function declarations begin with the keyword function, followed by the name of the function. Parentheses are placed after the function name to hold arguments that are to be passed to the function. If more than one argument is needed, use commas to separate them. Curly braces are used to contain the code related to the function.

The following example uses some built-in event handler functions (onAttach, onUp-date, onMouseDown and onMouseUp) and creates two new functions (Drag and Drop). The built-in functions will be called either automatically by the system (onUp-date) or based on user interaction (onMouseDown and onMouseUp), while the newly created functions must be explicitly called in the script in order for them to be executed. A newly created function must be immediately followed by parentheses when called in the script [e.g., Drag ();]. Calling a function without parentheses immediately thereafter causes the text of the function to be returned instead of the results of the function.

For more information about the built-in event handler functions, see “Event handler functions” on page 224.

function onAttach(){

this.mousePos = new Vector;

if ( !this.moveGroup ) { var theBehavior = this; this.parent.detach( theBehavior );

}

if ( this.moveChildren )

{

var numModels = this.parent.models.length;

var theBehavior = this;

for ( i = 0; i < numModels; i ++) {

Anark_Studio_User_Guide.book Page 221 Monday, March 19, 2007 10:34 AM

Page 230: Anark Studio4 User Guide

222 Anark Studio User Guide

Chapter 10Using Scripting

this.parent.models[i].attach( theBehavior.copy() );

}

var numGroups = this.parent.groups.length; for ( i = 0; i < numGroups; i ++) { this.parent.groups[i].attach( theBehavior.copy() ); } }

}

function onUpdate(){ //Make the object move if flag is true if ( this.moving ) { //Move object where mouse is - 400

this.parent.position.x = Mouse.x - 400;

//Move object where Mouse is - 300;

this.parent.position.y = -( Mouse.y - 300 );

//get Difference between subtracted mouse and real position of object this.parent.position.subtract( this.mousePos ); }

}

function Drop( ){ //Turn the onUpdate off this.moving = false;

}

function Drag( inEvent ){ //Record mouse position

this.mousePos = new Vector( Mouse.x - 400, -( Mouse.y - 300 ), 0 );

//Gets difference between the object's position and mouse position

this.mousePos.subtract( this.parent.position );

//Zeroes out Z in the mouse vector after math

this.mousePos.z = 0;

//Set moving flag to true

this.moving = true;

return;

}

Anark_Studio_User_Guide.book Page 222 Monday, March 19, 2007 10:34 AM

Page 231: Anark Studio4 User Guide

User Reference 223

Creating functions

function onMouseDown( ){ //Enables the Drag function Drag(); if ( this.highlight ) { var numMaterials = this.parent.materials.length; for ( i = 0; i < numMaterials; i ++ ) { this.parent.materials[ i ].emissivePower += 50; this.parent.materials[ i ].diffuse.r += 150; this.parent.materials[ i ].diffuse.g += 150; this.parent.materials[ i ].diffuse.b += 150; } }

}

function onMouseUp( ){ //Enables the Drop function Drop(); if ( this.highlight ) { var numMaterials = this.parent.materials.length; for ( i = 0; i < numMaterials; i ++ ) { this.parent.materials[ i ].emissivePower -= 50; this.parent.materials[ i ].diffuse.r -= 150; this.parent.materials[ i ].diffuse.g -= 150; this.parent.materials[ i ].diffuse.b -= 150; } }

}

function onMouseOver( ){ if ( this.highlight ) { var numMaterials = this.parent.materials.length; for ( i = 0; i < numMaterials; i ++ ) { this.parent.materials[ i ].emissivePower += 50; this.parent.materials[ i ].diffuse.r += 150; this.parent.materials[ i ].diffuse.g += 150; this.parent.materials[ i ].diffuse.b += 150; } } }

Anark_Studio_User_Guide.book Page 223 Monday, March 19, 2007 10:34 AM

Page 232: Anark Studio4 User Guide

224 Anark Studio User Guide

Chapter 10Using Scripting

function onMouseOut( ){ if ( this.highlight ) { var numMaterials = this.parent.materials.length; for ( i = 0; i < numMaterials; i ++ ) { this.parent.materials[ i ].emissivePower -= 50; this.parent.materials[ i ].diffuse.r -= 150; this.parent.materials[ i ].diffuse.g -= 150; this.parent.materials[ i ].diffuse.b -= 150; } } }

Using the parent property of a behaviorAs the above example shows, many behavior scripts are written to address and act on generically defined parent and child objects. All assets, including behavior objects, have a “parent” property that can be used to access any parent objects to which the asset is attached. This feature gives you the flexibility to create behaviors that can be attached to any object in a project. For example, a script containing the following function could be attached to any number of groups, models or other objects in a scene and would make any and all rotate when the mouse moved over them.

function onMouseOver ( ){ this.parent.rotation.x += 10;

}

This method of addressing objects is analogous to using a relative path to a file. It makes the script modular, allowing you to reuse it with other objects or even in other presentations.

Note: When using the Execute Scriptlet action in the Anark Studio interface, par-ent refers to the parent of the object that is executing the action. For more infor-mation about Scriptlets, see “Selecting an action” on page 125.

Event handler functionsEvent handler functions provide the cues for the action and interactivity of the scene.

When an event is fired, some information about the event is captured by the system. At the very least, the name of every event is accessible as the name property of every event. Some events capture additional data, such as the position of the mouse during a mouse event, or the specific key that was pressed during a key event. The data is passed to an Event object that can be used to access the data in the form of properties.

Anark_Studio_User_Guide.book Page 224 Monday, March 19, 2007 10:34 AM

Page 233: Anark Studio4 User Guide

User Reference 225

Event handler functions

The following chart contains a list of Anark Studio’s built-in event handler functions and their associated properties. For more information about working with Event objects to access event properties, see “Accessing event information” on page 229.

Function Type of Event

Description Event ObjectProperties

onUpdate Update The event handler executed every time the scene is refreshed. The scene is updated a maximum of 30 times per second on fast machines; on slower machines the refresh rate may be lower. This function has no affiliation with objects or children. It is executed continuously during playback.

deltaTime – Accesses the amount of time in seconds since the scene was last refreshed.

onAttach Attach The event handler executed when a behav-ior is attached to an object.

object – A reference to the object that was attached.

onDetach Attach The event handler executed when a behav-ior is detached from an object.

object – A reference to the object that was detached.

onBuffered Media The event handler executed when a music, video or image file has loaded enough information to make it ready to play or dis-play, but is not yet completed. For music or video buffering, the behavior script that uses this event handler must be attached to the Scene object. For image buffering, it must be attached to either the Scene or the Material object.

object – A reference to the music, video or image file that is being buffered.

onMediaError Media The event handler executed when a music or video file cannot properly load.

object – A reference to the music or video file that failed to load.

onMediaCom-plete

Media The event handler executed when a music or video file has finished playing.

object – A reference to the music or video file that is finished play-ing.

onLoadProgress Loading The event handler fired continuously as a Playback Module is loading.

object – A reference to the object that is load-ing the Playback Mod-ule.percentDone – Accesses the propor-tion of a Playback Module that has com-pleted loading. Range = 0 - 1.loadSource – The URL or file name of the file being loaded.

Anark_Studio_User_Guide.book Page 225 Monday, March 19, 2007 10:34 AM

Page 234: Anark Studio4 User Guide

226 Anark Studio User Guide

Chapter 10Using Scripting

onLoadError Loading The event handler triggered when a Play-back Module cannot properly load.

object – A reference to the object that is load-ing the Playback Mod-ule.loadSource – The URL or file name of the file being loaded.

onLoadComplete Loading The event handler triggered when a Play-back Module has finished loading.

object – A reference to the object that is load-ing the Playback Mod-ule.loadSource – The URL or file name of the file being loaded.

onPlay Time This event is fired when the Scene or Com-ponent begins playing after being set to play. It is not fired when the Scene or Component is first loaded even if its Initial Play State (contextType in scripting) is Play.

onPause Time This event is fired when the Scene or Com-ponent is set to pause. It is not fired when the Scene or Component is first loaded, even if its Initial Play State (contextType in scripting) is Pause.

onLoop Time This event is fired when the Scene or Com-ponent begins looping after being set to loop. It is only fired when the Initial Play State (contextType in scripting) is explic-itly changed. It is not fired when the Scene or Component is first loaded, or when the Scene or Component starts a loop.

Function Type of Event

Description Event ObjectProperties

Anark_Studio_User_Guide.book Page 226 Monday, March 19, 2007 10:34 AM

Page 235: Anark Studio4 User Guide

User Reference 227

Event handler functions

onMouseDblClick Mouse The event handler fired when the mouse is double-clicked on the parent object.

object – A reference to the object to which the mouse event happened.positionX – The X-axis position of the mouse when the event was triggered.positionY – The Y-axis position of the mouse when the event was triggered.

Note: The Mouse object can also be used to access the mouse position. See the sec-tion on the “Mouse” on page 287.

onMouseClick Mouse The event handler fired when the mouse button is both pressed and released while over the parent object.

onMouseDown Mouse The event handler fired when the mouse button is held down over the parent object.

onMouseUp Mouse The event handler fired when the mouse button is released over the parent object.

onMiddleMouse-Click

Mouse The event handler fired when the middle mouse button is both pressed and released while over the parent object.

onMiddleMouse-Down

Mouse The event handler fired when the middle mouse button is held down over the parent object.

onMiddleMou-seUp

Mouse The event handler fired when the middle mouse button is released over the parent object.

onRightMouse-Click

Mouse The event handler fired when the right mouse button is both pressed and released while over the parent object.

onRightMouse-Down

Mouse The event handler fired when the right mouse button is held down over the parent object.

onRightMouseUp Mouse The event handler fired when the right mouse button is released over the parent object.

onMouseOut Mouse The event handler fired when the mouse leaves the parent object.

onMouseOver Mouse The event handler fired when the mouse moves over the parent object.

onGroupedMou-seOut

Mouse The event handler fired when the mouse leaves the parent object. Unlike the onMouseOut event handler, this will not be triggered if the mouse moves from one child to another child of the parent. For example, if the behavior that uses this han-dler is attached to a group that contains a number of models, if the mouse moves off one of the models onto another of the models, onUniqueMouseOut will not be called.

onGroupedMou-seOver

Mouse The event handler fired when the mouse moves over the parent object. Unlike the onMouseOver event handler, this will not be triggered if the mouse moves from one child to another child of the parent. For example, if the behavior that uses this han-dler is attached to a group that contains a number of models, if the mouse moves over one of the models onto another of the models, onUniqueMouseOver will not be called.

Function Type of Event

Description Event ObjectProperties

Anark_Studio_User_Guide.book Page 227 Monday, March 19, 2007 10:34 AM

Page 236: Anark Studio4 User Guide

228 Anark Studio User Guide

Chapter 10Using Scripting

onMouseWheel Mouse The event handler fired when the mouse wheel has been turned (spun) while the mouse is over the presentation window. The behavior that uses this event handler can be attached to any object in the scene (including the Scene object).

object – A reference to the scene object. mouseScroll – The dis-tance that the wheel button has rotated, expressed in multiples of 120. A positive value indicates that the wheel button has rotated away from the user. A negative value indicates that the wheel button has rotated toward the user.

onKeyDown Key The event handler triggered when any key is pressed. The behavior that uses this event handler can be attached to any object in the scene (including the Scene object).

keyCode – The ID of the key that triggered the event.keyChar – The alpha-numeric character that triggered the event. shift – Returns a Bool-ean indicating whether the Shift key was being pressed when the event was triggered.ctrl – Returns a Boolean indicating whether the Control key was being pressed when the event was triggered.caps – Returns a Boolean indicating whether the Caps Lock key was being pressed when the event was triggered.

Function Type of Event

Description Event ObjectProperties

Anark_Studio_User_Guide.book Page 228 Monday, March 19, 2007 10:34 AM

Page 237: Anark Studio4 User Guide

User Reference 229

Accessing event information

Accessing event informationWhen an event takes place, the system calls the corresponding event handler. Infor-mation about the specific event is bundled and passed as an argument to the event handler function. For example:

function onMouseOver ( inEvent )

The first argument within the parentheses becomes an AKEvent object, and holds some specific information from the event that occurred. In this case, the argument is named inEvent, but you can name it whatever you want.

Note: The onCommand event is handled differently from the other event handlers and is documented in “Using the onCommand function” on page 233.

Every AKEvent object has a name property, which is just the name of the event handler function that was executed. In addition, some event handler functions may have several other properties that can be accessed. For a complete list of the available properties, see “Event handler functions” on page 224.

onKeyUp Key The event handler triggered when any key is released. The behavior that uses this event handler can be attached to any object in the scene (including the Scene object).

keyCode – The ID of the key that triggered the event.keyChar – The alpha-numeric character that triggered the event. shift – Returns a Bool-ean indicating whether the Shift key was being pressed when the event was triggered.ctrl – Returns a Boolean indicating whether the Control key was being pressed when the event was triggered.caps – Returns a Boolean indicating whether the Caps Lock key was being pressed when the event was triggered.

onCommand External The event handler executed when an inter-nalCommand event is received from the browser. This event handler works only when the behavior in which it is used is attached to the Scene object.

Function Type of Event

Description Event ObjectProperties

Anark_Studio_User_Guide.book Page 229 Monday, March 19, 2007 10:34 AM

Page 238: Anark Studio4 User Guide

230 Anark Studio User Guide

Chapter 10Using Scripting

Working with mouse events and event bubblingThe information collected in the Event object is sent up through the object model hierarchy. For example, if a model located within a group is clicked on, first the model and then the group receive notice of the mouse event. Next the layer it’s attached to receives notice, and finally the scene is notified. This notification process is called event bubbling.

Event bubbling means that a behavior containing mouse events that is attached to something higher up in the hierarchy (like a group or layer) can be used to affect objects lower down in the hierarchy. For example, you could attach a single behavior to a group that could change the color of the material on any model within the group that received a mouse click. This contrasts with using this.parent, which can only access objects higher up in the hierarchy.

Anark_Studio_User_Guide.book Page 230 Monday, March 19, 2007 10:34 AM

Page 239: Anark Studio4 User Guide

User Reference 231

Cancelling bubbling

In the following example, the only way to make a model glow would be to attach the behavior to each and every model you wanted to glow.

function onMouseOver( ){ this.parent.materials[0].emissivePower = 100;}

function onMouseOut( ){ this.parent.materials[0].emissivePower = 0;

}

Using the Event object, the behavior could be attached to a group or even to a layer to make any model glow when it receives a mouseOver event.

function onMouseOver( inEvent ){ inEvent.object.materials[0].emissivePower = 100;}

function onMouseOut( inEvent ){ inEvent.object.materials[0].emissivePower = 0;

}

However, this method would work a little differently in a couple of cases. The two “grouped” mouse events (onGroupedMouseOver and onGroupedMouseOut) are designed so that they are not called when the mouse moves from one child to another child of the object to which the behavior is attached. If onGroupedMouseOver and onGroupedMouseOut were used, then unless the mouse was moved completely off all objects within the group and then back on again, the glow behavior would only be applied to the first object moused over.

In addition, the mousewheel event (onMouseWheel) is called whenever the mouse wheel is moved while the mouse is over the presentation window. It doesn’t matter whether the mouse is over an actual object.

Cancelling bubblingThere may be occasions when you need to turn off event bubbling. For example, you might want to enable the user to drag a specific object without also dragging the parent object. If you have the following object hierarchy:

MyGroup Draggable.bvs ChildModel

Draggable.bvs

You can ensure that only ChildModel starts dragging when it receives an onMouseDown event by preventing the onMouseDown event from bubbling up the hierarchy. To do this, you need to write an event handler that specifically returns false

Anark_Studio_User_Guide.book Page 231 Monday, March 19, 2007 10:34 AM

Page 240: Anark Studio4 User Guide

232 Anark Studio User Guide

Chapter 10Using Scripting

(as opposed to specifying no return value, which returns undefined) to cancel event bubbling.

function onMouseDown( ){ // Start dragging the object this.startDragging( ); // Cancel bubbling so no ancestor starts dragging return false;

}

A slightly more complex example would achieve the same goal:

function onAttach( ){ registerForEvent( this.parent, "onMouseDown", this.startDragging );}

function startDragging( inEvt ){ registerForEvent( this.parent, "onUpdate", this.dragObject ); this.draggingFlag = true; // Cancel bubbling so no ancestor is dragged return false;}

Understanding the onAttach and onDetach functionsThe three events that cause an object to detach are:

The object is a non-Master object created in Anark Studio that is attached to a master parent, and the slide exits or the timebar ends. Only the first-level non-master object will detach; all of the detached object’s children remain attached to it, although they are now inactive. The child objects will become active again if their parent object is reattached.

The JavaScript theParent.detach( theObject ) method is called.

The JavaScript theNewParent.attach( theObject ) method is called. The object is detached from the old parent before being attached to the new.

Right before an object detaches from its parent, it receives an onDetach event. In the Event object passed to the event handler, the object property points to the object which was detached from its parent. The onDetach event then bubbles down by being passed to every child asset of the object until all descendants have received the event. Each child asset would need to determine if it was itself or an ancestor that was detached by testing the object property of the Event object.

Similarly, there are three events which cause an object to attach:

The object is a Master object and the first slide is entered for the first time.

The object is a non-Master object previously attached to a Master object, and the

Anark_Studio_User_Guide.book Page 232 Monday, March 19, 2007 10:34 AM

Page 241: Anark Studio4 User Guide

User Reference 233

Using the onCommand function

slide is entered and the timebar starts.

The JavaScript someParent.attach( theObject ) method is called.

The onAttach event occurs for an object when it is attached to a new parent. When multiple objects are attached at the same time, the onAttach event for the first item fires after the last item has been attached for that time. This ensures that the entire asset tree in the scene is available to behaviors when a slide is entered. Like the onDe-tach event, attaching a parent object that has existing descendants downward-bubbles the onAttach event to every descendant, with the object property of the Event object always pointing to the object that was attached to a new parent.

Using the onCommand functionThe onCommand function, together with the internalCommand function, provides a way for the browser to communicate with Anark Client. When an internalCommand is executed in the HTML script, an event is passed to Anark Client. The onCommand function receives the strings that were passed to the internalCommand and can be scripted to change a property on an object, execute a function, etc.

For example, the following could be entered in the HTML script:

AnarkClient.internalCommand ( "navigate", "www.yahoo.com")

The .bvs script could then use the following:

function onCommand( inMsg, inParam ){ if ( inMsg == "navigate" ) navigate ( inParam );

}

This function works only when the behavior in which it is used is attached to the Scene object.

Note: The internal and the external commands are disabled unless you possess a valid license key. Please contact your Anark sales representative for licensing information.

Freezing and unfreezing objectsThe frozen property of assets can be used to optimize playback when you have a large number of static objects. When an object is frozen, neither it nor any of its descen-dants are updated for rendering, nor do they receive onUpdate events. This can signif-icantly increase frame rates for large presentations since processing power is saved for rendering dynamic objects exclusively.

Frozen objects are still displayed on the screen in their static state. Behind the scenes, keyframed animation and changes to the object based on interactivity are calculated, but they aren’t rendered. This means that if the object is unfrozen, it may appear to jump to the new value.

Anark_Studio_User_Guide.book Page 233 Monday, March 19, 2007 10:34 AM

Page 242: Anark Studio4 User Guide

234 Anark Studio User Guide

Chapter 10Using Scripting

Frozen objects do send and receive other events and they execute actions, although no visual changes are made to a frozen object until it is unfrozen.

There are a couple of ways to “melt” a frozen object:

If you want the object to be updated continuously again, you can set the frozen property back to false.

If you want the object to melt for a single update cycle you can use the meltOnce method. This will unfreeze the asset and all its descendants during the next update only, and then revert to the frozen state for subsequent frames. Note, however, that the frozen property will remain true for the asset even during the update frame.

While frozen objects aren’t available for user interaction, there is a way to enable them to respond to events and then go immediately back to their static state. To unfreeze an asset for a single update cycle based on user interaction or another event, you can use the registerMeltOnce method. It allows you to register a frozen object for one or more events, including custom events. When the event is fired, the object and all of its descendants will be unfrozen for a single update cycle. As with the meltOnce method, the frozen property will remain true for the objects even during the update frame.

Unfreezing objects for a single frame based on user interaction or a condition being met in a behavior script allows you to optimize playback while maintaining access to frozen assets when needed. A good example of this would be changing the fabric on the seats inside an airplane. The seats could be frozen until the user clicked on a fabric swatch. Their attached materials could be updated during the next frame, and they would then revert back to their frozen state.

Using conditional statementsConditional statements allow your scripts to make decisions about what code to execute based on current conditions. Conditional statements contain one or more expressions that, when evaluated, return either true or false. The decision about what code to execute next is based on the outcome.

ifAn if statement tests a condition, and if the condition meets the test, the appropriate statement is executed. If the condition doesn’t meet the test, the statement is skipped. A simple if statement looks like this:

if (condition)

statement;

In the following example, the name parameter of the object to which the behavior script is attached is evaluated and, if it is “A,” the endZ variable is set to 0.

function onAttach( inEvent ){ if (inEvent.object.name == "A") { this.endZ = 0;

Anark_Studio_User_Guide.book Page 234 Monday, March 19, 2007 10:34 AM

Page 243: Anark Studio4 User Guide

User Reference 235

Using conditional statements

}}

if/elseAn if/else statement tests a condition and, if the condition meets the test, one statement or block is executed; if the condition fails the test, a different statement or block is executed.

A simple if/else statement has the following syntax:

if (condition)statement;else

statement;

In the following example, the name parameter of the object to which the behavior script is attached is evaluated and, if it is “A,” the endZ variable is set to 0; if it is not “A” then endZ is set to 1.

function onAttach( inEvent ){ if (inEvent.object.name == "A") { this.endZ = 0; } else { this.endZ = 1; }}

switchA switch statement executes one or more statements based on whether a given expression’s value matches a constant (as opposed to a variable). These statements are commonly used to test all the possible results of an expression. The basic syntax of switch statements is the following:

switch (expression){ case constant1: statement1; break; case constant2: statement2; break; default: break;

}

The switch statement begins by evaluating an expression placed between paren-theses. The result is then compared to constants associated with case structures that follow. If the result is equal to the constant, the statement(s) in the corresponding

Anark_Studio_User_Guide.book Page 235 Monday, March 19, 2007 10:34 AM

Page 244: Anark Studio4 User Guide

236 Anark Studio User Guide

Chapter 10Using Scripting

case structure are executed. A default structure can be used at the end of a switch structure to catch results that do not match any of the case labels. A colon always follows a label. The keyword break is used to break out of the entire switch state-ment once a match is found.

function onChar (inEvent){ switch (inEvent.keyChar) { case 'A': amodel.visible = true; break; case 'B': bmodel.visible = true; break; case 'C': cmodel.visible = true; break; default: staticgroup.visible = true; break; }

}

Using loopsLoops let you specify that a statement or block be executed repeatedly as long as a condition is met. It is easy to accidentally create endless loop behaviors, so unless that is your intention, be cautious when writing loop statements.

forA for loop provides a structure for looping a statement or block of statements a limited number of times. The basic syntax of for loops is the following:

for (initialize; condition; adjust){ statement;}

The initialize expression sets a starting value for the loop and often declares a variable to contain the value. The condition expression sets how many times the loop will be iterated. The adjust expression determines how the variable, which was initialized in the first part, should be changed each time the loop is iterated. The keyword break can also be used to break out of a for loop. The keyword continue can be used to force the execution of the code to continue at the beginning of the loop.

function Opacity (){ for (var modelIndex = 0; modelIndex < parent.models.length; modelIndex++) { parent.models[modelIndex].opacity = 50; }

Anark_Studio_User_Guide.book Page 236 Monday, March 19, 2007 10:34 AM

Page 245: Anark Studio4 User Guide

User Reference 237

How behaviors affect animation

}

whileA while loop provides a less restrictive structure for looping than for loops because it doesn’t require a limit for the number of times the code will execute. While it allows you to write more complex conditions than for loops, it also makes it easy to write an infinite loop, so make sure you include a way for the condition to be updated so the loop will be able to end.

The basic syntax of while loops is the following:

while (condition){ statement;}

If the condition evaluates to true, then the statement will be executed. Because the condition is evaluated before the statement is executed, if the expression returns false, the statement may never be executed and the loop will never start.

function Rise (){ var modelNum = 0; while(modelNum <=10) { this.parent.position.x += 5; modelNum++; }}

do…whileThe do…while loop works only slightly differently than the while loop in that it executes the statement before evaluating the condition. This means that the statement will always be executed at least once. The basic syntax of do…while loops is the following:

do{ statement;} while (condition);

How behaviors affect animationBehaviors can be written to work with the animation of a property in the Anark Studio interface or to override it. Specifically, a behavior that affects a particular property (e.g., position.x) will override the keyframed animation settings for the same property unless the behavior’s setting is based on runtime information. For example, the following function in a behavior would work cooperatively with the animation settings:

onUpdate ( )

Anark_Studio_User_Guide.book Page 237 Monday, March 19, 2007 10:34 AM

Page 246: Anark Studio4 User Guide

238 Anark Studio User Guide

Chapter 10Using Scripting

{ this.parent.position.x += .03;

}

Each time the scene is redrawn, this function accesses the current value of the X posi-tion of the object this script is attached to and increments it by .03.

The following function would override any animation settings for the same property:

onUpdate ( ) { this.parent.position.x = this.value; this.value += .03;

}

While this function also increments the X position of the object by .03, it does so by first overriding the current setting for the object by setting it to this.value, which it then increments by .03.

Anark_Studio_User_Guide.book Page 238 Monday, March 19, 2007 10:34 AM

Page 247: Anark Studio4 User Guide

User Reference 239

How behaviors affect animation

Anark_Studio_User_Guide.book Page 239 Monday, March 19, 2007 10:34 AM

Page 248: Anark Studio4 User Guide

240 Anark Studio User Guide

Chapter 10Using Scripting

Anark_Studio_User_Guide.book Page 240 Monday, March 19, 2007 10:34 AM

Page 249: Anark Studio4 User Guide

241

Object Reference

The Scripting Object Reference fully documents all the objects that are available in the Anark Studio Document Object Model (DOM), including their associated properties and methods.

Anark_Studio_User_Guide.book Page 241 Monday, March 19, 2007 10:34 AM

Page 250: Anark Studio4 User Guide

Anark_Studio_User_Guide.book Page 242 Monday, March 19, 2007 10:34 AM

Page 251: Anark Studio4 User Guide

Scripting

Object

Reference

243

Scripting Object Reference

This section contains a list of all the properties and methods for each object type. It also includes the arguments for each object constructor.

Anark_Studio_User_Guide.book Page 243 Monday, March 19, 2007 10:34 AM

Page 252: Anark Studio4 User Guide

244 Anark Studio User Guide

Chapter 12Scripting Object Reference

AssetThe Asset object is the base class of all nonutility classes within the Anark Studio system. Examples of assets include Image, Material and all Nodes. Assets have the power to make copies of themselves, as well as have Behaviors attached for interac-tivity. You can create dynamic properties for assets using dot syntax. Assets have the following properties and methods:

Asset Properties

id Returns the unique numeric identifier for this asset.

type Returns the type name for this asset. For example “Image.”

name The user-defined name for this object.

parent Returns the parent object to which this asset belongs.

behaviors Returns the collection of Behavior objects attached to this asset.

sounds Returns the collection of Sound objects attached to this asset.

music Returns the collection of Music objects attached to this asset.

context Returns this asset’s local TimeContext object.

active A Boolean flag that specifies whether this asset and its children should be rendered in the scene as needed. If the flag is false, neither the asset nor any of its children will be drawn in the scene. Defaults to true.

frozen A Boolean flag that specifies whether or not the object and its descendants will be updated for rendering. Unlike an object that is inactive, frozen objects are still rendered, but their properties are not updated. Keyframed animation and changes made to frozen objects based on interactivity are calculated but not rendered. If a frozen object is later unfrozen, it will jump to the appropri-ate value. This property can be used to increase frame rates for presentations that have a large number of static objects.

startLifeTime Returns the starting time in seconds of the asset according to its timebar in the Timeline tab.

endLifeTime Returns the ending time in seconds of the asset according to its timebar in the Timeline tab.

Anark_Studio_User_Guide.book Page 244 Monday, March 19, 2007 10:34 AM

Page 253: Anark Studio4 User Guide

Object Reference 245

Asset

Asset Methods

attach Attaches an asset (e.g., a node, behavior, image, etc.) to the asset. If the attached asset is a behavior, it also begins execution. Syntaxasset.attach ( assetObject )ArgumentsassetObjectThe Asset object that will be attached.

detach Removes a previously attached asset from the asset.Syntaxasset.detach ( assetObject )ArgumentsassetObjectThe Asset object that will be detached.

copy Creates a copy and returns a new asset.Syntaxasset.copy ( )ArgumentsN/A

fireEvent Executes the specified event. The fireEvent method, together with the AKEvent object, allows you to create and execute custom events in scripting.Syntaxasset.fireEvent ( eventObject )ArgumentseventObjectThe AKEvent object that was being listened to.

load Loads the specified .am file and attaches it as a child of the asset. The .am file must be a component that was exported as a Playback Module. See “Export-ing and importing components” on page 60 for more information.Please note, loading Anark Playback Modules requires a valid license key. Please contact your Anark sales representative for licensing information.A component that has been loaded using this method is a dynamic object. Several important features of dynamic objects are controlled by their parents. See “Understanding dynamic objects” on page 219.Syntaxasset.load ( inURL, noBufferSharing )ArgumentsinURLThe URL of the .am file to load. For Web delivery, only HTTP or HTTPS proto-cols can be used. If HTTPS is used, port 443 is used by default. To specify a different port, the URL must be followed by a colon and a port number (e.g., https://www.anark.com:444). If you use backslashes when specifying the URL, they must be escaped. See “Specifying paths in scripting” on page 212 for more information.noBufferSharingOptional. When set to true, specifies that the heavy buffer data from the Playback Module being loaded will not be shared. Defaults to false.

Anark_Studio_User_Guide.book Page 245 Monday, March 19, 2007 10:34 AM

Page 254: Anark Studio4 User Guide

246 Anark Studio User Guide

Chapter 12Scripting Object Reference

meltOnce For assets that have been frozen, this method will cause the asset and all its descendants to unfreeze during the next update only, and then revert to the frozen state for subsequent frames. During the single unfrozen frame, the fro-zen property of the assets will still have the value true. This method can be used on an asset even if one of the asset’s ancestors has been frozen.

registerMelt-Once

For assets that have been frozen, this method will unfreeze the asset for one frame when the listened for event is fired. The unfreezing behaves identically to the meltOnce method.The event that unfroze the asset also fires for the asset during the unfrozen update. This means that any event handlers for the asset will be executed during the update frame.

Syntaxasset.registerMeltOnce ( Event )

ArgumentsEventThe event to be listened for. Any event can be specified, including custom events. More than one event can be specified.ExampletheAsset.registerMeltOnce ( "onMouseDown", "onMouseOver" );

unregisterMelt-Once

For assets that have been set up to melt once using the registerMeltOnce method, this method allows the asset to stop listening for the event. Syntaxasset.unregisterMeltOnce ( Event )ArgumentsEventThe event to stop listening for. Multiple events can be specified; if no events are specified, then the asset will stop listening for all events.

Asset Examples

// Make a copy of an existing image.

theImageCopy = theImage.copy();

// Example of using the type and parent

// properties.

function onUpdate( )

{

if ( parent.type == "Group" )

propagateGroup( parent );

else if ( parent.type == "Model" )

propagateMaterials( parent );

}

Asset Methods

Anark_Studio_User_Guide.book Page 246 Monday, March 19, 2007 10:34 AM

Page 255: Anark Studio4 User Guide

Object Reference 247

Scene

SceneThe scene is the root object, forming an access point to query for data. The scene’s primary property is an ordered list of Layer objects that forms the description of all information to be drawn to the screen. It has no constructor because it is always available.

The scene is different from other assets in that it only shares a few of the properties and methods of assets, as listed in “Asset Properties” and “Asset Methods” on page 245. The scene only has the id and type properties and the attach and detach methods. The attach and detach methods only work with layers when used with the Scene object. In addition, the scene has the following object properties and methods:

BehaviorA Behavior object is a type of asset and represents a collection of scripting statements that control the behavior of objects in a presentation. Behaviors can only be created using the Anark Studio interface by either creating a new empty behavior asset and editing it in the scripting interface, or by importing an existing text file with a .bvs extension. Behaviors may be attached to any object in the scene.

Behaviors have all the properties and methods of assets, as listed in “Asset Properties” and “Asset Methods” on page 245. In addition, behaviors have the following object methods:

Scene Properties

layers Returns the collection of layers that are a part of this scene.

presentation(deprecated)

Returns the currently active Presentation object.

background-Color

Sets the background color for the scene.

Scene Methods

clear Removes all layers from the scene.

Scene Example

// Set the location of the box on a

// particular layer.

scene.layers[0].models.Box.position.x = 100;

Anark_Studio_User_Guide.book Page 247 Monday, March 19, 2007 10:34 AM

Page 256: Anark Studio4 User Guide

248 Anark Studio User Guide

Chapter 12Scripting Object Reference

Behavior Methods

registerForEvent Allows the object to which this behavior is attached to listen for an event on another object in the scene. When the event occurs, the specified function will be executed. If the behavior is detached from its parent, all callbacks reg-istered using this method will automatically be unregistered.SyntaxregisterForEvent ( inAsset, "inEventName", function )ArgumentsinAssetThe asset that will be listened to.inEventNameThe event to be listened for.functionThe function to be executed.

unregisterFor-Event

Allows the object to which this behavior is attached to stop listening for an event it has previously registered for. SyntaxunregisterForEvent ( inAsset, "inEventName", function )ArgumentsinAssetThe asset that was being listened to.inEventNameThe event that was previously registered for.functionThe function that was to be executed.

Behavior Examples

function onAttach()

{

this.line = "hello world!";

registerForEvent( this, "onSomething", doSomething );

registerForEvent( Scene, "onMouseDown", onSceneMouseDown );

}

function doSomething( inEvent )

{

alert( "name: " + inEvent.name + " somethingData: " + inEvent.something-Data ); }

function onSceneMouseDown( inEvent )

{

var theEvent = new AKEvent( );

theEvent.somethingData = "this is something";

theEvent.name = "onSomething";

fireEvent( theEvent );

}

Anark_Studio_User_Guide.book Page 248 Monday, March 19, 2007 10:34 AM

Page 257: Anark Studio4 User Guide

Object Reference 249

Material

MaterialThe Material object is a type of asset that represents the surface of a model and is applied on a per-triangle basis to the geometry.

The scripting object constructor creates an empty Material object. Objects created via scripting are not available to the Anark Studio interface, but they do appear in the finished project.

Scripting object constructor syntaxvar theMaterial = new Material ( "sceneGraphName", attachToObject )

Return valueReturns the new material.

ArgumentssceneGraphName

Optional. The name of the material in the hierarchy of the scene graph.

attachToObject

Optional. The object to which the material will be attached. The material must be attached to a model either now or later in order to appear in the scene during playback.

Materials have all the properties and methods of assets, as listed in “Asset Properties” and “Asset Methods” on page 245. In addition, materials have the following object properties and methods:

Material Properties

maps Returns the collection of images attached as maps to this material.

specularEnable This is a Boolean flag indicating that specularity should be represented on this surface.

specularPower This is a value ranging from 0 to 100 representing the sharpness of the specu-larity. 100 creates a very tight specular highlight. Defaults to 0.

opacity This is a value between 0 and 100, representing the opacity of the object. 100 is completely opaque. Defaults to 100.

culling This property has three possible values representing the type of culling to perform on this object:0 = None.1 = CounterClockwise. Removes the back face of the polygons so that only

the exterior of the material is displayed.2 = Clockwise. Removes the front face of the polygons so that the interior of

the material is displayed rather than the exterior.

specular The color of the specularity of this material.

diffuse The color of the diffuse color of this material.

ambient The color of the ambient color of this material.

emissivePower Specifies the intensity of the emissive property of the material. An emissive material appears to give off its own light.

Anark_Studio_User_Guide.book Page 249 Monday, March 19, 2007 10:34 AM

Page 258: Anark Studio4 User Guide

250 Anark Studio User Guide

Chapter 12Scripting Object Reference

ImageThe Image object is a type of asset that is used for texture maps included in a material description. An image can encapsulate a single picture or can be used to load a series of pictures, allowing for extremely powerful texture mapping behavior.

The scripting object constructor creates an empty Image object. Objects created via scripting are not available to the Anark Studio interface, but they do appear in the finished project.

Scripting object constructor syntaxvar theImage = new Image ( "sceneGraphName", attachToObject )

Return valueReturns the new image.

ArgumentssceneGraphName

Optional. The name of the image in the hierarchy of the scene graph.

attachToObject

Optional. The object to which the image will be attached. Images can only be attached to materials. The image must be attached to a material either now or later in order to appear in the scene during playback.

fillMode Specifies whether the object to which this material is attached should be dis-played as a wireframe, solid or with points for the vertices. Defaults to Solid (0).0 = Solid1 = Wireframe2 = Point

blendMode Controls how the pixels of this material blend with the pixels of the rest of the scene. Blending modes are based on mathematical operations that com-pare the color values of the pixels of this material (the blend color) with the color values of the pixels of whatever else is in the scene that intersects this material (the base color). The opacity of the different materials will also affect the results of the blending mode. For a description of the different blending modes, see “Setting properties for materials” on page 100. 0 = Normal1 = Screen2 = Multiply3 = Overlay4 = Bleach5 = Ghost6 = Saturate

Material Examples

// Create a new material.

theMaterial = new Material( "greenSpots", theModel );

theMaterial.opacity = 0.5;

Material Properties

Anark_Studio_User_Guide.book Page 250 Monday, March 19, 2007 10:34 AM

Page 259: Anark Studio4 User Guide

Object Reference 251

Image

Images have all the properties and methods of assets, as listed in “Asset Properties” and “Asset Methods” on page 245. In addition, images have the following object properties:

Image Properties

height The read-only height of the image in pixels.

width The read-only width of the image in pixels.

visible The flag indicating that this image should be rendered when necessary. When set to false, this image will never appear in any material. Defaults to true.

remoteSource Sets a URL for a JPEG or PNG image file or the fully qualified absolute or rela-tive path to it. See “ Understanding paths for streaming media and dynamic images” on page 166 for more information about specifying the Remote Source property. Additionally, if you use backslashes when specifying the URL, they must be escaped. See “Specifying paths in scripting” on page 212 for more information.

rotation Sets the rotation of this image in degrees. Defaults to 0.

positionU Sets the horizontal offset of this image in normalized units (0 to 1.0). Adjust-ing this will slide the image horizontally. A setting of .5 moves the image over by half of its distance. A setting of 2 moves the image over by twice its distance, which would mean that it is no longer displayed unless tilingMode-Horiz has been enabled.

positionV Sets the vertical offset of this image in normalized units (0 to 1.0). Adjusting this will slide the image vertically. A setting of .5 moves the image over by half of its distance. A setting of 2 moves the image over by twice its distance, which would mean that it is no longer displayed unless tilingModeVert has been enabled.

pivotU Sets the horizontal location of the pivot point of the image on the object. Because the pivot point is calculated in global space, a positionU offset must also be set in order to see a difference in the pivot point in the local space of the image. If the PivotU and PivotV are set to 0, then the pivot point is located in the bottom left hand corner of the model. Specified in values between 0 and 1.0.

pivotV Sets the vertical location of the pivot point of the image on the object. Because the pivot point is calculated in global space, a positionV offset must also be set in order to see a difference in the pivot point in the local space of the image. If the pivotU and pivotV are set to 0, then the pivot point is located in the bottom left hand corner of the model. Specified in values between 0 and 1.0.

repeatU Sets the horizontal scale of this image when applied as a texture map so that it can be repeated on the model (using tiling). Defaults to 1.0.

repeatV Sets the vertical scale of this image when applied as a texture map so that it can be repeated on the model (using tiling). Defaults to 1.0.

tilingModeHo-riz

Sets the horizontal tile mode of this image when used as a texture map.0 = Repeat 1 = Repeat with mirror2 = No tiling

Anark_Studio_User_Guide.book Page 251 Monday, March 19, 2007 10:34 AM

Page 260: Anark Studio4 User Guide

252 Anark Studio User Guide

Chapter 12Scripting Object Reference

tilingModeVert Sets the vertical tile mode of this image when used as a texture map.0 = Repeat 1 = Repeat with mirror2 = No tiling

materialMode Controls how the image is mapped to the material. This is the equivalent of Texture Type in the Anark Studio GUI. For a description of the different material modes, see “Setting properties for images” on page 104.0 = Diffuse Map 1 = Opacity Map2 = Specular Map3 = Emissive Map4 = Light Map5 = SuperCharge Map6 = Negative Map

mappingMode Controls the way the image is wrapped around or projected onto the object. This is the equivalent of Texture Mapping in the Anark Studio GUI. For a description of the different mapping modes, see “Setting properties for images” on page 104.0 = UV Mapping1 = Camera Projection2 = Object Projection3 = Environmental Mapping

mipmapMode Sets the sampling level of mipmapping done on the image.0 = None1 = Bi-linear2 = Tri-linear3 = Tri-linear Anisotropic

mipmapLOD-Bias

Sets the LOD range of the mipmap sampling. Values can be between -3.00 and 3.00.

anisotropyDe-gree

Gets or sets the level of anisotropy to use on the image when in Tri-linear Anisotropic mode.0 = Off1 = Low2 = Medium3 = High

Image Examples

// Create a new image.

var theImage = new Image ( "Brick", theMaterial );

// Set a remote source for the image.

theImage.remoteSource = ./Textures/brick.jpg

// Repeat the image.

theImage.repeatU = 2;

theImage.repeatV = 2;

Image Properties

Anark_Studio_User_Guide.book Page 252 Monday, March 19, 2007 10:34 AM

Page 261: Anark Studio4 User Guide

Object Reference 253

Video

VideoThe Video object is a type of asset that encapsulates a video file, which may contain a snippet of a video or even an entire movie.

The scripting object constructor creates an empty Video object. Objects created via scripting are not available to the Anark Studio interface, but they do appear in the finished project.

Scripting object constructor syntaxvar theVideo = new Video ( "sceneGraphName", attachToObject )

Return valueReturns the new video.

ArgumentssceneGraphName

Optional. The name of the image in the hierarchy of the scene graph.

attachToObject

Optional. The object to which the video will be attached. Videos can only be attached to layers or to materials. The video must be attached to a material either now or later in order to appear in the scene during playback.

Videos have all the properties and methods of assets, as listed in “Asset Properties” and “Asset Methods” on page 245. In addition, videos have the following object prop-erties and methods:

Video Properties

volume Sets the volume of the video’s audio. Values can be between 0 and 100. Defaults to 90, which is 90% of the loudest setting enabled on the end user’s system.

balance The left to right balance of the video audio. Values can be between -100 and 100. Defaults to 0.

loop Sets whether the video will continuously loop. Defaults to true.

remoteSource Sets and returns either the URL of the video file or the fully qualified absolute or relative path to it. See “Understanding paths for streaming media and dynamic images” on page 166 for more information about specifying the Remote Source property. Additionally, if you use backslashes when specifying the URL, they must be escaped. See “Specifying paths in scripting” on page 212 for more information.

buffered Returns a Boolean flag indicating whether or not the video file is buffered and ready to begin playing.

height The read-only height of the video in pixels.

width The read-only width of the video in pixels.

visible The flag indicating that this video should be rendered when necessary. When set to false, this video will never appear in any material. Defaults to true.

rotation Sets the rotation of this video in degrees. Defaults to 0.

Anark_Studio_User_Guide.book Page 253 Monday, March 19, 2007 10:34 AM

Page 262: Anark Studio4 User Guide

254 Anark Studio User Guide

Chapter 12Scripting Object Reference

positionU Sets the horizontal offset of this video in normalized units (0 to 1.0). Adjust-ing this will slide the video horizontally. A setting of .5 moves the video over by half of its distance. A setting of 2 moves the video over by twice its dis-tance, which would mean that it is no longer displayed unless tilingModeHo-riz has been enabled.

positionV Sets the vertical offset of this video in normalized units (0 to 1.0). Adjusting this will slide the video vertically. A setting of .5 moves the video over by half of its distance. A setting of 2 moves the video over by twice its distance, which would mean that it is no longer displayed unless tilingModeVert has been enabled.

pivotU Sets the horizontal location of the pivot point of the video on the object. Because the pivot point is calculated in global space, a positionU offset must also be set in order to see a difference in the pivot point in the local space of the video. If the PivotU and PivotV are set to 0, then the pivot point is located in the bottom left hand corner of the model. Specified in values between 0 and 1.0.

pivotV Sets the vertical location of the pivot point of the video on the object. Because the pivot point is calculated in global space, a positionV offset must also be set in order to see a difference in the pivot point in the local space of the video. If the pivotU and pivotV are set to 0, then the pivot point is located in the bottom left hand corner of the model. Specified in values between 0 and 1.0.

repeatU Sets the horizontal scale of this video when applied as a texture map so that it can be repeated on the model (using tiling). Defaults to 1.0.

repeatV Sets the vertical scale of this video when applied as a texture map so that it can be repeated on the model (using tiling). Defaults to 1.0.

tilingModeHo-riz

Sets the horizontal tile mode of this video when used as a texture map.0 = Repeat 1 = Repeat with mirror2 = No tiling

tilingModeVert Sets the vertical tile mode of this video when used as a texture map.0 = Repeat 1 = Repeat with mirror2 = No tiling

materialMode Controls how the video is mapped to the material. This is the equivalent of Texture Type in the Anark Studio GUI. For a description of the different material modes, see “Setting properties for images” on page 104.0 = Diffuse Map 1 = Opacity Map2 = Specular Map3 = Emissive Map4 = Luminosity Map

Video Properties

Anark_Studio_User_Guide.book Page 254 Monday, March 19, 2007 10:34 AM

Page 263: Anark Studio4 User Guide

Object Reference 255

Music

MusicA Music object is a type of asset, that encapsulates a specific song or music clip. Currently, Music objects may be loaded from .mp2 and .mp3 files.

New music objects can be created via scripting. The scripting object constructor creates an empty Music object. Objects created via scripting are not available to the Anark Studio interface, but they do appear in the finished project.

Scripting object constructor syntaxvar theMusic = new Music ( "sceneGraphName", attachToObject )

Return valueReturns the new music object.

mappingMode Controls the way the video is wrapped around or projected onto the object. This is the equivalent of Texture Mapping in the Anark Studio GUI. For a description of the different mapping modes, see “Setting properties for images” on page 104.0 = UV Mapping1 = Camera Projection2 = Object Projection3 = Environmental Mapping

Video Methods

startBuffering Connects to the specified remoteSource for the video file and begins buffer-ing it.

play Sets the video to start playing.

pause Pauses the video.

stop Stops playback of the video.

seek If the video is currently playing, this method repositions the video to this location and continues playing. If the video is stopped or paused, this method repositions the video to this location but doesn’t begin playing until set to play again. Specified in seconds. This only works with high quality, low compression formats; high compression formats such as MPEG-4 and .wmv do not support seeking.Syntaxvideo.seek ( position )ArgumentspositionThe time in seconds that specifies how far into the video to seek.

Video Examples

// Create a new video and attach it to a material.

var theMovie = new Video ( "Rain", blueMaterial );

// Set a remote source for the video.

theMovie.remoteSource = "./Videos/Rain.mpg";

theMovie.volume = 80;

theMovie.loop = true;

Video Properties

Anark_Studio_User_Guide.book Page 255 Monday, March 19, 2007 10:34 AM

Page 264: Anark Studio4 User Guide

256 Anark Studio User Guide

Chapter 12Scripting Object Reference

ArgumentssceneGraphName

Optional. The name of the music object in the hierarchy of the scene graph.

attachToObject

Optional. The object to which the music will be attached. The Music object must be attached to another object in the scene either now or later in order to appear in the scene during playback.

Music objects have all the properties and methods of assets, as listed in “Asset Proper-ties” and “Asset Methods” on page 245. In addition, Music objects have the following object properties and methods:

Music Properties

volume The volume of the music. Values can be between 0 and 100. Defaults to 100, which is 100% of the loudest setting enabled on the end user’s system.

loop Sets the music to continuously loop. Defaults to true.

balance The left to right balance of the music. Values can be between -100 and 100. Defaults to 0.

duration Returns the length of the music in seconds.

remoteSource Sets and returns either the URL of the music file or the fully qualified abso-lute or relative path to it. See “Understanding paths for streaming media and dynamic images” on page 166 for more information about specifying the Remote Source property. Additionally, if you use backslashes when specifying the URL, they must be escaped. See “Specifying paths in scripting” on page 212 for more information.

buffered Returns a Boolean flag indicating whether or not the music file is buffered and ready to begin playing.

Music Methods

startBuffering Connects to the specified remoteSource for the music file and begins buffer-ing it.

play Starts playing the music.

pause Pauses the music.

stop Stops the music.

seek If the music is playing, repositions to the given location within the music and continues playing. If the music is stopped or paused, repositions to the given location but doesn’t begin playing until set to play again. This method is only valid when the buffered property is true. Specified in seconds.Syntaxmusic.seek ( position )ArgumentspositionThe time in seconds that specifies how far into the music to seek.

Anark_Studio_User_Guide.book Page 256 Monday, March 19, 2007 10:34 AM

Page 265: Anark Studio4 User Guide

Object Reference 257

Node

NodeNodes encompass all objects that may be attached to the layers in the scene. Nodes include: Layer, Camera, Light, Group, Model, Text and Sound. All objects that are types of nodes have the following properties and methods, allowing them to be placed in the scene and their position and rotation manipulated.

Music Examples

// Create a new music object and attach it to the PlayButton component.

var theMusic = new Music ( "Song", PlayButton );

// Set a remote source for the video.

theMusic.remoteSource = ./Tracks/Song.mp3

theMusic.volume = 80;

Node Properties

position The three-element vector describing the location of the object in X, Y and Z.

rotation The three-element rotation describing the rotation of the object about the primary axes X, Y and Z.

scale The three-element vector describing the scale of the object along the primary axes X, Y and Z.

pivot The three-element vector describing the location of the pivot point of the object in X, Y and Z.

cameras Returns the collection of Camera objects attached to this node.

groups Returns the collection of Group objects attached to this node.

lights Returns the collection of Light objects attached to this node.

models Returns the collection of Model objects attached to this node.

text Returns the collection of Text objects attached to this node.

opacity Adjusts the transparency of both the node and all the objects attached to the node. The opacity of nodes has a multiplicative relationship. This means that if a model has an opacity value of 50%, its parent group has an opacity value of 80%, and the parent layer has an opacity value of 50%, the model will actually appear to have an opacity of 20% (50% x 80% x 50% = 20%). If the opacity is set to 0, the object will be drawn in the scene, but will be invisible.

lastGlobalTrans-form

Returns a matrix object describing the object’s position, scale, pivot and rota-tion in global space the last time the scene was updated.

positionVeloc-ity

The three-element vector describing the velocity of the movement of the object in X, Y and Z. Specified in units per second.

rotationVelocity The three-element vector describing the velocity of the rotation of the object in X, Y and Z. Specified in degrees per second.

Anark_Studio_User_Guide.book Page 257 Monday, March 19, 2007 10:34 AM

Page 266: Anark Studio4 User Guide

258 Anark Studio User Guide

Chapter 12Scripting Object Reference

LayerThe Layer object is a special type of group that can only be attached to the Scene. The scene is composed of a number of layers, each layer representing a collection of elements that are grouped together for exclusive display purposes.

Each time the scene is drawn, the layers are drawn in order from back to front, allowing for complex image composition capabilities. When a layer is created, it contains a default camera and a default light. The settings for the default camera and light can be changed, and new cameras and lights (and any other node type) can be created and attached; however, there can only be one active camera for a layer at a given time.

The layer is rendered as a full 3D scene from the viewpoint of its active camera. Layers are independent of other layers, such that the elements on successively ordered layers can never be obscured by elements on previous layers. This behavior allows robust functionality such as complex overlaid menuing systems and elegantly encapsulated media organization.

New layers can be created via scripting. The scripting object constructor creates an empty Layer. Objects created via scripting are not available to the Anark Studio inter-face, but they do appear in the finished project.

Scripting object constructor syntaxvar theLayer = new Layer ( "sceneGraphName", "addToScene" )

Return valueReturns the new layer.

ArgumentssceneGraphName

Node Methods

removeChildren Removes all the children of this node.Syntaxnode.removeChildren ( )ArgumentsN/A

Node Examples

// Create two nodes, a light and camera, and set some

// basic properties for them.

var theLight = new Light( "KeyLight" );

var theCamera = new Camera( "MainCamera" );

//Attach the nodes to the scene

scene.layer.attach( theLight );

scene.layer.attach( theCamera );

//Set some properties.

theLight.position.x = 10;

theLight.position.y = 20;

Anark_Studio_User_Guide.book Page 258 Monday, March 19, 2007 10:34 AM

Page 267: Anark Studio4 User Guide

Object Reference 259

Layer

Optional. The name of the layer in the hierarchy of the scene graph.

addToScene

Optional. This Boolean flag specifies whether this layer will be added to the scene. Currently, true is the only valid setting.

Layers have all the properties and methods of assets, as listed in “Asset Properties” and “Asset Methods” on page 245. They also have all the properties and methods of nodes, as listed in “Node Properties” and “Node Methods” on page 258. In addition, layers have the following object properties:

Layer Properties

x Adjusts the starting position of the layer along the X axis, creating a left mar-gin for it. Specified as a percentage of the total scene width. If the X position is adjusted, any objects located outside the bounds of the layer will be cropped.

y Adjusts the starting position of the layer along the Y axis, creating a top mar-gin for it. Specified as a percentage of the total scene height. Changing the Y position of the layer maintains the aspect ratio of the objects within the space. For example, if an object appears to take up a third of the layer before changing the Y position, it will still appear to take up a third of the layer afterwards.

width Sets the scale of the layer along the X axis. Specified as a percentage of the overall width of the scene.

height Sets the scale of the layer along the Y axis. Specified as a percentage of the overall width of the scene.

pivotX Sets the X position of the pivot point of the layer. Specified as a percentage of the layer size.

pivotY Sets the Y position of the pivot point of the layer. Specified as a percentage of the layer size.

transparent-Background

Controls whether or not the layer will be transparent. When transparent-Background is false, this layer will completely obscure any layers behind it (i.e., that were drawn first). This is different from opacity, which controls only the transparency of the objects that are attached to the layer. Defaults to true.

color Sets the background color for the layer. The background color will only be drawn if the layer has not been set to transparent using transparentBack-ground.

Layer Examples

// Create a new layer.

var theLayer = new Layer( "BackgroundLayer");

//Attach the layer to the scene.

scene.attach( theLayer );

// Add an existing model to a layer.

theLayer.attach( theModel );

Anark_Studio_User_Guide.book Page 259 Monday, March 19, 2007 10:34 AM

Page 268: Anark Studio4 User Guide

260 Anark Studio User Guide

Chapter 12Scripting Object Reference

CameraThe Camera object may be attached to any node, and forms the view through which a particular layer is rendered. Each camera is associated with a specific layer, and can be made active by setting the active property to true. When a layer is rendered as part of a scene, the active camera that is a part of the layer is automatically used as the view-point. Only one camera in a given layer may be active at a time.

New cameras can be created via scripting. The scripting object constructor creates an empty Camera. Objects created via scripting are not available to the Anark Studio interface, but they do appear in the finished project.

Scripting object constructor syntaxvar theCamera = new Camera ( "sceneGraphName", attachToObject )

Return valueReturns the new camera.

ArgumentssceneGraphName

Optional. The name of the camera in the hierarchy of the scene graph.

attachToObject

Optional. The object to which the camera will be attached. The camera must be attached to a layer either now or later in order to appear in the scene during playback.

Cameras have all the properties and methods of assets, as listed in “Asset Properties” and “Asset Methods” on page 245. They also have all the properties and methods of nodes, as listed in “Node Properties” and “Node Methods” on page 258. In addition, cameras have the following object properties:

Camera Properties

clipNear The front clip plane of the camera. Defaults to 10.

clipFar The distance from the camera beyond which nothing is drawn. Defaults to 5,000.

fov The field of view in degrees. Defaults to 90.

orthographic The Boolean flag that, when set to true, turns off perspective rendering.

fogNear The distance from the camera at which fog begins. For more information about how fog is displayed, see “Working with fog” on page 93.

fogFar The distance from the camera at which fog makes everything opaque.

fogEnable The Boolean flag that turns on and off the fog.

fogColor The color of the fog.

lookAtPoint A vector location for the camera to look at.

lookAtLock The Boolean flag that locks the camera to the look at point.

Anark_Studio_User_Guide.book Page 260 Monday, March 19, 2007 10:34 AM

Page 269: Anark Studio4 User Guide

Object Reference 261

Light

LightThe Light object is a type of node, and as such can be added as a child to any other node such as a group or a camera. Lights are added to nodes contained within a layer, and when they are active they illuminate the scene in a variety of ways depending on the settings of their properties. There may be up to 8 simultaneously active lights for each layer.

Lights are sophisticated objects and support many advanced capabilities. Because they are nodes, they have location and rotation properties, and may be dynamically animated to produce stunning effects.

New lights can be created via scripting. The scripting object constructor creates an empty Light. Objects created via scripting are not available to the Anark Studio inter-face, but they do appear in the finished project.

Scripting object constructor syntaxvar theLight = new Light ( "sceneGraphName", attachToObject )

Return valueReturns the new light.

ArgumentssceneGraphName

Optional. The name of the light in the hierarchy of the scene graph.

attachToObject

Optional. The object to which the light will be attached. The light must be attached to a layer either now or later in order to appear in the scene during playback.

Lights have all the properties and methods of assets, as listed in “Asset Properties” and “Asset Methods” on page 245. They also have all the properties and methods of nodes, as listed in “Node Properties” and “Node Methods” on page 258. In addition, lights have the following object properties:

Camera Examples

// Create a new camera.

var theCamera = new Camera( "BackgroundCamera" );

//Attach the camera to an existing layer.

scene.BackgroundLayer.attach( theCamera );

// Set the camera to have white fog.

theCamera.fogColor.r = 255;

theCamera.fogColor.g = 255;

theCamera.fogColor.b = 255;

theCamera.fogEnable = true;

// Set this to be the active camera.

theCamera.active = true;

Anark_Studio_User_Guide.book Page 261 Monday, March 19, 2007 10:34 AM

Page 270: Anark Studio4 User Guide

262 Anark Studio User Guide

Chapter 12Scripting Object Reference

Light Properties

source Sets the type of light source to directional, point or spot.0 = Directional – A Directional light casts light in parallel rays, much like sun-

light hitting the earth.1 = Point – A Point light casts light in all directions from a single point.

Because it emits light equally in all directions, any rotation setting is ignored for this light type.

2 = Spot – A Spot light casts a cone-shaped beam of light from a single point.

brightness The maximum level of light from this light source. This property is only available for Point and Spot lights. Ranges from 0 to 200. Defaults to 100.

outerConeAngle Adjusts the falloff at the edge of the Spot light’s cone of light. This property is only available for Spot lights. Ranges from 0 to 180 degrees. Defaults to 180.

linearFade Adjusts the way and speed at which the light from this light source fades to darkness. If linearFade alone is used, then the light will diminish at a steady rate over the distance specified by the range property. The higher the setting, the faster the fade. expFade can be used as well to create interesting light effects. This setting only affects Point and Spot lights. Range = 0 to 0.1. Default = 0.

expFade Uses an exponential formula and the specified value to control the way and the speed at which the light from this light source fades to darkness. “Real world” light fades exponentially, but it may seem too dark for computer graphics. The higher the setting, the faster the fade. expFade can be used together with linearFade to create interesting light effects. This setting only affects Point and Spot lights. Range = 0 to 0.01. Default = 0.

specular The color of highlights in the scene.

diffuse The color of the light’s direct rays.

ambient The color of indirect light in the scene.

Light Examples

// Create a light.

var theLight = new Light( "KeyLight" );

// Attach the light to an existing layer.

scene.BackgroundLayer.attach( theLight );

// Set the light's diffuse color to green and

// turn it on.

theLight.diffuse.r = 0;

theLight.diffuse.g = 255;

theLight.diffuse.b = 0;

theLight.active = true;

Anark_Studio_User_Guide.book Page 262 Monday, March 19, 2007 10:34 AM

Page 271: Anark Studio4 User Guide

Object Reference 263

Group

GroupA group is the simplest type of node. A typical group acts as a simple placeholder to which other nodes may be attached. Groups are used to organize complex data and move sets of nodes (such as models) as though they are one.

Components are slightly more complex in that they work together with the TimeCon-text object to provide an independent clock for an object or group of objects.

New groups can be created via scripting. The scripting object constructor creates an empty Group object. Objects created via scripting are not available to the Anark Studio interface, but they do appear in the finished project.

Scripting object constructor syntaxvar theGroup = new Group ( "sceneGraphName", attachToObject )

Return valueReturns the new group.

ArgumentssceneGraphName

Optional. The name of the group in the hierarchy of the scene graph.

attachToObject

Optional. The object to which the group will be attached. The group must be attached to an object in the scene either now or later in order to appear in the scene during playback.

Groups have all the properties and methods of assets, as listed in “Asset Properties” and “Asset Methods” on page 245. They also have all the properties and methods of nodes, as listed in “Node Properties” and “Node Methods” on page 258. In addition, groups have the following object properties and methods:

Group Properties

distanceFade Enables “Soft Culling” based on the distance of objects from the camera. When distanceFade is on, objects that are part of the group that are beyond the fadeFar setting will not be rendered at all, while objects that are closer than the fadeNear setting will be fully rendered. Any objects between these ranges will be progressively more transparent. This can be used to optimize rendering speeds of complex presentations with many objects and polygons and can improve the appearance since aliasing of distant objects may be reduced. Defaults to Off.The distanceFade setting applies to all objects in the group; however, if the group contains a subgroup that has distanceFade selected and that has differ-ent settings for fadeNear and fadeFar, those settings will be used for the objects within the subgroup instead. (Turning off the distanceFade setting for the subgroup uses the settings of the parent; it does not disable distanceFade for that subgroup.)

fadeNear Sets the distance where objects begin to fade. Objects closer than this range are not affected by distanceFade at all. Defaults to 200.

fadeFar Sets the culling distance where objects are completely invisible. Objects in the group that are beyond this range are not rendered. Defaults to 300.

Anark_Studio_User_Guide.book Page 263 Monday, March 19, 2007 10:34 AM

Page 272: Anark Studio4 User Guide

264 Anark Studio User Guide

Chapter 12Scripting Object Reference

ModelThe Model object contains geometry to be rendered on the screen and is a specific type of node. Models are the fundamental visible element within a scene. They may be attached to other models, groups or layers, creating a hierarchy.

New models can be created via scripting. The scripting object constructor creates an empty Model object. Objects created via scripting are not available to the Anark Studio interface, but they do appear in the finished project.

Scripting object constructor syntaxvar theModel = new Model ( "sceneGraphName", attachToObject )

Return valueReturns the new model.

ArgumentssceneGraphName

Optional. The name of the model in the hierarchy of the scene graph.

attachToObject

Optional. The object to which the model will be attached. The model must be attached to an object in the scene either now or later in order to appear in the scene during playback.

Models have all the properties and methods of assets, as listed in “Asset Properties” and “Asset Methods” on page 245. They also have all the properties and methods of nodes, as listed in “Node Properties” and “Node Methods” on page 258. In addition, models have the following object properties and methods:

Group Examples

// Create a group.

this.manGroup = new Group( "BodyGroup" );

// Attach the group to an existing layer.

scene.BackgroundLayer.attach( this.manGroup );

// Attach some existing models to the group.

this.manGroup.attach( theHeadModel );

this.manGroup.attach( theTorsoModel );

this.manGroup.attach( theArmsModel );

this.manGroup.attach( theLegsModel );

// Move the entire group of objects.

this.manGroup.position.x = 100;

this.manGroup.position.y = 50;

Model Properties

materials Returns the collection of material objects attached to this model. This is read-only.

Anark_Studio_User_Guide.book Page 264 Monday, March 19, 2007 10:34 AM

Page 273: Anark Studio4 User Guide

Object Reference 265

Model

boxMin Returns a vector representing the minimum vertex of the bounding box for the model. The bounding box for a model is an imaginary cube drawn around it, and each corner of the cube is a vertex. The X, Y and Z values of each vertex are added together and the one with the lowest value is deter-mined to be the boxMin. The boxMin and boxMax properties are typically used in collision detection.

boxMax Returns a vector representing the maximum vertex of the bounding box for the model. The bounding box for a model is an imaginary cube drawn around it, and each corner of the cube is a vertex. The X, Y and Z values of each vertex are added together and the one with the highest value is deter-mined to be the boxMin. The boxMin and boxMax properties are typically used in collision detection.

Model Properties

Anark_Studio_User_Guide.book Page 265 Monday, March 19, 2007 10:34 AM

Page 274: Anark Studio4 User Guide

266 Anark Studio User Guide

Chapter 12Scripting Object Reference

Model Methods

createPrimitive Creates a simple geometric object. This method can only be used with “empty” models (i.e., a model created without specifying a Library asset name). Primitives are created with dimensions of 100x100x100 units. To alter the dimensions, use the scale property.Syntaxmodel.createPrimitive ( primitiveType, subType, resolution, 0 )ArgumentsprimitiveTypeThe type of primitive to be created.1 = Rectangle2 = Sphere3 = Cone4 = Cylinder5 = CubesubTypeSpecifies basic texture mapping for the primitive. Currently, subtypes are supported only on rectangles.0 = Single sided – Maps the material to the rectangle so that only one side, or

“face,” is drawn. If the rectangle is rotated so that the back face is in view, it would appear to be completely transparent.

1 = Mirrored – Maps the material to the rectangle so that it is two-sided, with the image flipped from left to right so that if there were text in the image, it would be readable on both sides.

2 = Double sided – Maps the material to the rectangle so that it is two-sided like a flag, where text would be reversed on the back side. This is the default setting.

resolutionA number used to calculate the number of faces to be applied to the shape.

For rectangles, which are flat planes, a value of 1 is most common.

For spheres, a value of 3 is adequate and a value of 5 creates a smooth sphere.

For cones, a value of 20 creates a smooth cone, while a value of 4 creates a pyramid.

For cylinders, a value of 10 creates a smooth surface while a value of 6 creates a prism shape.

For cubes, a value of 1 is most common.

0This is a placeholder for a currently undefined parameter. This must always be set to 0.

Anark_Studio_User_Guide.book Page 266 Monday, March 19, 2007 10:34 AM

Page 275: Anark Studio4 User Guide

Object Reference 267

Model

intersect Used for collision detection, this function determines whether or not a model has been “hit” by a specified point. SyntaxoutDistanceSquared = model.intersect ( useCulledFaces, globalOrigin, glo-balDirection, distance, intersection, normal )Return valueoutDistanceSquaredEither the distance squared or -1. The distance is defined by the distance argument. If the distance squared is returned, it means the model was hit and the exact hit distance squared is returned. If -1 is returned, it means the model was not hit.ArgumentsuseCulledFacesA Boolean specifying whether you want the model’s culled polygons to be checked for collision. Culling is controlled by the culling property of materials.globalOriginA positional vector in the global 3D space that will be checked for collision with the specified model. globalDirectionA vector specifying the ray direction from the globalOrigin. distanceA floating point number that defines the maximum distance from the global-Origin for an acceptable hit.intersectionReturns the positional vector that specifies the location in global space where the intersection with the model has occurred.normalReturns a directional vector that describes the direction in global space of the normal of the model’s polygon that was intersected.

getNumVertices Returns the number of vertices in the specified model. SyntaxnumVertices = model.getNumVertices ( )Return valuenumVertices Optional. A variable name for the returned number.ArgumentsN/A

getVertex Gets the values of an existing vertex on a model and places them into a ver-tex object. The returned values are unmodified and untransformed; for exam-ple, even if the model has been scaled or rotated, the vertex values that are returned are for the “original” vertex, not the transformed data.Syntaxmodel.getVertex ( inIndex, vertexObject )ArgumentsinIndexThe index location of the vertex on the model whose values you want to access.vertexObjectThe vertex object that will hold the vertex values.

Model Methods

Anark_Studio_User_Guide.book Page 267 Monday, March 19, 2007 10:34 AM

Page 276: Anark Studio4 User Guide

268 Anark Studio User Guide

Chapter 12Scripting Object Reference

setVertex Takes the values of an existing vertex and places them into the vertex at the specified index location on a model. To optimize rendering, this method will not be committed until the applyChanges method has been called.Syntaxmodel.setVertex ( outIndex, vertexObject )ArgumentsoutIndexThe index location of the vertex on the model to which you want to assign the values.vertexObjectThe vertex object whose values will be used.

getVertexPosi-tion

Gets the X, Y and Z coordinate information for a specified vertex on a model and places it into a vector object. The returned values are unmodified and untransformed; for example, even if the model has been scaled or rotated, the vertex values that are returned are for the “original” vertex, not the trans-formed data.Syntaxmodel.getVertexPosition ( inIndex, vectorObject )ArgumentsinIndexThe index location of the vertex whose values you want to access.vectorObjectThe vector object that will hold the position values.

setVertexPosi-tion

Takes a vector object containing the X, Y and Z coordinate information from an existing vector object and places them into the vertex at the specified index location on a model. To optimize rendering, this method will not be committed until the applyChanges method has been called.Syntaxmodel.setVertexPosition ( outIndex, vectorObject )ArgumentsinIndexThe index location of the vertex on the model to which you want to assign the values.vectorObjectThe vector object whose values will be used.

applyChanges Enacts all the setVertex and setVertexPosition methods that have been speci-fied in this behavior.

morph Takes a model and morphs all of its vertices to match those of another model. The models must have an identical number of vertices. A floating point number can be used to modify the amount of change to the original model’s vertices.Syntaxmodel.morph ( modelObject, amount )ArgumentsmodelObjectThe model to be matched.amountA floating point number used to control the amount of change made to the original model’s vertices. For example, a value of .5 would mean the model would only be changed 50%.

Model Methods

Anark_Studio_User_Guide.book Page 268 Monday, March 19, 2007 10:34 AM

Page 277: Anark Studio4 User Guide

Object Reference 269

Text

TextThe Text object is a type of node that displays text. Text objects can be used to create one-word labels, headlines, captions and entire paragraphs of scrollable text.

New text objects can be created via scripting. The scripting object constructor creates an empty Text object. Objects created via scripting are not available to the Anark Studio interface, but they do appear in the finished project.

Scripting object constructor syntaxvar theText = new Text ( "sceneGraphName", attachToObject )

Return valueReturns the new text object.

ArgumentssceneGraphName

Optional. The name of the text object in the hierarchy of the scene graph.

attachToObject

Optional. The object to which the text will be attached. The text object must be attached to an object in the scene either now or later in order to appear in the scene during playback.

Text objects have all the properties and methods of assets, as listed in “Asset Proper-ties” and “Asset Methods” on page 245. They also have all the properties and methods of nodes, as listed in “Node Properties” and “Node Methods” on page 258. In addi-tion, text objects have the following object properties and methods:

Model Examples// Access the first box in a group.

theBox = theGroup.models[0];

// Create a new material.

var theMaterial = new Material ( "greenSwirl" );

theMaterial.diffuse.r = 255;

Text Properties

wordWrap Enables word wrapping so that text automatically wraps to the next line when the text hits the horizontal edge of the text box. This is only available for paragraphs of text.

textType Specifies whether the text will be treated as line text or as a paragraph. 0 = Line – Line text grows or shrinks in length as it’s edited, but it does not

wrap to the next line. The text box will be drawn to accommodate the text without clipping it, although any text that extends past the layer’s borders will not be displayed.

1 = Paragraph – Paragraphs typically contain more than one line of text and will wrap automatically from line to line if the wordWrap property has been enabled.

Anark_Studio_User_Guide.book Page 269 Monday, March 19, 2007 10:34 AM

Page 278: Anark Studio4 User Guide

270 Anark Studio User Guide

Chapter 12Scripting Object Reference

renderStyle Specifies how the text object is rendered.0 = Flat – Renders the text on a plane that cannot be rotated or moved along

the Z axis. The font will remain at the specified font size, even if the text object is scaled up or down or moved forward or backward in Z. The text will always face the camera, even if the text object is rotated.

1 = Depth – Renders the text on a plane that can be moved forward or back-ward on the Z axis, rotated around the Y axis, and scaled along the Z axis. The text will always face the camera, even if the text object is rotated.

2 = Full Perspective – Renders the text on a plane that can be moved along any axis, and can be rotated and scaled.

boxWidth Sets the width of the text box as a proportion of the current layer’s dimen-sions. Text that extends beyond the boundaries of the text box is clipped. Range = 0 to 1.0 Default = .25.

boxHeight Sets the height of the text box as a proportion of the current layer’s dimen-sions. Text that extends beyond the boundaries of the text box is clipped. Range = 0 to 1.0 Default = .25.

textColor Sets the color of the text. Defaults to white ( 255, 255, 255 ).

textString Specifies the text to be displayed.

size If the presentation is resized during playback, Flat text continues to be ren-dered at the specified font size. However, Depth and Full Perspective text are resized if the height of the window is changed. See the section on Presenta-tion Size under “Editing project settings” on page 16 for information about how assets are resized when the playback window is resized.

font Sets the font in which to display the text. Specified as a string. The specified font can be embedded in the finished project file so that it can be displayed on the viewer’s computer even if the font isn’t installed. By default, fonts are not embedded because they greatly increase the file size. To enable font embedding, you must turn on Embed Fonts in the Project Preferences. See “Setting program and project preferences” on page 17 for more information. If fonts are not embedded in the presentation and the viewer does not have a font installed on his or her computer, the text will be displayed in Arial. Also, if no font is specified for a text object, Arial will be used.

horzAlign Determines how paragraph text is positioned between the left and right bor-ders of the text box. 0 = Left – Aligns the text along the left side of the text box.1 = Centered – Centers the text within the text box.2 = Right – Aligns the text along the right side of the text box.

vertAlign Determines how paragraph text is positioned between the top and bottom of the text box. 0 = Top – Aligns the text along the top of the text box.1 = Middle – Centers the text within the text box.2 = Bottom – Aligns the text along the bottom of the text box.

horzScroll Moves the text to the right (by decrementing the value) or to the left (by incrementing the value) in the text box.

vertScroll Moves the text down (by decrementing the value) or up (by incrementing the value) in the text box.

Text Properties

Anark_Studio_User_Guide.book Page 270 Monday, March 19, 2007 10:34 AM

Page 279: Anark Studio4 User Guide

Object Reference 271

Sound

SoundA sound object is a type of node that encapsulates a single sound effect. Currently, Sound objects may be loaded from .wav, .ogg and .aiff files.

The scripting object constructor creates an empty Sound object. Objects created via scripting are not available to the Anark Studio interface, but they do appear in the finished project.

Scripting object constructor syntaxvar theSound = new Sound ( "sceneGraphName", attachToObject )

Return valueReturns the new sound.

ArgumentssceneGraphName

Optional. The name of the sound in the hierarchy of the scene graph.

attachToObject

Optional. The object to which the sound will be attached. The sound must be attached to an object in the scene either now or later in order to appear in the scene during playback.

Sound objects have all the properties and methods of assets, as listed in “Asset Proper-ties” and “Asset Methods” on page 245. They also have all the properties and methods of nodes, as listed in “Node Properties” and “Node Methods” on page 258. In addi-tion, sounds have the following object properties and methods:

useBackColor Controls whether or not the text object will be transparent. When useBack-groundColor is true, the text object will obscure the objects behind it. Defaults to false.

backColor Sets the background color for the text. The background color will only be drawn if the useBackgroundColor property has been enabled.

leading Sets the spacing between lines of text.

tracking Sets the spacing between the characters in a line of text.

Sound Properties

soundType Sets the type of sound to normal, polyphonic or point.0 = Normal – A Normal sound is played at the specified volume and balance

settings.1 = Polyphonic – A Polyphonic sound can be played multiple times simulta-

neously. This feature would most typically be used with a behavior that calls on the sound based on user actions such as clicking on a button. For example, if the user clicked a button several times in a row, the sound would be played over itself each time.

volume Sets the volume of the sound. Values can be between 0 and 100. Defaults to 100, which is 100% of the loudest setting enabled on the end user’s system. This setting is ignored for Point sounds.

Text Properties

Anark_Studio_User_Guide.book Page 271 Monday, March 19, 2007 10:34 AM

Page 280: Anark Studio4 User Guide

272 Anark Studio User Guide

Chapter 12Scripting Object Reference

UtilityA utility is an object that either accesses data about the presentation (Mouse, Key, Window, and Memory) or manipulates objects in the project (Vector, Vector2, Vertex, Rotation and Color). Utilities have no shared properties or methods.

ColorThe Color object encapsulates a four-component true color.

Constructor syntaxvar theColor = new Color ( r, g, b, a)

Return valueReturns the new color.

Argumentsr

Optional. The red component of the color containing a value between 0 and 255.

g

Optional. The green component of the color containing a value between 0 and 255.

b

loop Sets the sound to continuously loop. Defaults to true.

balance The left to right balance of the sound. Values can be between -100 and 100. Defaults to 0. This setting is ignored for Point sounds.

duration Returns the length of the sound in seconds.

Sound Methods

play Starts playing the sound.

pause Pauses the sound.

stop Stops the sound.

seek If the sound is playing, reposition to a certain location within the sound and continue playing. If the sound is stopped or paused, reposition to this loca-tion but don't begin playing until set to play again. Specified in seconds.Syntaxsound.seek ( position )ArgumentspositionThe time in seconds that specifies how far into the sound to seek.

Sound Examples

// Create a new sound.

var theSound = new Sound( "Beep", BackgroundLayer );

theSound.play();

Sound Properties

Anark_Studio_User_Guide.book Page 272 Monday, March 19, 2007 10:34 AM

Page 281: Anark Studio4 User Guide

Object Reference 273

Color

Optional. The blue component of the color containing a value between 0 and 255.

a

Optional. The alpha component of the color containing a value between 0 and 255. This property is not used in some color contexts.

Colors have the following object properties:

Color Properties

r The red component of the color containing a value between 0 and 255.

g The green component of the color containing a value between 0 and 255.

b The blue component of the color containing a value between 0 and 255.

a The alpha component of the color containing a value between 0 and 255. This property is not used in some color contexts.

Color Methods

copy Creates an exact copy of the Color object. SyntaxnewColor = color.copy ( ) Return valuenewColorA variable name for the copy of the color.ArgumentsN/A

add Adds the given color to the current color. Syntaxcolor.add ( colorObject )ArgumentscolorObjectThe Color object to be added to the current color.

subtract Subtracts the RGBA components of the given color from the current color. Syntaxcolor.subtract ( colorObject ) ArgumentscolorObjectThe color to be subtracted from the current color.

blend Blends the RGBA components of the given color into the components of the current color by multiplying each component together.Syntaxcolor.blend ( colorObject ) ArgumentscolorObjectThe color to blend into the current color.

Anark_Studio_User_Guide.book Page 273 Monday, March 19, 2007 10:34 AM

Page 282: Anark Studio4 User Guide

274 Anark Studio User Guide

Chapter 12Scripting Object Reference

negative Changes the color value to be its negative. The RGBA color components are modified by subtracting 1.0 from each component’s value to produce the color negative. Syntaxcolor.negative ( ) ArgumentsN/A

scale Multiplies each the RGBA components of the color by the given factor to pro-duce a scaled version of the original color. If the scale factor is 1.0, then the result is the original color.Syntaxcolor.scale ( scaleFactor ) ArgumentsscaleFactorThe scale factor by which each color component is multiplied. If the value is 1.0, the color will not be changed.

contrast Changes the contrast of the color value. The RGB components of the color are modified by linearly interpolating the component between 50% gray and its current value using the following formula: new = 0.5 + Contrast * (current - 0.5) Where Contrast is the weighting factor of the interpolation. If Contrast is 0.0, then the color becomes 50% gray. If it is 1.0, then the new color is the same as the original. If it is greater than 1.0, then the contrast is increased. Syntaxcolor.contrast ( contrastValue ) ArgumentscontrastValueThe weighting factor for altering the color’s contrast.

saturation Changes the saturation of the color value. The RGB components of the color are modified by linearly interpolating the component between an unsaturated value and its current value using the fol-lowing formula: Approximate values for each component's contribution to luminance are based upon the NTSC standard described in ITU-R Recommendation BT.709.gray = current.red * 0.2125 + current.green * 0.7154 + current.blue * 0.0721 new = gray + Saturation * (current - gray) Where Saturation is the weighting factor of the interpolation. If Saturation is 0.0, then the color becomes grayscale. If it is 1.0, then the new color is the same as the original. If it is greater than 1.0, then the color’s saturation is increased.Syntaxcolor.saturation ( saturationValue ) ArgumentssaturationValueThe weighting factor for altering the color’s saturation.

Color Methods

Anark_Studio_User_Guide.book Page 274 Monday, March 19, 2007 10:34 AM

Page 283: Anark Studio4 User Guide

Object Reference 275

Vector

VectorA vector is a Utility object encapsulating the three floating point components X, Y and Z.

Constructor syntaxvar theVector = new Vector ( x, y, z )

Return valueReturns the new vector.

Arguments

x

Optional. The floating point value representing the X position.

y

Optional. The floating point value representing the Y position.

linear Performs a linear interpolation between the current color and the specified color, treating both as 4D vectors. The current color acts as the source of the interpolation and Color acts as the target. The interpolation of each component uses the following formula: new = current + Weight * (current - Color) Where Weight is the weighting factor for the interpolation. If Weight is 1.0, then the color remains the current color. If it is 0.0, then the new color is the same as Color. This is the reverse of the way the linear property of vectors works.Syntaxcolor.linear ( targetColor, weightValue ) ArgumentstargetColorThe Color object that is the target color. weightValueThe weighting factor for the interpolation.

equals Calculates and returns whether or not the current color is equal to the given color.SyntaxisEqual = color.equals ( compareColor ) Return valueisEqualA variable name for the returned value.ArgumentscompareColorThe Color object to be compared to the current color.

Color Examples

// Create a color.

var theColor = new Color();

// Set the color to red.

theColor.r = 255;

Color Methods

Anark_Studio_User_Guide.book Page 275 Monday, March 19, 2007 10:34 AM

Page 284: Anark Studio4 User Guide

276 Anark Studio User Guide

Chapter 12Scripting Object Reference

z

Optional. The floating point value representing the Z position.

The Vector object has the following properties and methods:

Vector Properties

x The floating point value representing X.

y The floating point value representing Y.

z The floating point value representing Z.

Vector Methods

copy Creates an exact copy of the Vector object. SyntaxnewVector = vector.copy ( ) Return valuenewVectorA variable name for the copy of the vector.ArgumentsN/A

setVector Sets the X, Y and Z values of the vector to the values of the vector supplied as an argument. Syntaxvector.setVector ( vectorObject ) ArgumentsvectorObjectThe Vector object whose values will be used.

add Adds the given vector to the current vector. Syntaxvector.add ( vectorObject )ArgumentsvectorObjectThe Vector object to be added to the current vector.

subtract Subtracts the given vector from the current vector. Syntaxvector.subtract ( vectorObject ) ArgumentsvectorObjectThe vector to be subtracted from the current vector.

set Sets the X, Y and Z values of the vector to the given values. Syntaxvector.set ( X, Y, Z ) ArgumentsXRequired. The floating point value representing the X position.YRequired. The floating point value representing the Y position.ZRequired. The floating point value representing the Z position.

Anark_Studio_User_Guide.book Page 276 Monday, March 19, 2007 10:34 AM

Page 285: Anark Studio4 User Guide

Object Reference 277

Vector

dot Calculates and returns the dot product of the current vector and the vector supplied as an argument. Syntaxproduct = vector.dot ( vectorObject ) Return valueproductA variable name for the returned product.ArgumentsvectorObjectThe vector that is used to calculate the dot product.

scale Multiplies each component of the current vector by the given factor. Syntaxvector.scale ( scaleFactor ) ArgumentsscaleFactorThe scale factor applied to each component of the vector.

cross Modifies the current vector to be the cross product of the current vector and the vector supplied as an argument. Syntaxvector.cross ( vectorObject ) ArgumentsvectorObjectThe vector that is used to calculate the cross product.

equals Calculates and returns whether or not the current vector is equal to the given vector.SyntaxisEqual = vector.equals ( compareVector ) Return valueisEqualA variable name for the returned value.ArgumentscompareVectorThe Vector object to be compared to the current vector.

length Calculates and returns the length (magnitude) of the current vector. SyntaxvectorLength = vector.length ( ) Return valuevectorLengthA variable name for the magnitude of the vector.ArgumentsN/A

lengthSquared Calculates and returns the squared length (squared magnitude) of the current vector. SyntaxsquaredVectorLength = vector.length ( ) Return valuesquaredVectorLengthA variable name for the squared magnitude of the vector.ArgumentsN/A

Vector Methods

Anark_Studio_User_Guide.book Page 277 Monday, March 19, 2007 10:34 AM

Page 286: Anark Studio4 User Guide

278 Anark Studio User Guide

Chapter 12Scripting Object Reference

normalize Normalizes the current vector, making it a unit vector. The normalized vector is defined to be: NormVector = vector / Magnitude(V) Syntaxvector.normalize ( ) ArgumentsN/A

distance Calculates and returns the distance between the current vector and the given vector. SyntaxvectorDistance = vector.distance ( compareVector ) Return valuevectorDistanceA variable name for the distance between the vectors.ArgumentscompareVectorThe Vector object to be compared to the current vector.

distanceSquared Calculates and returns the squared distance between the current vector and the given vector. SyntaxsquaredVectorDistance = vector.distanceSquared ( compareVector ) Return valuesquaredVectorLengthA variable name for the squared distance between the vectors.ArgumentscompareVectorThe Vector object to be compared to the current vector.

maxVector Modifies the current vector to contain elements that are the maximum between the given vector and the current vector.Syntaxvector.maxVector ( compareVector ) ArgumentscompareVectorThe Vector object whose elements are tested against the current vector to build the maximum.

minVector Modifies the current vector to contain elements that are the minimum between the given vector and the current vector. Syntaxvector.minVector ( compareVector ) ArgumentscompareVectorThe Vector object whose elements are tested against the current vector to build the minimum.

Vector Methods

Anark_Studio_User_Guide.book Page 278 Monday, March 19, 2007 10:34 AM

Page 287: Anark Studio4 User Guide

Object Reference 279

Vector2

Vector2A vector2 is a Utility object encapsulating two floating point components X and Y. In Anark Media, a vector2 provides texture coordinates for images. Texture coordinates are often called UV coordinates.

Constructor syntaxvector2 = new Vector2 ( x, y )

Return valueReturns the new two-dimensional vector.

Arguments

x

Optional. The floating point value representing the X position.

y

Optional. The floating point value representing the Y position.

linear Modifies the current vector by performing a linear interpolation between the current vector and the given vector. The interpolation is created using the following formula: NewVector = OrigVector + InterpParam( Vector2 - OrigVector )Syntaxvector.linear ( compareVector, interpParam ) ArgumentscompareVectorThe Vector object that acts as the second vector for the interpolation. interpParamA floating point number used for the interpolation.

transform Transforms the current vector by the given transform matrix. The current vector is made into a 4D vector by setting w = 1.0, and this new vector is transformed by the given matrix; the result is then projected back into w = 1.0.Syntaxvector.transform ( matrixObject ) ArgumentsmatrixObjectThe transformation matrix.

Vector Examples

// Create a vector.

var theNewPosition = new Vector ( 25, 10, 5 );

// Set the position of a model.

theModel.position.setVector ( theNewPosition );

theModel.position.x += 10;

Vector Methods

Anark_Studio_User_Guide.book Page 279 Monday, March 19, 2007 10:34 AM

Page 288: Anark Studio4 User Guide

280 Anark Studio User Guide

Chapter 12Scripting Object Reference

The Vector2 object has the following properties and methods:

VertexModels are composed of a mesh of polygons, which are defined by their vertices. A vertex includes the following elements:

A set of position coordinates (X, Y and Z).

A normal, which is a vector that points outward at a 90 degree angle from the vertex. The vertex normal is calculated by averaging the plane normals of all polygons adja-cent to the vertex.

A set of texture coordinates, which determine how images can be mapped to a model’s polygons. Texture coordinates are often called UV coordinates, but in Anark Media, a vector2 containing X and Y coordinates is used.

When a new vertex is created, it is always empty. You must use the get and set methods for a model object to add data to and extract data from a vertex object.

Constructor syntaxvar theVertex = new Vertex ( )

Vector2 Properties

x The floating point value representing X.

y The floating point value representing Y.

Vector2 Methods

copy Creates an exact copy of the vector2 object. SyntaxnewVector2 = vector2.copy ( ) Return valuenewVector2A variable name for the copy of the two-dimensional vector.ArgumentsN/A

set Sets the X and Y values of the two-dimensional vector to the given values. Syntaxvector2.set ( X, Y ) ArgumentsXRequired. The floating point value representing the X position.YRequired. The floating point value representing the Y position.

setVector Sets the X and Y values of the vector2 to the values of the vector2 supplied as an argument. Syntaxvector2.setVector ( vector2Object ) ArgumentsvectorObjectThe Vector object whose values will be used.

Anark_Studio_User_Guide.book Page 280 Monday, March 19, 2007 10:34 AM

Page 289: Anark Studio4 User Guide

Object Reference 281

Rotation

Return value

The variable name of the vertex.

The Vertex object has the following properties:

RotationA rotation is a special kind of vector encapsulating the data and operations of three angular components, X, Y and Z.

Constructor syntaxvar theRotation = new Rotation ( x, y, z )

Return valueReturns the new rotation.

Argumentsx

Optional. The floating point value representing the degrees of rotation about the X axis.

y

Optional. The floating point value representing the degrees of rotation about the Y axis.

z

Optional. The floating point value representing the degrees of rotation about the Z axis.

Vertex Properties

position The vector that specifies the position of the vertex in 3D space.

normal The vector that specifies the direction the vertex is facing.

texture The vector2 that specifies the X and Y coordinates of the vertex to be used for texture mapping.

Vertex Examples

// Create a vertex.

var vertex50 = new Vertex ( );

// Access a particular vertex on a model.

theModel.getVertex ( 50, vertex50);

// Increment the X position of the vertex.

var vertex50.position.x += 5;

theModel.setVertex (50, vertex50);

theModel.applyChanges ( );

Anark_Studio_User_Guide.book Page 281 Monday, March 19, 2007 10:34 AM

Page 290: Anark Studio4 User Guide

282 Anark Studio User Guide

Chapter 12Scripting Object Reference

The Rotation object has the following properties and methods:

Rotation Properties

x The floating point value representing the degrees of rotation about the X axis.

y The floating point value representing the degrees of rotation about the Y axis.

z The floating point value representing the degrees of rotation about the Z axis.

Rotation Methods

lookAt Modifies the rotation object so that it “looks at” the specified vector.Syntaxrotation.lookAt ( vector ) ArgumentsvectorThe vector the rotation object will look at. Examplefunction onUpdate( ){ var distance = Scene.Layer.Sphere.position.copy( ); distance.subtract( parent.position ); parent.rotation.lookAt( distance );}

copy Creates an exact copy of the rotation Vector object. SyntaxnewRotation = rotation.copy ( ) Return valuenewRotationA variable name for the copy of the rotation vector.ArgumentsN/A

scale Multiplies each component of the current rotation vector by the given factor. Syntaxrotation.scale ( scaleFactor ) ArgumentsscaleFactorThe scale factor applied to each component of the rotation vector.

subtract Subtracts the given rotation vector from the current rotation vector. Syntaxrotation.subtract ( compareRotation ) ArgumentscompareRotationThe rotation vector to be subtracted from the current rotation vector.

add Adds the given rotation vector to the current rotation vector. Syntaxrotation.add ( compareRotation )ArgumentscompareRotationThe rotation vector to be added to the current rotation vector.

Anark_Studio_User_Guide.book Page 282 Monday, March 19, 2007 10:34 AM

Page 291: Anark Studio4 User Guide

Object Reference 283

Rotation

maxVector Modifies the current rotation vector to contain elements that are the maxi-mum between the given rotation vector and the current rotation vector.Syntaxrotation.maxVector ( compareRotation ) ArgumentscompareRotationThe rotation vector whose elements are tested against the current rotation vector to build the maximum.

minVector Modifies the current rotation vector to contain elements that are the mini-mum between the given rotation vector and the current rotation vector. Syntaxrotation.minVector ( compareRotation ) ArgumentscompareRotationThe rotation vector whose elements are tested against the current rotation vector to build the minimum.

equals Calculates and returns whether or not the current rotation vector is equal to the given rotation vector.SyntaxisEqual = rotation.equals ( compareRotation ) Return valueisEqualA variable name for the returned value.ArgumentscompareRotationThe rotation vector to be compared to the current rotation vector.

linear Modifies the current rotation vector by performing a linear interpolation between the current rotation vector and the given rotation vector. The interpolation is created using the following formula: NewRotation = OrigRotation + InterpParam( Rotation2 - OrigRotation )Syntaxrotation.linear ( compareRotation, interpParam ) ArgumentscompareRotationThe rotation vector that acts as the second rotation vector for the interpola-tion. interpParamA floating point number used for the interpolation.

transform Transforms the current rotation vector by the given transform matrix. The current rotation vector is made into a 4D vector by setting w = 1.0, and this new vector is transformed by the given matrix; the result is then pro-jected back into w = 1.0.Syntaxrotation.transform ( matrixObject ) ArgumentsmatrixObjectThe transformation matrix.

Rotation Methods

Anark_Studio_User_Guide.book Page 283 Monday, March 19, 2007 10:34 AM

Page 292: Anark Studio4 User Guide

284 Anark Studio User Guide

Chapter 12Scripting Object Reference

MatrixA matrix is an advanced mathematical structure used to describe the local space of an object and to transform objects within the space. In Anark Studio, matrices are 4 x 4 arrays. The Matrix constructor creates an identity matrix. An identity matrix is a square matrix with its diagonal elements equal to 1 and its off-diagonal elements equal to 0. It performs for matrix arithmetic what the number 1 performs for the arith-metic of numbers.

Constructor syntaxvar theMatrix = new Matrix ( )

Return valueReturns the new matrix.

The Matrix object has the following properties and methods:

Matrix Properties

_11 The floating point value representing the first element on the X axis.

_12 The floating point value representing the second element on the X axis.

_13 The floating point value representing the third element on the X axis.

_14 The floating point value representing the X of the “world” coordinate system.

_21 The floating point value representing the first element on the Y axis.

_22 The floating point value representing the second element on the Y axis.

_23 The floating point value representing the third element on the Y axis.

_24 The floating point value representing the Y of the “world” coordinate system.

_31 The floating point value representing the first element on the Z axis.

_32 The floating point value representing the second element on the Z axis.

_33 The floating point value representing the third element on the Z axis.

_34 The floating point value representing the Z of the “world” coordinate system.

_41 The floating point value representing the translation factor for the X axis.

_42 The floating point value representing the translation factor for the Y axis.

_43 The floating point value representing the translation factor for the Z axis.

_44 The floating point value representing the translation factor for “world” coor-dinate system.

Matrix Methods

isIdentity Returns a Boolean flag that indicates whether or not the matrix is an identity matrix.

Anark_Studio_User_Guide.book Page 284 Monday, March 19, 2007 10:34 AM

Page 293: Anark Studio4 User Guide

Object Reference 285

Matrix

copy Creates an exact copy of the Matrix object. SyntaxnewMatrix = matrix.copy ( ) Return valuenewMatrixA variable name for the copy of the matrix.ArgumentsN/A

set Sets the values of the matrix to the values of the matrix supplied as an argument. Syntaxmatrix.set ( matrixObject ) ArgumentsmatrixObjectThe Matrix object whose values will be used.

scale Modifies the current matrix by right-multiplying into it the scaling matrix represented by the given X, Y and Z components.Syntaxmatrix.scale ( x, y, z ) Argumentsx The floating point value representing the X component of the scaling.y The floating point value representing the Y component of the scaling.z

The floating point value representing the Z component of the scaling.

translate Modifies the current matrix by right-multiplying into it the translation matrix represented by the given X, Y and Z components.Syntaxmatrix.translate ( x, y, z ) Argumentsx The floating point value representing the X component of the translation.y The floating point value representing the Y component of the translation.zThe floating point value representing the Z component of the translation.

rotate Modifies the current matrix by right-multiplying into it the rotation matrix specified by the given angles in degrees.Syntaxmatrix.rotate ( x, y, z )ArgumentsxThe X angle of rotation given in degrees.yThe Y angle of rotation given in degrees.zThe Z angle of rotation given in degrees.

Matrix Methods

Anark_Studio_User_Guide.book Page 285 Monday, March 19, 2007 10:34 AM

Page 294: Anark Studio4 User Guide

286 Anark Studio User Guide

Chapter 12Scripting Object Reference

multiply Multiplies the current matrix by the given matrix. The given matrix is right-multiplied into the current matrix. Syntaxmatrix.multiply ( matrixObject ) ArgumentsmatrixObjectThe matrix to be multiplied with the current matrix.

transpose Modifies the current matrix to be its own transpose. The transpose of a matrix has its elements flipped along its horizontal line (upper left to lower right). Syntaxmatrix.transpose ( ) ArgumentsN/A

invert Modifies the current matrix to be its own inverse. The inverse of matrix A is defined to be the matrix B if and only if AB = BA = I, where I is the Identity Matrix. Only those matrices whose determinates are non-zero will have an inverse. Therefore, not all matrices may be inverted. Syntaxmatrix.invert ( ) ArgumentsN/A

identity Resets the current matrix to an identity matrix.Syntaxmatrix.identity( ) ArgumentsN/A

Matrix Methods

Anark_Studio_User_Guide.book Page 286 Monday, March 19, 2007 10:34 AM

Page 295: Anark Studio4 User Guide

Object Reference 287

Mouse

MouseThe Mouse object is available at any time to obtain the coordinates of the mouse within the presentation window, and to access the cursor and the state of the mouse buttons. Because it is a global object, it can be accessed directly.

The Mouse object has the following properties:

Mouse Properties

x The X location of the mouse in pixels, relative to the left side of the presenta-tion window.

y The Y location of the mouse in pixels, relative to the top of the presentation window.

cursor Sets and returns the type of icon to be used as the mouse cursor. This prop-erty can be set to any of the following values:0 = Default – Uses the operating system’s current cursor (usually the arrow).1 = None

2 = Arrow ( )3 = Crosshair ( )

4 = Finger ( )5 = Hand ( )6 = Help ( )7 = I-Beam ( )8 = No ( )9 = Resize all directions ( )10 = Resize Northeast/Southwest ( )11 = Resize North/South ( )12 = Resize Northwest/Southeast ( )13 = Resize West/East ( )14 = Wait ( )

cursorOverride Sets a mouse cursor and overrides any other cursor setting made by any other behavior. This property can be set to any of the values the cursor property can be set to.

Anark_Studio_User_Guide.book Page 287 Monday, March 19, 2007 10:34 AM

Page 296: Anark Studio4 User Guide

288 Anark Studio User Guide

Chapter 12Scripting Object Reference

KeyThe Key object is available at any time to obtain information about what keys, if any, are being pressed. Because it is a global object, it can be accessed directly.

The Key object has the following properties:

Mouse Examples

function onMouseOver ()

{

Mouse.cursor = 4;

}

function onMouseOut ()

{

// Reset the cursor to the system default.

Mouse.cursor = 0;

}

function onDetach ()

{

// Just in case onMouseOut didn't get called,

// reset the cursor.

Mouse.cursor = 0

}

Key Properties

code Returns the key code for the specified keyName. The code property is useful for accessing the key code without having to specify it, as you would for the keyCode property of an Event object. The keyName must be specified in order to access the keyCode. For a complete list of all the key names that are available to behavior scripts in Anark Studio, as well as their keyboard labels, see “Appendix C: Key Names” on page 315.Syntaxkey.keyName.code

pressed Returns a Boolean indicating whether a key is pressed.Exampleif ( Key.a.pressed && Key.shift.pressed )

{

//Move object where mouse is - 400

this.parent.position.x = Mouse.x - 400;

//Move object where Mouse is - 300

this.parent.position.y = -( Mouse.y - 300 );

}

Anark_Studio_User_Guide.book Page 288 Monday, March 19, 2007 10:34 AM

Page 297: Anark Studio4 User Guide

Object Reference 289

Window

WindowThe Window object is available at any time to obtain the current length and height of the presentation. Because it is a global object, it can be accessed directly.

The Window object has the following properties:

MemoryThe Memory object is available at any time to provide feedback and control over memory usage by the scripting engine. Because it is a global object, it can be accessed directly.

The Memory object has the following properties and methods:

Key Examples

\\Pass the code for the Up Arrow key to an Event object.

function onKeyDown (inEvent)

{

if ( inEvent.keyCode == Key.up.code)

\\Make the parent object rotate 10. this.parent.rotation.x += 10;

}

Window Properties

yHeight The height of the presentation in pixels.

xWidth The width of the presentation in pixels.

Window Examples

// Get the width and height of the presentation.

winWidth = Window.xWidth;

winHeight = Window.yHeight;

Memory Properties

usage The amount of memory in bytes currently being used.

total The total amount of memory in bytes that could be used by the scripting engine.

available The amount of memory in bytes currently available for the script engine to use.

Memory Methods

collectGarbage Deletes scripting objects that no longer have references to them that are accessible via the scripting engine. While garbage collection is usually per-formed whenever more memory is needed, this method provides a way to do it manually.

Anark_Studio_User_Guide.book Page 289 Monday, March 19, 2007 10:34 AM

Page 298: Anark Studio4 User Guide

290 Anark Studio User Guide

Chapter 12Scripting Object Reference

deleteUnuse-dResources

Deletes any dynamically created Library resources that are not currently being used. Dynamically created resources include those that have been cre-ated using scripting or by dynamically loading a Playback Module.

sizeOf Returns the memory in bytes used by the specified script asset and all of its children. For images and models, the heavy buffer data is not considered part of the asset, so it is not included in the returned memory usage figure.Syntaxmemory.sizeOf ( scriptObject, objectOnly ) ArgumentsscriptObjectThe script asset to be evaluated for memory usage.objectOnlyOptional. A Boolean that when set to false specifies that the method only returns the memory used by the object itself. Defaults to true.

Memory Examples

memoryUse = memory.sizeOf( scene.layers[0] );

Memory Methods

Anark_Studio_User_Guide.book Page 290 Monday, March 19, 2007 10:34 AM

Page 299: Anark Studio4 User Guide

Object Reference 291

AKEvent

AKEventThe AKEvent object is the base class for event objects. The latestEvent property of the presentation object is an AKEvent object. The latestEvent property can be used in an event handler function in a behavior script or in an action that executes a script (such as Execute Scriptlet) to access and modify the event’s properties. For more information about actions, see “Understanding actions” on page 120. For a listing of all the avail-able event handler functions, see “Event handler functions” on page 224.

The primary use for creating a new AKEvent object is so that you can then fire that event in a behavior using the fireEvent method of Assets.

Constructor syntaxvar theEvent = new AKEvent ( "eventName" )

ArgumentseventName

The name of the event.

Return valueReturns the new event.

The AKEvent object has the following object properties:

AKEvent Properties

name Sets and returns the name of this event.

object A reference to the object to which the event happened. For onMouseWheel events, this always refers to the scene object.

deltaTime Available for the onUpdate event handler only. It accesses the amount of time in seconds since the scene was last refreshed.

percentDone Available for the onLoadProgress event handler only. It accesses the propor-tion of a section of a presentation that has completed loading. Range = 0 - 1.

loadSource Available for loading events only. Returns the URL or file name of the file being loaded.

positionX Available for mouse events (except onMouseWheel) only. The X-axis posi-tion of the mouse when the event was triggered.

positionY Available for mouse events (except onMouseWheel) only. The Y-axis position of the mouse when the event was triggered.

mouseScroll Available for the onMouseWheel event only. The distance that the wheel button has rotated, expressed in multiples of 120. A positive value indicates that the wheel button has rotated away from the user. A negative value indi-cates that the wheel button has rotated toward the user.

keyCode Available for key events only. The ID of the key that triggered the event.

keyChar Available for key events only. The alphanumeric character that triggered the event.

shift Available for key events only. Returns a Boolean indicating whether the Shift key was being pressed when the event was triggered.

Anark_Studio_User_Guide.book Page 291 Monday, March 19, 2007 10:34 AM

Page 300: Anark Studio4 User Guide

292 Anark Studio User Guide

Chapter 12Scripting Object Reference

MiscellaneousThere are several miscellaneous object types: Presentation, TimeContext, Player, Container, XMLNode and XML. The Presentation object is the current presentation. The TimeContext object is a helper object for components. The Player and Container objects access information about the environment that is playing the presentation. The XMLNode and XML objects allow you to exchange data between an XML document and an Anark Media presentation. These objects do not belong to any of the other general types and they don’t share any of the other types’ properties or methods.

ctrl Available for key events only. Returns a Boolean indicating whether the Con-trol key was being pressed when the event was triggered.

caps Available for key events only. Returns a Boolean indicating whether the Caps Lock key was being pressed when the event was triggered.

bubble Specifies whether or not the event will bubble up the object model hierarchy. 0 = Bubbling enabled. This is the default setting.1 = Bubbling disabled. For more information about event bubbling, see “Working with mouse events and event bubbling” on page 230.

AKEvent Examples

function onKeyDown ( )

{

if ( presentation.latestEvent.keyCode == key.up.code )

\\Make the parent object rotate 1 unit.

parent.rotation.x += 1;

}Scriptlet Example\\rotate an object 50 units

function onUpdate ()

{

rotation.x += presentation.latestEvent.deltaTime * 50;

}

AKEvent Properties

Anark_Studio_User_Guide.book Page 292 Monday, March 19, 2007 10:34 AM

Page 301: Anark Studio4 User Guide

Object Reference 293

Presentation

PresentationThe Presentation object is simply the current presentation. The Presentation object has no constructor because it is always available via the global presentation property.

Because the Presentation object is not an asset, node or utility, it does not share the properties or methods of those object types. It has only the following object properties and methods:

Presentation Properties

realTime Returns the current time in the presentation.

latestEvent Provides access to the AKEvent object for the last event that was fired.

Presentation Methods

isBuffered Returns a Boolean indicating whether the specified Library resource is fully buffered yet. If the resource has been buffered, then it also triggers an onBuf-fered event. If the resource is not yet buffered, then it connects to the remoteSource for the file and begins buffering it.Syntaxvalue = presentation.isBuffered ( "libraryResource" )Return valuevalue Optional. A variable name for the returned Boolean.ArgumentslibraryResourceThe variable name of the music or video file to be checked or buffered.

fireEvent Executes the specified event. The fireEvent method, together with the AKEvent object, allows you to create and execute custom events in scripting. Syntaxpresentation.fireEvent ( eventObject )ArgumentseventObjectThe AKEvent object that was being listened to.

Presentation Examples

function onAttach ( )

{

this.lastUpdate = presentation.realTime;

}

function onUpdate ( )

{

theCurrentTime = presentation.realTime;

var Delta = theCurrentTime - this.lastUpdate;

}

Anark_Studio_User_Guide.book Page 293 Monday, March 19, 2007 10:34 AM

Page 302: Anark Studio4 User Guide

294 Anark Studio User Guide

Chapter 12Scripting Object Reference

TimeContextThe TimeContext object provides the time context for the objects in the scene or inside a component. Components are parent containers for one or more objects that are assigned an independent timeline in the scene.

A project has a clock that controls the timing of actions for the objects in the scene. This clock provides the objects with a time context. Each time a new frame is gener-ated, the objects in the scene ask their time context “what time is it?” and then deter-mine what state they need to be in based in part on that information. Anark Studio also provides independent timelines that allow you to create a separate time context for a particular group of objects. The time context can be repeated either by looping back to the beginning or by “ping-ponging” between moving forward or backward. Components simplify the process of creating repetitive animations and interactive behaviors such as buttons and menu systems. Components can even be nested inside other components.

Components can only be created using the Anark Studio interface. The TimeContext object has no constructor because it is always available as the context property of any asset.

Because TimeContext objects are neither assets, nodes nor utilities, they do not share the properties or methods of those object types. They have only the following object properties and methods:

TimeContext Properties

minTime Sets the starting time for the time context. Defaults to 0.

maxTime Sets the total amount of time for the time context.

jumpTime Sets the total length of the time context for the group. This value is used for looping and for ping-ponging. When you convert a regular group to a com-ponent, the jumpTime is automatically set to the duration of the group. If the value is shortened, the repetition interval of the time context will be set to the new value. If the value is the same or longer than the duration of the component, then the time context will not be repeated. Specified in seconds.

jumpTo Sets a point within the time context from which to begin looping. This is par-ticularly useful for jumping past an introductory section after the first time through so that it will be skipped during subsequent repetitions. If a jumpTo value has been set, it shortens the time context accordingly during looping or ping-ponging. Specified in seconds.

contextTime Sets and returns the current time in the time context in seconds.

contextType Controls how the scene or component will be played back. 0 = Stop at End – Plays through from beginning to end once.1 = Loop – Plays through from beginning to end continuously. 2 = Ping Pong – Plays forward and then in reverse for the duration of the

component or scene. 3 = Ping – Plays forward and back only once.4 = Play through – Plays through from beginning to end once and then

jumps to the next slide (i.e., time context) in the Slide list.Defaults to Stop at End.

Anark_Studio_User_Guide.book Page 294 Monday, March 19, 2007 10:34 AM

Page 303: Anark Studio4 User Guide

Object Reference 295

Player

PlayerThe Player object exposes information about the environment that is executing the presentation. Currently, information about the Container object is exposed. As a root-level object, it has no constructor.

Because the player is not an asset, node or utility, it does not share the properties or methods of those object types. It has only the following object properties:

paused Returns a Boolean indicating whether or not the current time context is paused.

rate Sets the speed at which the time context is executed. This affects the speed of the animation for all the objects that rely on this time context, including any animation created by a behavior that uses the contextTime property. A set-ting of 2 means animated objects will appear to move twice as fast as normal; a setting of .5 means they will appear to move half as fast as normal, etc. A negative value (e.g., -.3, -2, etc.) makes the time context run backwards. This setting does not affect the frame rate of the presentation or how often the scene is updated.

currentSlide Returns the name of the current slide.

TimeContext Methods

play Sets the time context to play again after it has been paused.

pause Pauses a currently playing time context.

activateSlide Jumps playback to the specified slide.SyntaxtimeContext.activateSlide ( slideName )ArgumentsslideNameThe name of the slide to activate. Only the slides associated with the parent time context can be activated. Slides associated with a nested component are not available.

nextSlide Jumps playback to the next slide in the Slide list.

previousSlide Jumps playback to the previous slide in the Slide list.

precedingSlide Jumps playback to the last viewed slide.

TimeContext Examples

function onMouseDblClick ( )

{

this.context.activateSlide( "Slide2" );

}

Player Properties

version The version number of the player. This helps identify what methods and properties are available for scripts as new functionality is added.

TimeContext Properties

Anark_Studio_User_Guide.book Page 295 Monday, March 19, 2007 10:34 AM

Page 304: Anark Studio4 User Guide

296 Anark Studio User Guide

Chapter 12Scripting Object Reference

ContainerThe Container object exposes information about the application that is executing the presentation. The Container object has no constructor because it is always available as the container property of the Player object. Currently two containers are available: ActiveX and AnarkMediaPlayer.

Because the Container object is neither an asset, node nor utility, it does not share the properties or methods of those object types. It has only the following object methods:

containerName Returns the name of the application that is executing the presentation.ActiveX = The ActiveX® control which displays presentations in Internet Explorer.AnarkMediaPlayer = Anark Player.

containerVer-sion

The version number of the Container, which is the application that is execut-ing the presentation.

container Returns the Container object.

platform Returns the computer platform the player is on. Win32 = Microsoft Windows

platformVer-sion

Returns the version of the platform the player is on. For Windows, it will return one of the following:4.0 = Windows 954.10 = Windows 984.90 = Windows ME5.0 = Windows 20005.1 = Windows XPAdditional information is returned for Windows versions, including the ser-vice pack version, but because so many combinations are possible, they are not covered here. The format of the full return value is:5.1.2600.2

frameRate Returns the current number of frames per second for the last frame that was rendered.

avgFrameRate Returns the average frame rate of presentation playback. The average frame rate is calculated using the following formula: avgFrameRate = avgFrameRate + (frameRate - avgFrameRate) / 20

frameTime Returns the amount of time, in milliseconds, since the previous frame.

avgFrameTime Returns the average amount of time, in milliseconds, between each frame. It is calculated using the following formula:avgFrameTime = avgFrameTime + (frameTime - AvgFramesPerMS ) / 20

totalFrames Returns the current total number of frames rendered during playback.

Player Properties

Anark_Studio_User_Guide.book Page 296 Monday, March 19, 2007 10:34 AM

Page 305: Anark Studio4 User Guide

Object Reference 297

Container

Container Methods

launch Available only for the AnarkMediaPlayer container, this method will launch a properly specified application and, optionally, a file.Syntaxplayer.container.launch ( "command line", flags )Argumentscommand lineThe application and file to launch. If the application and file are in the same directory as the AMPlayer.exe file, then this can be specified using just the executable name and file name as in:player.container.launch( "Acrobat.exe Data.pdf", 0 )

Windows uses the following search path for launch:1. The directory from which the application is loaded.

2. The current directory for the parent process.

3. The Windows System directory.

4. The Windows directory.

5. The directories specified in the PATH environment variable.

The absolute or relative path to the executable and file can be specified for the PATH environment variable as in the following example:player.container.launch( ".\\Reports\\Acrobat.exe .\\Reports\\Data.pdf", 0 )

You must escape the backslashes in order for the path to be read properly (or, you can use forward slashes instead).In Windows, you can also call on Explorer to launch an application. Use the relative path from the AMPlayer.exe to the file you want to launch as in the following example:player.container.launch( "explorer ./Reports/Data.pdf", 0 )

OS uses the absolute path to the file and uses the default application to open it, as in the following example:player.container.launch( "users/username/sites/index.html", 0 )

flagsCurrently no flags are supported, so this must always be set to 0.

exit Available only for the AnarkMediaPlayer container, exit causes the Anark Player application to exit.

Container Examples

// Make sure the Player is available

if ( player != null)

{

// Make sure the command is available on the container

if ( player.containerName == "AnarkPlayer" )

{

player.container.launch( "Acrobat.exe Data.pdf", 0 )

}

}

Anark_Studio_User_Guide.book Page 297 Monday, March 19, 2007 10:34 AM

Page 306: Anark Studio4 User Guide

298 Anark Studio User Guide

Chapter 12Scripting Object Reference

XMLNodeThe XMLNode object provides a way to quickly add nodes and attributes to an XML object or to other XML nodes, allowing you to build and control XML document trees.

Constructor syntaxvar XMLNode = new XMLNode ( )

Return valueReturns the new XMLNode object.

Because the XMLNode object is not an asset, node or utility, it does not share the properties or methods of those object types. It has only the following object properties and methods:

XMLNode Properties

hasNodes Returns a Boolean indicating whether or not the object has nodes.

nodeCount Returns the number of child nodes of this XMLNode. Sub-nodes (i.e., chil-dren of children) are not included in the count.

attributeCount Returns the number of attributes.

parent Returns the parent node.

attributes Returns an array of the names of the attributes contained within this XMLNode.

nodes Returns an array of the child nodes of this XMLNode. Sub-nodes (i.e., chil-dren of children) are not included in the count.

name Sets and returns the name of this node.

text Sets and returns the text that will show up between the begin and end tags for this node.

XMLNode Methods

addNode Adds an existing XMLNode object as a child of this XMLNode.SyntaxXMLNode.addNode ( inNode )ArgumentsinNodeThe XMLNode object to be added as a child of this XMLNode.

removeNode Removes the specified XMLNode object from this XMLNode. Any child nodes of the removed node are also deleted. SyntaxXMLNode.removeNode ( inNode )ArgumentsinNodeThe XMLNode object to be removed from this XMLNode.

Anark_Studio_User_Guide.book Page 298 Monday, March 19, 2007 10:34 AM

Page 307: Anark Studio4 User Guide

Object Reference 299

XMLNode

getNode Returns the specified node. Syntaxnode = XMLNode.getNode ( node )Return valuenodeData Optional. A variable name for the returned node object.ArgumentsnodeA string or integer that specifies the node you want to get.

copyNode Copies this node and all of its children.Syntaxnode = XMLNode.copyNode ( )Return valuenodeOptional. A variable name for the copy.

getAttribute Returns the specified attribute’s data.SyntaxattributeValue = XMLNode.getAttribute ( inAttribute )Return valueattributeValueOptional. A variable name for the attribute’s value.ArgumentsinAttributeThe attribute. The attribute can be specified by name or by index.

setAttribute Overwrites the specified attribute’s data with the given value.SyntaxXMLNode.setAttribute ( inAttribute, inValue )ArgumentsinAttributeThe attribute to be overwritten. The attribute can be specified by name or by index.inValueThe new value specified as a string.

addAttribute Adds the specified attribute name and value to this XMLNode object.SyntaxXMLNode.addAttribute ( name, value )ArgumentsnameThe name for the new attribute. valueThe new value specified as a string.

removeAt-tribute

Removes the specified attribute from this XMLNode.SyntaxXMLNode.removeAttribute ( inAttribute )ArgumentsinAttributeThe attribute to be removed, specified by either name or index.

XMLNode Methods

Anark_Studio_User_Guide.book Page 299 Monday, March 19, 2007 10:34 AM

Page 308: Anark Studio4 User Guide

300 Anark Studio User Guide

Chapter 12Scripting Object Reference

XMLThe XML object is a type of XMLNode. It loads, parses and posts XML data and catches errors. It can be used to load XML data for use in a presentation and to collect and send data to an XML document.

Note: Loading or posting XML requires a valid license key. Please contact your Anark sales representative for licensing information.

Constructor syntaxvar XML = new XML ( inString )

Return valueReturns the new XML object.

ArgumentsinString

Optional. A string of valid XML.

Unlike other object types, the XML object has some special events associated with it. These events provide information about the loading process for XML data. The XML object is not an asset, node or utility, and it does not share the properties or methods of those object types. It has all the properties and methods of XMLNodes, as listed in “XMLNode Properties” and “XMLNode Methods” on page 298. It also has the following object properties, methods and function callbacks:

toString Converts the data contained within the XMLNode, including child nodes and attributes, to an XML string.Syntaxstring = XMLNode.toString ( )Return valuestringOptional. A variable name for the string.

XML Properties

async Specifies whether asynchronous loading will be used. Defaults to false. If set to true, then the presentation will continue running while the XML is load-ing. In order to use asynchronous loading, you would also need to set up event callbacks to check on the loading process. To do this, you would use the XML function callbacks. See “XML Function Callbacks” on page 301 for more information.

error Returns a Boolean indicating whether there was an error during loading or parsing or posting.

errorString Returns an error string indicating what error occurred during loading or parsing or posting.

XMLNode Methods

Anark_Studio_User_Guide.book Page 300 Monday, March 19, 2007 10:34 AM

Page 309: Anark Studio4 User Guide

Object Reference 301

XML

XML Methods

load Loads the specified XML document.SyntaxXML.load ( inURL )ArgumentsinURLThe URL of the XML document to load. If HTTPS is used, port 443 is used by default. To specify a different port, the URL must be followed by a colon and a port number (e.g., https://www.anark.com:444). If you use backslashes when specifying the URL, they must be escaped. See “Specifying paths in scripting” on page 212 for more information.Please note, loading XML requires a valid license key. Please contact your Anark sales representative for licensing information.

post Posts the XML object to the specified URL.SyntaxXML.post ( inURL )ArgumentsinURLThe URL of the XML document to save. Only HTTP or HTTPS protocols can be used. If HTTPS is used, port 443 is used by default. To specify a different port, the URL must be followed by a colon and a port number (e.g., https://www.anark.com:444). If you use backslashes when specifying the URL, they must be escaped. See “Specifying paths in scripting” on page 212 for more information.Please note, posting XML requires a valid license key. Please contact your Anark sales representative for licensing information.

parse Passes the specified buffer (in the form of a string) to the XML object and parses it.SyntaxXML.parse ( inString )ArgumentsinStringThe string of valid XML to be parsed.

XML Function Callbacks

onLoadProgress This function is called continuously as the XML document is loading. It can be used in custom functions to provide feedback on the asynchronous load-ing process.

onLoadCom-plete

This function is called when an XML document has finished loading. It can be used in custom functions to provide feedback on the asynchronous load-ing process.

onLoadError This function is called when an XML document cannot properly load. It can be used in custom functions to provide feedback on the asynchronous load-ing process.

Anark_Studio_User_Guide.book Page 301 Monday, March 19, 2007 10:34 AM

Page 310: Anark Studio4 User Guide

302 Anark Studio User Guide

Chapter 12Scripting Object Reference

XML Examples

function GetWeather( inAirportCode )

{

var theDataString = "[No Data]"

var theXML = new XML( );

//sample URL; may not be available

theXML.load( "http://www.bgxcomponents.com/webservices/GET_Weather.asmx/Get_WeatherReport?code=" + inAirportCode );

if ( theXML.error == false )

{

theDataString = theXML.getNode( "station" ).getNode( "name" ).text;

theDataString += "\\n";

theDataString += "Current Time: ";

var theDate = new Date( );

theDataString += theDate.toLocaleString( );

theDataString += "\\n";

theDataString += "Current Temperature: ";

var theTemp = theXML.getNode( "temperature" ).getNode( "ambient" ).text;

theDataString += theTemp + "C";

}

return theDataString;

}

function onAttach()

{

//parent is a text object

parent.textString = GetWeather( "DEN" );

}

Anark_Studio_User_Guide.book Page 302 Monday, March 19, 2007 10:34 AM

Page 311: Anark Studio4 User Guide

303

Glossary and Appendices

This section includes the following supplemental materials:

Scripting Glossary on page 319

Appendix A: Supported Media Formats on page 305

Appendix B: Shortcut Keys on page 307

Appendix C: Key Names on page 315

Anark_Studio_User_Guide.book Page 303 Monday, March 19, 2007 10:34 AM

Page 312: Anark Studio4 User Guide

Anark_Studio_User_Guide.book Page 304 Monday, March 19, 2007 10:34 AM

Page 313: Anark Studio4 User Guide

A

305

Appendix A: Supported Media Formats

Anark Studio currently supports the following media formats:

Due to the wide variety of proprietary and public codecs that can be used to create media files, Anark Studio may not always work with specific files. For example:

Some .wav files may have compression. Anark Studio only supports uncompressed (PCM) .wav files.

GIFs cannot be imported directly into Anark Studio. However, .amx files support embedded textures, and textures imported as part of an AMX file can be used like any other texture inside of Anark Studio.

Anark Studio works with most, but not all AVI files. Some video card manufacturers create proprietary AVI codecs, which Anark Studio may not be able to work with.

The .mpe file format is an encrypted format used to wrap media files. Unless your machine has the decryption code for the file, you will not be able to work with the file in Anark Studio.

Only QuickTime version 3 or earlier can be used on

Media Formats File Extensions

3D objects .amx, .3ds, .dae

Sound files .ogg (Ogg Vorbis), .wav, .aiff/.aif

Video types Windows Media: .avi, .asf, .wmvQuickTime: .qt, .movMPEG Audio: .mp2, .mp3MPEG Audio/Video: .mpg, .mpeg, .m1v, .mpe

Image files .png, .tga, .tif, .psd, .bmp, .jpg

Behavior scripts .bvs

Anark component .amc

Anark_Studio_User_Guide.book Page 305 Monday, March 19, 2007 10:34 AM

Page 314: Anark Studio4 User Guide

Supported Media FormatsAppendix A

306 Anark Studio User Guide

Windows.

Anark_Studio_User_Guide.book Page 306 Monday, March 19, 2007 10:34 AM

Page 315: Anark Studio4 User Guide

B

307

Appendix B: Shortcut Keys

A number of keyboard shortcuts are available to make work-ing in Anark Studio easier.

Anark_Studio_User_Guide.book Page 307 Monday, March 19, 2007 10:34 AM

Page 316: Anark Studio4 User Guide

Shortcut KeysAppendix B

308 Anark Studio User Guide

File MenuCommand Keyboard Shortcut

New Ctrl + N

Open Ctrl + O

Save Ctrl + S

Import Resource Ctrl + R

Preview in browser or Anark Player F12Shift + Enter

Export Ctrl + Shift + S

Edit MenuCommand Keyboard Shortcut

Undo Ctrl + Z

Redo Ctrl + YCtrl + Shift + Z

Cut Ctrl + X

Copy Ctrl + C

Paste Ctrl + V

Duplicate object Ctrl + D

Edit Project Settings Ctrl + P

View MenuCommand Keyboard Shortcut

View Assistant palette F1

View Actions Ctrl + Shift + A

View Basic Objects Ctrl + Shift + B

View Inspector Ctrl + Shift + I

View Library Ctrl + Shift + L

View Slides Ctrl + Shift + D

View Storage Ctrl + Shift + R

View Timeline Ctrl + Shift + T

Bounding boxes on/off Ctrl + B

Pivot points on/off Ctrl + Alt + P

Rulers on/off Ctrl + Alt + R

Anark_Studio_User_Guide.book Page 308 Monday, March 19, 2007 10:34 AM

Page 317: Anark Studio4 User Guide

Learning Anark Studio 309

Script MenuCommand Keyboard Shortcut

Find (behavior text) Ctrl + F

Find Next (behavior text) F3

Replace (behavior text) Ctrl + H

Compile (edited behavior) F7

Show or hide line numbers F8

Timeline MenuCommand Keyboard Shortcut

Set keyframe(s) F6

Enable/Disable Autoset keyframes K

Help MenuCommand Keyboard Shortcut

Open the Assistant palette F1

Selection KeysCommand Keyboard Shortcut

Group select A

Item select V

Select the Library resource for an instance Ctrl + L

Select an instance of a Library resource Ctrl + I

Anark_Studio_User_Guide.book Page 309 Monday, March 19, 2007 10:34 AM

Page 318: Anark Studio4 User Guide

Shortcut KeysAppendix B

310 Anark Studio User Guide

The following table lists the keyboard shortcuts that you can use to quickly switch the edit camera view.

When some Edit Camera tools are enabled, you can temporarily enable a different tool by holding down modifier keys. The Edit Camera tool icon in the

Project window will change to the currently enabled tool. The following table lists how the keys affect the currently selected tool.

These mouse button shortcuts are also available for selecting the edit camera tools:

Playback KeysCommand Keyboard Shortcut

Play presentation Enter/ReturnSpace bar (hold down)

Stop playback Enter/Return (during playback)Space bar (release)

Note: When the Space bar is used, the Playhead jumps back to its previous location.

Edit Camera View Keyboard Shortcut

Scene view camera ~

3D Perspective 1

3D Orthographic 2

Top 3

Bottom 4

Left 5

Right 6

Front 7

Back 8

Shaded/wireframe toggle F3

Fit selected f

Currently Selected Edit Camera ToolModifier Key *

Fit Selected Edit Camera Pan

Edit Camera Zoom

Edit Camera Orbit

Shading Mode Toggle

Alt key No effect Zoom Orbit Zoom No effect

Ctrl key No effect Orbit Pan Pan No effect

* The mouse must be inside the perimeter of the Project window when you press the modifier key.

Anark_Studio_User_Guide.book Page 310 Monday, March 19, 2007 10:34 AM

Page 319: Anark Studio4 User Guide

Learning Anark Studio 311

These keyboard shortcuts are available for changing quickly how a left mouse

drag and click affects the currently selected object:

When any Transform tool is enabled, you can temporarily enable a different tool by holding down modifier keys. The tool icon in the Project window will

change to the currently enabled tool. The following table lists how the keys affect the currently selected tool:

Desired Edit Camera Tool Mouse selection

Pan Middle mouse (click and drag)

Zoom Middle mouse scroll

Orbit Alt + middle mouse (click and drag)

Transform Selected Object KeysCommand Keyboard Shortcut

Rotate tool R

Move tool W

Scale tool E

Constrain dragging to one axis Shift + drag

Currently Selected Transform ToolModifier Key Rotate Position ScaleAlt Scale Scale Rotate

Ctrl Position Rotate Position

Anark_Studio_User_Guide.book Page 311 Monday, March 19, 2007 10:34 AM

Page 320: Anark Studio4 User Guide

Shortcut KeysAppendix B

312 Anark Studio User Guide

Nudge Selected Object KeysCommand Keyboard Shortcut

Nudge PositionLeft (X-) Left arrow

Right (X+) Right arrow

Up (Y+) Up arrow

Down (Y- ) Down arrow

Forward (Z-) Shift + Down arrow

Backward (Z+) Shift + Up arrow

Nudge RotationX+ Ctrl + Up arrow

X- Ctrl + Down arrow

Y+ Ctrl + Left arrow

Y- Ctrl + Right arrow

Z- Ctrl + Shift + Down arrow

Z+ Ctrl + Shift + Up arrow

Nudge ScaleX+ Alt + Right arrow

X- Alt + Left arrow

Y+ Alt + Up arrow

Y- Alt + Down arrow

Z- Alt + Shift + Down arrow

Z+ Alt + Shift + Up arrow

Snapping KeysCommand Keyboard Shortcut

Snap Playhead to next tick mark , (backward). (forward)

Snap Playhead to every 5th tick mark Shift + < (backward)Shift + > (forward)

Snap item in the Timeline to other items while dragging with the mouse

Shift + drag

Anark_Studio_User_Guide.book Page 312 Monday, March 19, 2007 10:34 AM

Page 321: Anark Studio4 User Guide

Learning Anark Studio 313

Delete Selected Object KeysCommand Keyboard Shortcut

Delete object DeleteBackspace

Timeline Scaling KeysCommand Keyboard Shortcut

Zoom in +Ctrl + scroll mouse wheel up

Zoom out -Ctrl + scroll mouse wheel down

Timebar Resizing KeysCommand Keyboard Shortcut

Move start handle to current location of Playhead

Ctrl + [

Move start handle of this object and all of its children to current location of Playhead

[

Move end handle to current location of Playhead

Ctrl + ]

Move end handle of this object and all of its children to current location of Playhead

]

Inspector Tab ShortcutsCommand Keyboard Shortcut

Change a value by increments of 1 Up or Down arrow

Change a value by increments of 10 Shift + Up or Down arrow

Change a value by increments of .10 Ctrl + Up or Down arrow

Object Outline ShortcutsCommand Keyboard Shortcut

Expand or close up all items Shift + double-click on the object icon

Anark_Studio_User_Guide.book Page 313 Monday, March 19, 2007 10:34 AM

Page 322: Anark Studio4 User Guide

Shortcut KeysAppendix B

314 Anark Studio User Guide

Anark_Studio_User_Guide.book Page 314 Monday, March 19, 2007 10:34 AM

Page 323: Anark Studio4 User Guide

C

315

Appendix C: Key Names

The Key object provides a way for you to determine what key, if any, is being pressed. To use the Key object to access the key code, you must specify the key name. The official key names for all the keys that are available to behavior scripts are included in the table on the following pages. The Key object is documented in detail in the section titled “Key” on page 288.

Anark_Studio_User_Guide.book Page 315 Monday, March 19, 2007 10:34 AM

Page 324: Anark Studio4 User Guide

Key NamesAppendix C

316 Anark Studio User Guide

Property Name Return Value Keyboard Label

zero zero 0

one one 1

two two 2

three three 3

four four 4

five five 5

six six 6

seven seven 7

eight eight 8

nine nine 9

a A A

b B B

c C C

d D D

e E E

f F F

g G G

h H H

i I I

j J J

k K K

l L L

m M M

n N N

o O O

p P P

q Q Q

r R R

s S S

t T T

u U U

v V V

w W W

x X X

y Y Y

z Z Z

back back BACKSPACE

tab tab TAB

clear clear CLEAR

ret ret ENTER

Anark_Studio_User_Guide.book Page 316 Monday, March 19, 2007 10:34 AM

Page 325: Anark Studio4 User Guide

Learning Anark Studio 317

shift shift SHIFT

control control CTRL

pause pause PAUSE

capital capital CAPS LOCK

escape escape ESC

space space SPACE

prior prior PAGE UP

next next PAGE DOWN

end end END

home home HOME

left left LEFT ARROW

up up UP ARROW

right right RIGHT ARROW

down down DOWN ARROW

select select SELECT

print print PRINT

snapshot snapshot PRINT SCREEN

insert insert INS

del del DELETE or DEL

help help HELP

numpad0 numpad0 Numeric keypad 0

numpad1 numpad1 Numeric keypad 1

numpad2 numpad2 Numeric keypad 2

numpad3 numpad3 Numeric keypad 3

numpad4 numpad4 Numeric keypad 4

numpad5 numpad5 Numeric keypad 5

numpad6 numpad6 Numeric keypad 6

numpad7 numpad7 Numeric keypad 7

numpad8 numpad8 Numeric keypad 8

numpad9 numpad9 Numeric keypad 9

multiply multiply *

add add +

separator separator \

subtract subtract -

decimal decimal .

divide divide /

f1 F1 F1

f2 F2 F2

f3 F3 F3

f4 F4 F4

Property Name Return Value Keyboard Label

Anark_Studio_User_Guide.book Page 317 Monday, March 19, 2007 10:34 AM

Page 326: Anark Studio4 User Guide

Key NamesAppendix C

318 Anark Studio User Guide

f5 F5 F5

f6 F6 F6

f7 F7 F7

f8 F8 F8

f9 F9 F9

f10 F10 F10

f11 F11 F11

f12 F12 F12

f13 F13 F13

f14 F14 F14

f15 F15 F15

f16 F16 F16

f17 F17 F17

f18 F18 F18

f19 F19 F19

f20 F20 F20

f21 F21 F21

f22 F22 F22

f23 F23 F23

f24 F24 F24

numLock numLock Num Lock

scroll scroll Scroll Lock

lshift lshift Shift

rshift rshift Shift

lcontrol lcontrol Ctrl

rcontrol rcontrol Ctrl

semicolon semicolon ;

equals equals =

comma comma ,

minus minus -

period period .

forwardslash forwardslash /

tilde tilde ~

openbracket openbracket [

backwardslash backwardslash \

closebracket closebracket ]

quote quote “

Property Name Return Value Keyboard Label

Anark_Studio_User_Guide.book Page 318 Monday, March 19, 2007 10:34 AM

Page 327: Anark Studio4 User Guide

319

GlossaryScripting Glossary

This section defines some commonly used terms in scripting as well as some terminology that is specific to Anark Studio.

ArgumentsArguments are placeholders for values that you want to apply to a function or object constructor. Arguments are enclosed in parentheses and are separated by commas. In the following example, 400, 300 and 0 specify the X-, Y- and Z-axis positions, respectively, for the new Vector object, this.mousePos.

this.mousePos = new Vector( 400, 300, 0 );

For a complete list of all the arguments that each object type takes, see “Scripting Object Reference” on page 243.

ArrayAn array is an object that stores data by assigning a numbered position, rather than a named value, to the object. It is essentially an indexed list of variables. The numbered positions of the index always begin with 0. Square brackets are used to access the numbered values of an array.

Arrays are particularly useful for storing numerous pieces of data using a single variable and for iterating through a list in a for loop.

var sphereColor = new Array ();sphereColor[0] = "green";sphereColor[1] = "blue";sphereColor[2] = "yellow";sphereColor[3] = "red";

Additionally, arrays have a dynamic length property that is automatically updated when new values are added to an array. In the example above, the length property of the

Anark_Studio_User_Guide.book Page 319 Monday, March 19, 2007 10:34 AM

Page 328: Anark Studio4 User Guide

320 Anark Studio User Guide

Scripting GlossaryGlossary

sphereColor array is automatically set to 4 because there are four entries, but if you added two more values to the array, it would update the length property to 6.

You can optionally preset the length property for the array by passing it as an argument to the array constructor:

var sphereColor = new Array (4);

This creates an array with four empty index entries, but again, the length property will be incremented if more than four entries are set for it later on.

Note, however, that the length property only goes up. It won’t be reduced if only two entries are set for it. In that case, it will have two empty entries in addition to the ones that have been set. Short of deleting the array or assigning it the value null, the number of elements in an array cannot be reduced, so be conserva-tive when assigning a length to an array.

You can call on the length property of the array to control the behavior of all the members of the array. The following line of code evaluates the length prop-erty of the sphereColor array and assigns the number 4 to the variable numColors:

var numColors = sphereColor.length;

AssetAn asset is any of the predefined objects, including Music, Material, Animation-Track, Image, Node and Scene, that are the fundamental building blocks of Anark Media. Assets serve as resources for scripting content.

BehaviorBehavior scripts are chunks of code (in the form of a script) that tell the objects they are attached to what to do and when to do it. Some common interactive behaviors include buttons, linking, menus, toolbars, key commands, etc.

Scripted behaviors are the only way to create interactive elements in a project. They can also be used to add procedural animation (i.e., animation based on mathematical formulas) to your project. Animation created in the Anark Studio interface uses static keyframes that control a single parameter for a single moment in time. Procedural animation allows you to create dynamic keyframes that can change based on runtime information.

ChildIn the Anark Studio object model hier-archy, a child is an object that is attached directly to a parent object, which influences some of its properties. Child objects can have children attached to them.

Clipping planeA clipping plane is a plane that is vertical to the line of sight beyond which objects disappear. The near clipping plane defines the point at which objects moving towards camera will disappear. The far clipping plane defines the point at which objects moving away from the camera will disappear.

ConditionalConditional statements allow your scripts to make decisions about what code to execute based on current condi-tions. Conditionals (if, if…else, ?: and switch) contain one or more expressions that evaluate to either true or false. The decision about what code to execute next is based on the outcome.

function onAttach(){var playedBefore = false; if ( (currentTime >= 5) && ( playedBefore == false ) ) {

Anark_Studio_User_Guide.book Page 320 Monday, March 19, 2007 10:34 AM

Page 329: Anark Studio4 User Guide

Learning Anark Studio 321

this.LoopMusic.play(); playedBefore = true; }}

This if statement evaluates whether the current time (currentTime) is greater than or equal to 5 seconds. It then checks to see if playedBefore is false. If both conditions match, it plays the music and sets playedBefore to true, which then invalidates the if statement.

For more information about condi-tionals, see “Using conditional state-ments” on page 234.

CullingCulling is the process of eliminating the polygons that face away from the viewer and therefore can’t be seen. Culling speeds up the rendering of the scene, since all those unseen polygons use up valuable processing power.

Event HandlerEvent handlers are predefined functions that provide cues for the action and interactivity of a scene. They include mouse events such as onMouseDblClick and onMouseDown, keypress events such as onKeyDown, and system-wide functions such as onUpdate and onAttach.

For more information about event handlers, see “Event handler functions” on page 224.

ExpressionAn expression is a piece of the script that can be evaluated by the script interpreter to generate a value. The value can be of any valid data type (number, string, Boolean, etc.). An expression can perform a calculation, manipulate char-acters, call a function or test a value.

FunctionA function is a procedure that is defined once and can be executed multiple times by a program. Functions act on and return data. A function definition looks like this:

function onMouseDown(inEvent){ this.parent.rotation.x += .05;}

A function is invoked and is passed information by enclosing it in paren-theses ( ). A function stored as the prop-erty of an object is called a method.

For more information about using and creating functions, see “Creating func-tions” on page 221.

GroupA group is an object that acts as a simple placeholder for other objects. Groups are used to organize complex data and move sets of nodes such as models as though they are one.

Components, which are created from groups, are slightly more complex in that they work together with the Time-Context object to provide an indepen-dent clock for an object or group of objects.

ImageAn Image object is the equivalent of an image or material map in 3D modeling programs. Image maps are used to create the look of a texture on objects (e.g., stone, clouds, checkered, etc.) or to map a 2D graphic such as a still photo or even a video clip to the object’s surface.

LayerA layer is an object that allows you to group the elements of the scene in a special way. Layers in Anark Studio are similar to the layers used in many 2D

Anark_Studio_User_Guide.book Page 321 Monday, March 19, 2007 10:34 AM

Page 330: Anark Studio4 User Guide

322 Anark Studio User Guide

Scripting GlossaryGlossary

graphic design programs. In 2D graphics, layers are rendered like stacked sheets of acetate. The content of each layer remains distinct from the content of other layers, but the final image is a composite of all the layers.

3D layers in Anark Studio are used in a similar way, but instead of being rendered like sheets of acetate, they are rendered like a stack of glass blocks. Each block contains a 3D scene with elements that interact with each other, but not with the elements of the other layers. Objects in one layer never penetrate into another layer no matter how far you move them backward or forward.

MaterialA material is an object that specifies the surface appearance of a model. A mate-rial controls the color, shininess and opacity of a model, among other things. Material blending modes are used to specify how the material will be mixed with the other elements of the scene. Images can be attached to materials to create patterns or to map a 2D graphic to the object’s surface.

MethodA method is a function that is a property of an object. Methods control the behavior of objects.

ModelA model is a 3D mesh object. Models can be created in other applications such as 3ds max, or simple primitives can be created using the buttons on the Basic Objects tab.

MusicA Music object is a type of asset that contains a song or music clip. In the object model hierarchy, Music objects

work much like behaviors. They can be attached to objects, but other objects cannot be attached to them. The data contained in Music objects is streamed rather than embedded in the final presentation like Sound objects are.

NodeA node is a particular type of asset that is physically present in a scene and can therefore be manipulated visually. A node can contain other nodes. Nodes include models, cameras, lights, groups, sounds and layers.

ObjectAn object is a compound data type that contains any number of properties and methods. Dot syntax (.) is used to access a named property or method of an object.

Object ModelThe object model is a kind of hierar-chical mapping of parent-child relation-ships used in both the Anark Studio interface and behavior scripts to address and operate parent and child objects in a scene. These parent-child relationships allow you to set up animation parame-ters and interactive behaviors for groups of objects with a single setting and to animate objects in relation to other objects. This object model is used to represent the scene at a given point in time. For more information about the object model hierarchy, see the “Object model overview” on page 214.

OperatorOperators are terms and symbols that are used to calculate a new value from one or more values. Examples include the addition operator (+), the division oper-ator (/) and the equality operator (==).

Anark_Studio_User_Guide.book Page 322 Monday, March 19, 2007 10:34 AM

Page 331: Anark Studio4 User Guide

Learning Anark Studio 323

ParameterA parameter is a value that is a variable of an object and that is available to the Anark Studio interface. Parameters are a subtype of properties. Examples of parameters include position, opacity and rotation. Objects have built-in parame-ters provided by Anark Studio, and you can create new parameters for objects using scripting.

ParentIn the Anark Studio object model hier-archy, a parent is an object that influ-ences some of the properties (e.g., position, rotation, duration) of one or more children that are directly attached to it.

PropertyA property is a value that is a variable of an object. It includes both parameters and any variables that are not published to Anark Studio. In addition to the built-in properties provided through Anark scripting, you can create new properties for objects. For a complete list of the built-in properties for the different object types, see “ Scripting Object Refer-ence” on page 243.

RootA root is an object at the top of the hier-archy. Root objects can have children, but no parents. The scene is the root object in Anark Studio.

SceneThe scene is the root object in the Anark Studio object model hierarchy. The scene encompasses the overall 3D space in which a project takes place.

Scene GraphA scene graph is the outline of a scene that represents the object-to-object parent-child relationships.

ScopeThe scope of a variable is its accessibility from other points in the behavior script or the presentation. Variables can have two levels of scope: local to a function and local to a behavior. If a variable is created with function-level scope, it will be available only to the function that contains it. A variable created with behavior-level scope can be accessed anywhere within a behavior script, no matter what function is being called.

SoundA Sound object is a type of asset that contains an audio clip. Sounds can be attached to objects, but other objects cannot be attached to them. Unlike Music objects, sounds are embedded in the final presentation.

StatementA statement is a combination of expres-sions that carry out one complete task. It includes one or more expressions, keywords or operators. In general, each new line begins a new statement. A semicolon (;) is used to explicitly termi-nate a statement.

TimeContextA TimeContext is an object that provides the clock for a component and its chil-dren. Components are parent containers for one or more objects that are assigned an independent time context. Each time a new frame is generated, the objects in the scene ask their time context “what time is it?” and then determine what state they need to be in based in part on that information. Components and their

Anark_Studio_User_Guide.book Page 323 Monday, March 19, 2007 10:34 AM

Page 332: Anark Studio4 User Guide

324 Anark Studio User Guide

Scripting GlossaryGlossary

TimeContexts simplify the process of creating intricate, repetitive animations and interactive behaviors.

UtilityA utility is an object that either accesses data about the project (mouse and window) or manipulates objects in the project (vector, color and rotation).

VariableA variable is the name you give to a concept to represent a piece of data. When you use a variable, you are really calling on the data that it contains. The data assigned to a variable can – and often does – change. You must declare a variable before using it. In the first line of the following example, the variable difx serves as a placeholder for the data

that is calculated by a mathematical formula. In the second line, the variable difx can be used as part of an expres-sion that will generate a value for the variable stopx.

var difx = ( ( Mouse.x - 770 ) / 3 ) - this.parent.rotation.y;var stopx = difx / 15;

For more information about creating variables, see “Using variables” on page 216.

VideoA video is an object that contains a video clip that Anark Studio can stream. It works much like an Image object, in that it must be attached to a material on a model in order to be displayed.

Anark_Studio_User_Guide.book Page 324 Monday, March 19, 2007 10:34 AM

Page 333: Anark Studio4 User Guide

Index

325

Index

Symbols. (dot syntax) 204; (semicolon) 205= (assignment operator) 205== (equality operator) 205() (parentheses) 205{}, curly braces 204

Numerics3D files

guidelines for importing 37See also models

3D objects 3053D Orthographic View 123D Perspective View 123D scene 258.3ds file extension 39, 305.3ds file format 363ds max

guidelines to follow 37troubleshooting 44

Aabsolute path

for objectsin an action 122in scripting 217

for streaming media 166of remote source 109

accessingBehavior Reference 27edit cameras 12

master slide 135object properties

using scripting 217using the Object outline 63

actionscopying 130creating 120keyboard shortcut for viewing 308order of 130overview 120selecting 125types of 125

Actions tab 120active camera, setting 150active light, setting 262Active toggle

for actions 130for objects 64

ActiveXContainer object 296control methods and properties 189

addingactions 120Anark Media to an existing HTML file 186behaviors to components 140behaviors to the project 52folders to the Storage tab 25keyframes 152objects to components 140objects to the project 52

using the Storage tab 25palettes 11

Anark_Studio_User_Guide.book Page 325 Monday, March 19, 2007 10:34 AM

Page 334: Anark Studio4 User Guide

Index

326 Anark Studio User Guide

resources to the Library 25slides 134streaming media files 167

addressing objects using scripting 217.aiff/.aif file extension 305AKEvent object 291alert

action 126global function 207

alignment of text 89in scripting 270

alpha channeldefinition of 43included in .png files 43used in rendering images 108

.am file format 176Ambient Color

of lights 95in scripting 262

of materials 103in scripting 249

.amc file extension 60, 305

.amc file format 56

.amw file extension 10

.amx file extension 305

.amx file format 36Anark Client

control panel 196end user plug-in 5opens .AM files 176

Anark Media.am file type 176embedding in an existing HTML file 186file type 176licensing 23overview of 5playing/pausing 197saving a component as 60

Anark Media Component (.amc file type) 60

Anark Media Workspace (.amw file type) 10

Anark Playercommand line options for 192configuration options for 192exiting 297exporting a project to 177features of 195preparing a project for 195selecting as previewing application 23

AnarkMediaPlayer Container object 296Animatable property of custom

properties 77animating objects 145Animation toggle 29, 146anisotropic filtering 110

in scripting (as anisotropyDegree) 252.app file extension 176application default settings, restoring 19application preferences, setting 17application, launching another 297arguments for object constructors 319arithmetic operators 213array data type 207array object, definition of 319arrow keys 317.asf file extension 305aspect ratio 21

controlling from command line 193controlling from configuration file 194See also Fixed aspect ratio

Asset objectsdefinition of 320description of all 244

assetscustomizing properties 75melting 234, 246See also objects

assignment operators 214Assistant palette

keyboard shortcut for viewing 308offline/online toggle 7portal to useful resources 31

attach events 123attaching

assets in scripting 245behaviors to objects 53layers to the scene 53objects

to layers 53to objects 53

attachmentsaffect of pivot points on 50changing 64creating 53overview of 49

audiostreaming 165See also music

author, acknowledging 23

Anark_Studio_User_Guide.book Page 326 Monday, March 19, 2007 10:34 AM

Page 335: Anark Studio4 User Guide

Index 327

Auto Startmusic 115presentations on a CD-ROM 191sound 115video 114See also AutoRun

autokeyframing 154automapping

image to a model 104video to a model 113

AutoRunAutorun.inf file 191include command line options 192

Autoset Keyframes 154.avi file extension 176, 305AVI files, troubleshooting 42, 44axes, three 50

BBack View edit camera 12Background Color

of layers 85in scripting 259

of Project window 19of scene 84

in scripting 247of splash screen on Web 186of text 89

in scripting 271backspace key 316backward slash key 318Balance

music 115in scripting 256

sound 115in scripting 272

video 253basic objects

adding to the project 53keyboard shortcut for viewing 308

Basic Objects tab 24beep

action 127global function 208

Behavior object 247Behavior Reference Library, how to

access 7Behavior Reference, how to access 27Behavior scope 218behavior script parameters, editing 75

behaviorsadding to components 140adding to the Library 27adding to the project 52attaching to an object 53compiling 74creating custom scripts 72custom parameters of, creating 75definition of 23duration of 148editing in Anark Studio 73effect on animation 237exporting to .bvs file 74importing 51overview 72parent property of 224recently created, now available 7scrubbing won’t display 160selecting 61setting properties for 116sharing with others 74updating after editing 74updating the Library resource 55See also scripts

Bezier keyframes. See smooth keyframesbi-linear filtering 110bit depth of videos 44Bleach blending mode 102

in scripting 250Blending Mode, of materials 100

in scripting 250.bmp file extension 305BODY tag in HTML 199Boolean

behavior parameter 76data type 206

border colorin Anark Player

setting from command line 193setting in configuration file 194

in HTML 186setting in GUI 22

Bottom View edit camera 12bounding boxes

disabling 61keyboard shortcut for viewing 308

breadcrumbs 32, 138break keyword 235Brightness of lights 94

in scripting 262

Anark_Studio_User_Guide.book Page 327 Monday, March 19, 2007 10:34 AM

Page 336: Anark Studio4 User Guide

Index

328 Anark Studio User Guide

bubblingcancelling 231of mouse events 230, 292

bufferingdata 125images 169music 256streaming media 168

.bvs file extension 72

.bvs files, exporting scripts as 74

CCamera object 260Camera Projection mapping for images 105cameras

active, assigning 150edit cameras 12properties of 90in scripting 260

Caps Lock, event property 292case labels in switch statements 235case sensitivity, in scripts 205CD-ROM

installing Anark Studio from 6preparing Anark Media files for 190

changingobject attachments 64order of objects 64Project window size 20See also editing

child objectaffected by its parent object, example 149attached to parent object 49definition of 320

Cinema 4D, guidelines to follow 39CLASSID attribute for HTML 185cleaning up the Library 27clipping

comparison of near and far plane 320of text 86plane, definition of 91

Clipping End 91in scripting (as clipFar) 260

Clipping Start 91in scripting (as clipNear) 260

clockwise (culling) 103closing a behavior 74CODEBASE attribute for HTML 185codecs

affect behavior of AVI files 44

choosing for video export 179guidelines for using 41

collaboration 56Collada

Collada format 36Collada FX 40ColladaMax 36ColladaMaya 36, 39

collapsingobject contents 63property groups 82

colorbackground color

of layers 85of layers in scripting 259of scene 84of splash screen on Web 186of text 89of text in scripting 271

behavior parameter 77border in Anark Player

setting from command line 193setting in configuration file 194

border in HTML 186choosing 116HSL model 116materials, changing 103object, in scripting 272properties of objects, setting 116RGB model 116text 87

in scripting 270timebar, changing 148

Color object 272command line for Anark Player 192comment text 148community forum 8company, acknowledging 23Compile button 74components

adding objects to 140copying objects to 140creating 138duration of 139exporting 60importing 60keyframing 152loading dynamically 132refreshing 56replacing 58

Anark_Studio_User_Guide.book Page 328 Monday, March 19, 2007 10:34 AM

Page 337: Anark Studio4 User Guide

Index 329

in scripting 294setting properties for 117

compressionsetting for video export 42, 179still images 109video images 41

Compression Type 42conditional statements

definition of 320if statements 234if/else statements 235switch statements 235using in scripts 234

Cone Angle 95in scripting (as outerConeAngle) 262

configuration file, for Anark Player 192confirm global function 208Connect to Source

property of images 109property of video 114

Constrain proportions, of project window 21

Container object 296in scripting (as container) 296miscellaneous object type 292

contextTime property 294contextType property 294continue keyword 236Continuous Capture of video 179control key 292, 317coordinate system 50Copy Object Path 63copying

actions 130assets in scripting 245keyframes 156objects

to a component 140in the Object outline 58

path to an object 63project to a new location 10slides 134

counterclockwise (culling) 103createPrimitive 266creating

actions 120attachments between objects 53colors 116components 136custom behavior scripts 72

custom parameters for behaviors 75functions 221objects in scripting 215projects 47slides 134variables in scripting 216

Cuemusic 116sound 115video 114

cullingclockwise versus counterclockwise 103definition of 103, 321objects using Distance Fade 96

in scripting 263curly braces, using in scripts 204Current Slide action

in scripting 295current slide, shown in parentheses 139current time display 32cursor

icons available 287property of Mouse 287

custom parameters, creating in scripts 75

D.dae file extension 39, 305data types

array 207Boolean 206null 207numbers 206object 207strings 206undefined 207

debuggingAnark Client 196using output global function 208

Default Interpolation 18default keyword in switch statements 235default settings

overriding with keyframes 152resetting for the program 19

degree, of anisotropy 110Delete Channel Keyframe(s) 155Delete Item 65delete key 317delete keyword 214deleting

actions 120

Anark_Studio_User_Guide.book Page 329 Monday, March 19, 2007 10:34 AM

Page 338: Anark Studio4 User Guide

Index

330 Anark Studio User Guide

folders from the Storage tab 25keyframes 155layers in scripting 247objects 65resources 27slides 134source files 55Time Labels 132unused resources 27variables 207

deltaTime, event property 291Depth text 86Depth Write, on materials 103deselecting objects 61detaching assets from assets

using actions 126using scripting 245

Diffuse Colorof lights (as Light Color) 94of lights in scripting 262of materials 100

guidelines for importing 41in scripting 249

Diffuse Map for imagesguidelines for importing 41shown in illustration 105

Directional lightcompared to other types of light

sources 93in scripting, as source 262

DirectXfloating-point math 19second choice for renderer 175

Display Name, for custom properties 76Display Properties for screen savers 180displaying

alerts 207confirmations 208current time 31help strings

for custom events 79for custom function properties 78for custom parameters 77

highlights on materials 103line numbers for scripts 74object parameters 29objects as one- or two-sided 103

in scripting (as culling) 249objects as wireframe or solid 103

in scripting (as fillMode) 250

objects behind a layer 85palettes 11pivot points 50prompts 208timebar handles 148tool tips 30See also previewing the project

Distance Fade 96in scripting 263

distributing a presentation 183distribution formats, choosing 176do...while loop 237Document Object Model (DOM) 214dot syntax 204Double Sided property of materials 103dragging an object 311

in scripting 231duplicating

objects 58slides 134See also copying

durationof music 256of objects and behaviors 148of sound 272of video capture 179of the project 59

effect of timebars on 148dynamic

keyframes 159loading 132

EEase In 158Ease Out 158Edit Asset 72Edit Camera tools 16edit cameras

list of all 12mouse and keyboard shortcuts 16, 310

editingbehaviors 73comment text 148components 138folders on the Storage tab 25keyframes by overriding existing ones 154Master slide 135source files 55Time Labels 132See also setting properties of objects, un-

Anark_Studio_User_Guide.book Page 330 Monday, March 19, 2007 10:34 AM

Page 339: Anark Studio4 User Guide

Index 331

locking object propertiesEmbed Fonts 22embedding Anark Media in HTML files 186Emissive Map for images 106Emissive Power of materials 100

in scripting 249Enable Specularity property of

materials 103in scripting 249

End of Fog 92Enter key 316Environmental mapping for images 105equality, testing for 213escape key 317escaping paths in scripts 212event handler

built-in functions 221custom written 79

eventsbubbling 230built-in

key events, properties of 228-229list of 224mouse events, properties of 227system events, properties of 225

event information, accessing 229firing 245HTML 186

.exe file extension 176executable files

configuring and exporting to 182Execute Scriptlet action 129, 224Expand/Collapse arrow

object outline 63property group 82

Exponential Fade 95in scripting 262

exportingto Anark Player (.am) 177behaviors in Anark Studio 74components 60models from 3ds max 41models to AMX format 41objects

effect of Active button 64effect of active flag 244

presentations 176to projector 182to screen saver 180to video 178

exposing parameters in scripts 75expression, definition of 321External Command

action 127global function (as

externalCommand) 209

FF12 key, for previewing 174F6 key, for keyframing 154F7 key, for compiling behaviors 74fading models

in scripting 263various options 96

Field of View 91in scripting (as fov) 260

file extensionscreated during export 176created during preview 174See also media formats, supported

filter buttons 32Find button 74finding instances and resources 62Fire Event action 126firing events 245Fixed aspect ratio. See Scale ModeFixed size. See Scale ModeFlat text

how it is rendered 86how it is scaled 21

Float behavior parameter 76fog

enabling for cameras 92in scripting 260

Fog Color 92in scripting 260

folders on the Storage tab 25fonts

embedding 22setting for text 87

in scripting 270for loops 236force hardware/software option 22formats. See media formats, supportedForum 8forward slash key 318FPS (Frames Per Second) 179frames rendered, total number 296Front View edit camera 12frozen objects

Anark_Studio_User_Guide.book Page 331 Monday, March 19, 2007 10:34 AM

Page 340: Anark Studio4 User Guide

Index

332 Anark Studio User Guide

definition of 233how they behave 244

Full Perspective text 87function scope of variables 218functions

definition of 321event handlers 224

accessing event information 229global 207overview 221syntax of 221

funtion keys 317

GGhost blending mode 102

in scripting 250.gif file extension 305global functions 207global keyword 218Go to Label action 130, 132Go to Slide action 130

in scripting (as activateSlide) 295Go to Time action 129graphics unique identifier (GUID) 57graphics. See imagesGroup object 263Group select 309groups

in scripting 263properties of 95

GUIDs 57

Hhandles for timebars 148Headers HTML parameter 128, 210height

of Anark Player windowset from command line 193set from configuration file 194

of exported video 178of layers 85

in scripting 259of presentation in Anark Player

setting from command line 193setting from configuration file 194

of presentation in HTML documentusing OBJECT tags 185

of presentation in HTML page 186of project window 21

height-to-width ratio 21

Help files, how to access 7help key 317Help String

for custom events 79for custom function properties 78for custom properties 77

help tips, displaying in Inspector 30hexadecimal numbers, as data types 206hiding

line numbers for scripts 74objects 64

behind layers 85palettes 11pivot points 50timebar handles 148using the Shy button 64

hierarchyof object model in scripting 214of objects in Anark Studio 50

highlights. See Specular EnableHorizontal Alignment of text 89

in scripting 270Horizontal Scroll of text 89

in scripting 270HTML

ActiveX methods and properties 189events 186exporting as

using the interface 177global functions for 207parameters, editing 184scripting in

using externalCommand 209using navigate 210

.html file extension 176HTTP headers 128hue, of colors 116

IID attribute for HTML 185identity matrix 284if statement 234if/else statement 235image map

definition of 37See images

Image object 250definition 321

Image Opacity 108Image Size Reduction 108

Anark_Studio_User_Guide.book Page 332 Monday, March 19, 2007 10:34 AM

Page 341: Anark Studio4 User Guide

Index 333

imagesapplied to material, appears to have a

seam 43automapping to a model 104compressing 109dynamically loading 169guidelines for applying to .3ds models 38guidelines for applying to models 41guidelines for creating 41object properties 251opening 104properties of 104in scripting 250troubleshooting 43updating the Library resource for 55

Import Resource 51importing

behaviors 51components 60images, guidelines for 41materials, guidelines for 38models and materials, troubleshooting 43objects 51

independent timelines. See componentsinsert key 317Insert Keyframe 153inserting

comment text in timebars 148keyframes 153

Inspector tabkeyboard shortcuts 313tips for using 29

installation 6instance

definition of 11testing for 214

instanceof keyword 214instances

locating 62of Anark Studio, copying objects

between 59of objects 83

internalCommand global function 189international configuration 6Internet

distributing an Anark Media presentation 184

See also HTMLinterpolation of keyframes

affect of deleting keyframes on 155

application default setting 18setting 157

intrinsic objectsAnark Studio 212JavaScript 211

invisible video, troubleshooting 43Item Selection tool 61

JJavaScript 204

intrinsic objects 211naming conventions 216

JPEGcompression type 109no support for alpha channel 43

.jpg file extension 305Jump To property 294

Kkey events 123Key object 288, 315keyboard shortcuts

for Anark Player 195for Anark Studio 307

keyChar, event property 291keyCode, event property 291keyframe

master 152setting

first one 153without updating the scene 151

keyframes 152automatically setting 154Autoset Keyframes 154copying 156deactivating for a property 155definition of 18deleting 155dynamic 159Ease In 158Ease Out 158F6 key, using to set 154interpolation, setting 157KeyFramesPerSec 179moving 156outside of timebar 152overriding existing 154pasting 156reactivating 155selecting 155

Anark_Studio_User_Guide.book Page 333 Monday, March 19, 2007 10:34 AM

Page 342: Anark Studio4 User Guide

Index

334 Anark Studio User Guide

shown in illustration 147snapping 156

keypress events 292, 321keywords

assigned 211reserved 211

knowledge base 8

Llaunching an application 297Layer Color 85Layer object 258

attaching a camera 260layers

addingobjects to 53to the project 50

duration of 54overview 48, 321properties of 84in scripting 258stacking order of 50

leading of text 89Learning Management System (LMS) 197Left View edit camera 12left-handed coordinate system 50legacy projects 57, 186length

of the project 59of timebars 148

Library tab 26adding new components 56adding objects to

from the Storage tab 25using Import Resource 51

cleaning up 27keyboard shortcut for viewing 308

license codeentering 23required to distribute a presentation 183

Light Map for images 106creating 111

Light object 261Light type 93

in scripting (as source property) 262lights

controlling the brightness 94properties of 93in scripting 261

line numbers 74show or hide 309

Linear Fade 95in scripting 262

linear keyframes 157setting interpolation 158

linking properties 135List behavior parameter 77LMSInitialize 197Load action 125loading

Anark Media filesusing ActiveX 189using load method of assets 245using the command line 192

components (as Playback Modules) 132events 123

in scripting 225images dynamically 169music 168video 168XML documents 301See also Prebuffering

loadSource, event property 291locating resources and instances 62Lock toggle 64LOD bias 110

in scripting (as mipmapLODBias) 252logical operators 213Long behavior parameter 76Loop button 160looping

components 118during playback 160in scripting 294music 115

in scripting 256scene 84sound 115

in scripting 272video 113

in scripting 253loops

do...while loops 237for loops 236in scripting 236while loops 237

Lossless compression 109luminosity, of colors 116

Anark_Studio_User_Guide.book Page 334 Monday, March 19, 2007 10:34 AM

Page 343: Anark Studio4 User Guide

Index 335

M.m1v file extension 305Make Opacity Image 112mapping

image to a model 104video to a model 113

maps. See images, materialsmargins of layers 84Master Animation toggle 146master keyframe

characteristics of 152use caution when deleting 155

master slides 134Material Editor, guidelines to follow 38Material object 249

definition of 322materials

guidelines for creating and exporting 38properties of 100in scripting 249troubleshooting 43

Matrix object 284Maya, guidelines to follow 37, 39media events 124media formats, supported 55melting assets 234, 246Memory object 289menu shortcuts 307method (definition) 322mipmapping 109

in scripting (as mipmapMode) 252Mirrored tiling for images 106Model object 264models

guidelines for creating 37guidelines for exporting

to 3DS 41to AMX 40

obscured models, working with 100properties of 97in scripting 264troubleshooting 43updating the Library resource 55

modulus 214mouse events 124, 230Mouse object 287mouseScroll, event property 291.mov file extension 305moving

application window 11

keyframes 156objects in the Project window 98palettes 11Playhead 151projects 10slides 134tabs on palettes 11timebars 148See also Position property

.mp2 and .mp3 files 255

.mp2 file extension 305

.mp3 file extension 305

.mpe file extension 305

.mpeg file extension 305Multiply blending mode 102

in scripting 250music

adjusting the volume 115cueing to start 116prebuffering 168properties of 115in scripting 255streaming 165

Music object 255compared to Sound object 322

NName

for custom events 79, 291for custom functions 78for custom properties 77

naming objectsin Anark Studio 63in scripting 215

navFlags HTML parameter 210navigate

action 128global function 210

Negative Map for images 106nested components 137new keyword 214new project, creating 10Next Slide action 130

in scripting 295Node objects

definition of 322description of all 257

nonidentity, testing for 214Normal blending mode 102

in scripting 250

Anark_Studio_User_Guide.book Page 335 Monday, March 19, 2007 10:34 AM

Page 344: Anark Studio4 User Guide

Index

336 Anark Studio User Guide

Normal sound 114nudging objects

keyboard shortcuts 312setting an increment 17

null data type 207numeric keypad keys 317numeric property

setting values in Inspector 30NURBs (non-uniform rational B-splines) 39

Oobject

dragging 231, 311new (keyword) 214

object data type 207object model hierarchy 214OBJECT NAME attribute for HTML 185Object outline

keyboard shortcuts 313objects created by scripts do not

appear 216shown in illustration 32tips for using 62

object picker 77Object Projection for images 105object property

of events 225 See also accessing object properties

Object Size property of assets 83object tags

editing 184optional 186required 185

objectsadding

to components 140to the Library 27to the project 52

attaching behaviors to 53copying

in components 140in the Object outline 58the path to 63

customizing properties 75definition of 23deleting 65detached 232duration of 54, 148freezing 233importing 51

nudging 17, 312obscured objects, working with 100properties and methods reference

guide 243properties of, setting 81

using the Inspector 29renaming

in the Library 27in the Object outline 63

reordering 64in scripts

creating 215defining the scope of 218intrinsic 211

selecting for actions 121setting keyframes 153unfreezing 233

octal numbers, as data types 206.ogg file extension 305onAttach event 123onAttach function 225, 232onBuffered function 225onCommand function 233onDetach event 123onDetach function 225, 232onExternalCommand HTML event 187onGroupedMouseOut event 124onGroupedMouseOut function 227onGroupedMouseOver event 124onGroupedMouseOver function 227onKeyDown event 123onKeyDown function 228onKeyUp event 123onKeyUp function 229onLoadComplete event 123onLoadComplete function 226onLoadError event 123onLoadError function 226onLoadProgress event 123onLoadProgress function 225onLoop event 124onMediaBuffered event 124onMediaComplete event 125onMediaComplete function 225onMediaError event 125onMediaError function 225onMiddleMouseClick event 124onMiddleMouseClick function 227onMiddleMouseDown event 124onMiddleMouseDown function 227

Anark_Studio_User_Guide.book Page 336 Monday, March 19, 2007 10:34 AM

Page 345: Anark Studio4 User Guide

Index 337

onMiddleMouseUp event 124onMiddleMouseUp function 227onMouseClick event 124onMouseClick function 227onMouseDblClick event 124onMouseDblClick function 227onMouseDown event 124onMouseDown function 227onMouseOut function 227onMouseOver function 227onMouseUp event 124onMouseUp function 227onMouseWheel event 124onMouseWheel function 228onPause event 124onPlay event 124onProgress HTML event 187onRightMouseClick event 124onRightMouseClick function 227onRightMouseDown event 124onRightMouseDown function 227onRightMouseUp event 124onRightMouseUp function 227onStateChange HTML event 188onUpdate event 124onUpdate function 225opacity

of groups 96in scripting 257

of images 108of layers 85

in scripting 257of materials 103

in scripting 249of models 97

in scripting 257of nodes 257of text 89

in scripting 257overview 111

Opacity Map for imagesguidelines for importing 41use to change transparency of material 105using .png files as 43

OpenGLfirst choice for renderer 175in Anark Client Context menu 197

openinga project 10object contents 63

operatorsarithmetic 213assignment 214definition of 322logical 213

orbitingedit camera 16mouse button shortcut 311

orderrender order of materials 103stacking order of layers 50

originof the ruler 19pivot point of the parent object 50

Orthographic 903D View 12in scripting 260

Output action (for debugging) 127Overlay blending mode 102

in scripting 250

Ppalettes

Assistant 31working with 10See Also tabs

panningedit camera 16mouse button shortcut 311

parametersdefinition of 29, 323exposing in behaviors 75See also properties

parent objectaffects its child objects, example 149definition of 323properties of 49

parent property of a behavior 224pasting keyframes 156paths

specifying in scripts 212for streaming media 166

Pauseaction 129music 256scene (using Initial Play State) 84sound 272video 255

pause key 317percentDone, event property 291

Anark_Studio_User_Guide.book Page 337 Monday, March 19, 2007 10:34 AM

Page 346: Anark Studio4 User Guide

Index

338 Anark Studio User Guide

performance issuesconserve processor power and bandwidth

by choosing the right codec 42streaming media 167

Photoshopcompatibility with 43tips for images 43

Pingsetting for components 118setting for scene 84

Ping Pongin scripting 294setting for components 118setting for scene 84

pivot pointsdefinition of 50guidelines for setting on models 38keyboard shortcut for viewing 308

Pivot propertyof cameras 91of groups 96of layers 85of lights 94of models 97of nodes 257of text 87

pixelsmeasured by on-screen ruler 19texture pixels (texels) 109

Playaction 129button 160

Play Modein scripting (as contextType) 294of components 118of the scene 84

Play propertyof music 256of sound 272of video 255

playbackcontrols 160in different Timelines 139keyboard shortcuts 310total number of frames rendered 296

Playback Moduledynamically loading 125, 132exporting a component as 60

Playback Speedfor ActiveX (as rate) 190

for components 118for the scene 84in scripting (as rate) 295

Player object 292, 295Playhead 150

keyboard shortcuts 312moving without updating the scene 151shown in illustration 32, 147

.png file extension 305

.png files, using as Opacity Maps 43point cloud rendering

in scripting (as fillMode) 250specifying 103

Point lightcompared to other types of light

sources 94in scripting (as source) 262

Polyphonic sound 115Position property

of cameras 91of groups 95of layers 84of lights 94of models 97of mouse events 227, 291of mouse object 287of nodes 257of text 87U and V position of images 107

Position tool 16, 98PostData HTML parameter 128, 210PreBufferAsset behavior

for images 169for streaming media 168

prebufferingimages 169streaming media 168

Preceding Slide action 130in scripting 295

preferences, setting 17Presentation object 292-293presentation size

setting in Anark Studio 20setting in the HTML document 186

using OBJECT tags 185Preserve Texture Coordinates 41previewing the project

setting preferences 23using scrubbing 160using the F12 key 174

Anark_Studio_User_Guide.book Page 338 Monday, March 19, 2007 10:34 AM

Page 347: Anark Studio4 User Guide

Index 339

Previous Slide action 130in scripting 295

primitivesadding

to the Library 27to a project 53

creating 24in scripting 266

printing behaviors 74program preferences, setting 17project file

adding objects to 52creating 10legacy 57opening 10renaming 10reverting to last saved version 10saving 10

project preferences, setting 19Project window 11

constrain proportions 21drag objects onto 52shown in illustration 53

projectorcommand line file for 193configuration file for 194exporting as 182

prompt global function 208properties

creating custom 76of events 229of objects

accessing in scripts 217creating dynamic properties in

scripts 219definition of 323linking 135on the Master Slide 135setting, overview of 81setting, using the Inspector tab 29unlinking 135

Property keyframes 152proxy video 166.psd file extension 305publishing a presentation 167

Q.qt file extension 305QuickTime 305

Rrate of playback. See Playback Speedratio, aspect 21rearranging. See movingredoing commands 66reducing

finished file size 27image size 108

Refresh File 55refreshing

shared components 56source files 55See also updating

regional options, setting 6relative path

for objectsin an action 122in scripting 224

for streaming media 166specifying, overview of 109, 166

Remote Sourceof images 109

in scripting 251of music 116

in scripting 256of video 114

in scripting 253removing

children from nodes 258See also deleting, detaching

renamingbehaviors

in the Library 27in the Object outline 63

objectsin the Library 27in the Object outline 63

projects 10Render Mode

setting for materials 103in scripting (as fillMode) 250

Render Style, of text 86in scripting (as renderStyle) 270

renderingAnark Player menu option 195choosing in Anark Client 196

from the Context menu 197handling in playback applications 174in software, limitations 175order of materials 103

Anark_Studio_User_Guide.book Page 339 Monday, March 19, 2007 10:34 AM

Page 348: Anark Studio4 User Guide

Index

340 Anark Studio User Guide

setting for a project 22setting for ActiveX 190setting for Anark Studio 18total number of frames rendered 296video 180

replacingbehavior text 309shared components 58

resizinglayers 84Object outline 63palettes 11presentation during playback 20Project window 20property entries in Inspector 30timebars 148See also scaling

resourcesadding to the Library 51definition of 23deleting 27locating 62setting properties for 82updating 55

Restore Defaults 19Reverse Play action 130reverting to last saved version 10Rewind button 160Right View edit camera 12root object 49, 323Rotate tool 16, 98rotating objects 98Rotation

behavior parameter 77object type 281

Rotation propertyof cameras 91of groups 95of images 251of lights 94of models 97of nodes 257of text 87of video 253

rulersinside the Project window 19keyboard shortcut for viewing 308setting an increment 19

Ssamples, how to access 7Saturate blending mode 102

in scripting 250saturation, of colors 116saving a project 10

reverting to last saved version 10Scale Mode, of presentation

setting for Active X 190setting in Anark Studio 20setting in command line (as scale) 193setting in configuration file (as Scale) 194setting in HTML 186

Scale propertyof cameras 91of groups 95of lights 94of models 97of text 87

Scale to fit. See Scale ModeScale tool 16, 98scaling

images, for compression 108nodes in scripting 257objects in the Project window 99timeline 147See also Scale Mode, Scale property

sceneproperties of 83root object 49, 323

scene camera 12scene graph, definition of 323Scene object 247SCO. See Sharable Content Objectscope, of objects and variables 218SCORM. See Sharable Content Object Refer-

ence ModelSCORM.bvs behavior 197.scr file extension 176Screen blending mode 102

in scripting 250screen saver

configuring a file during export 180exporting as 176

scriptlets 129, 224scripts

assigned keywords 211creating custom behaviors 72data types 206editing 73

Anark_Studio_User_Guide.book Page 340 Monday, March 19, 2007 10:34 AM

Page 349: Anark Studio4 User Guide

Index 341

exporting 74global functions 207object model for 214operators 213overview 204printing 74representing paths in 212reserved keywords 211resources for JavaScript 204syntax of 204updating after editing 74

scrolling text 89in scripting 270

scrubbingpresentation 160video 166

seek propertyof music 256of sound 272of video 255

seek time 130selecting

actions 125keyframes 155objects 61

in components 138timebars 148

selection modes and tools 61semicolon key 318Set Changed Keyframes 154Set Interpolation 158Set Keyframe Time 156Set Property action 125setting

active camera 150application preferences 17

restoring defaults 19behavior properties 116color properties 116keyframe interpolation 158keyframes 153object properties 81

using the Inspector tab 29pivot points on models, guidelines for 38Presentation Size 20project preferences 19

Sharable Content Object 197Sharable Content Object Reference

Model 197only view on Windows computers 173

sharing .bvs files 74shift key 291, 317shortcut keys 195, 307showing

objectsusing the Active button 64using the Shy button 64

See also displayingShy toggle 64size, of project window 20slides

keyboard shortcut for viewing 308Master slide 134overview 133playing through to next

for components 118for scene 84in scripting 294

Slides tab 133smooth keyframes 157snapping

keyframes 156low, medium, and high resolution 19Playhead 151setting pixel range 18timebars 148

software renderingchoosing for Anark Media file 197limitations 175

solid rendering modein scripting (as fillMode) 250specifying 103

soundadjusting the volume 115properties of 114

Sound object 271compared to Music object 323

source files, working with 55space bar 317Specular Color

of lights 95in scripting 262

of materials 103in scripting 249

Specular Map for images 105Specular Power of materials 103

in scripting 249splash screen

disabling for Anark Playerfrom command line 193

Anark_Studio_User_Guide.book Page 341 Monday, March 19, 2007 10:34 AM

Page 350: Anark Studio4 User Guide

Index

342 Anark Studio User Guide

from configuration file 194setting in ActiveX control 190setting in HTML document 186

Spot lightcompared to other types of light

sources 94in scripting (as source) 262

SRCHTML parameter 184parameter for Internet Explorer 185

stacking order, of layers 50Start of Fog 92Start Time of video capture 179startup view

choosing one 19statements, definition of 323Stop (playback) button 160stop property

of music 256of sound 272of video 255

Stop Rendering button 180Stop Time of video capture 179stopping playback

for the scene or slide 84stopping playback for the scene or slide 84Storage tab 24-25streaming music and video 165String

behavior parameter 77data type 206

SuperCharge Map for images 106support, technical 8switch statement 235system requirements

for Anark Client 183for Anark Player 183for Anark Studio 6for projector files 183for Windows screen saver 183

Ttab key 316table fog 93tabs

Actions 120Basic Objects 24Inspector 29Library 26moving 11

Slides 133Storage 24Timeline 31

Target Lock, for cameras 92in scripting (as lookAtLock) 260

target object 121Target, for cameras 92

in scripting (as lookAtPoint) 260TargetFrame HTML parameter 128, 210technical support 8texels (texture pixels) 109text

adding to the project 54editor, creating in a behavior 77in scripting 269properties of 85

Text object 269Text type 86Texture Mapping, of images

comparison of choices 105important limitation 39in scripting (as mappingMode) 252

Texture Mapping, of videoin scripting (as mappingMode) 255

texture pixels (texels) 109Texture Type, of images 105

in scripting (as materialMode) 252Texture Type, of video

in scripting (as materialMode) 254textures. See images, materials.tga file extension 305this keyword 218thumbnails, for previewing 19.tif file extension 305Tiling, for images 106

in scripting 251Tiling, for video

in scripting 254time contexts

creating 136in scripting 294See also components, slides

time display 31time events 124Time Labels

creating 131using as an event 132using in an action 132

Time paneoverview of contents 147

Anark_Studio_User_Guide.book Page 342 Monday, March 19, 2007 10:34 AM

Page 351: Anark Studio4 User Guide

Index 343

shown in illustration 32timebar

keyboard shortcuts 313tips for using 148

TimeContext object 292, 294, 323Timeline Snapping Grid 18Timeline tab 31

drag objects onto 52keyboard shortcut for viewing 308keyboard shortcuts for zooming in/

out 313moving between 138scaling 147selecting items in 61 See also Object outline

tool tipsenabling and disabling 30for properties 77

Top View edit camera 12tracking of text 89

in scripting 271Transform tools 98

keyboard shortcuts 311transparency

get from alpha channel data 108of background 259See also opacity

tri-linear filtering 110trigger object 121troubleshooting tips 43Type

of variable for custom properties 76typeof keyword 214

UU Pivot, of images 107

in scripting 251U Pivot, of video

in scripting 254U Position, of images 107

in scripting 251U Position, of video

in scripting 254U Repeat, of images 107

in scripting 251U Repeat, of video

in scripting 254U Tiling, of images 106

in scripting (as tilingModeHoriz) 251U Tiling, of video

in scripting (as tilingModeHoriz) 254UNC (Universal Naming Convention) 128UNC paths 167undefined data type 207undoing commands 66unfrozen objects, how they behave 244units of measurement

in Anark Studio 30for imported models 37

unlinking properties 135unlocking object properties 64unused resources, deleting 27update events 124updating

behaviors 74source files 55

URI (Uniform Resource Identifier) 125URL

for streaming media 116, 166HTML parameter 128, 210of Anark Media file 186of image file 109of video file 114

Use Layer Color 85in scripting (as

transparentBackground) 259Utility objects

definition of 324description of all 272

UV coordinatesdefinition of 279required for texture map 37setting 107troubleshooting 44

UV mapping, of images 105in scripting (as mappingMode) 252

UV mapping, of videoin scripting (as mappingMode) 255

UV Rotation, of images 107in scripting (as rotation) 251

UV Rotation, of videoin scripting (as rotation) 253

VV Pivot, of images 108

in scripting 251V Pivot, of video

in scripting 254V Position, of images 107

in scripting 251

Anark_Studio_User_Guide.book Page 343 Monday, March 19, 2007 10:34 AM

Page 352: Anark Studio4 User Guide

Index

344 Anark Studio User Guide

V Position, of videoin scripting 254

V Repeat, of images 107in scripting 251

V Repeat, of videoin scripting 254

V Tiling, of images 107in scripting (as tilingModeVert) 252

V Tiling, of videoin scripting (as tilingModeVert) 254

var keyword 218Variable Name, for custom properties 77variables

definition of 324in scripting

creating 216defining the scope 218incrementing by one 213

Vectorbehavior parameter 77object type 275

Vector2 object 279version

of configuration file 194of the player 295

vertex fog 93Vertex object 280Vertical Alignment of text 89

in scripting 270Vertical Scroll of text 89

in scripting 270video

automapping to a model 113choosing the codec 179configuring a file during export 178continuous capturing 179exporting as

using the interface 176may have an unsupported bit depth 44prebuffering 168properties of 113in scripting 253streaming 165using with a material 113

video cardschoose fog style accordingly 93important limitation 104

Video object 253, 324video, troubleshooting if invisible 43viewing

a finished project 182object contents 63

void keyword 214Volume

of music 115in scripting 256

of sound 115in scripting 271

of video 113in scripting 253

W.wav file extension 305Web browser

selecting as previewing application 23working with global functions 207

Web pages. See HTML file, exportingWhen 44When I apply an image to a material on an

imported model, only a single color is applied. 44

while loop 237width

of Anark Player windowsetting from command line 193setting from configuration file 194

of exported video 178of layers 85

in scripting 259of presentation in Anark Player

setting from command line 193setting from configuration file 194

of presentation in HTML page 186using OBJECT tags 185

of project window 21width-to-height ratio 21Window object 289wireframe rendering mode

in scripting (as fillMode) 250specifying 103

.wmv file extension 305world space 20world units 30wrapper file 197

XX axis 12

left-handed coordinate system 50moving object along 98rotating object around 98

Anark_Studio_User_Guide.book Page 344 Monday, March 19, 2007 10:34 AM

Page 353: Anark Studio4 User Guide

Index 345

in scripting 281scaling object in this direction 99

X Position of layers 84in scripting 259

XML object 292, 300XMLNode object 292, 298

YY axis 12

left-handed coordinate system 50moving object along 98rotating object around 98

in scripting 281scaling object in this direction 99

Y Position of layers 84

in scripting 259

ZZ axis 12

left-handed coordinate system 50moving object along 99rotating object around 98

in scripting 281scaling object in this direction 99

zoomingcamera 90edit camera 16mouse button shortcut 311timeline 147See also scaling

Anark_Studio_User_Guide.book Page 345 Monday, March 19, 2007 10:34 AM

Page 354: Anark Studio4 User Guide

Index

346 Anark Studio User Guide

Anark_Studio_User_Guide.book Page 346 Monday, March 19, 2007 10:34 AM


Recommended