Você está na página 1de 354

Anark_Studio_User_Guide.

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

Anark Studio™ User Guide


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

© 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 i Monday, March 19, 2007 10:34 AM

Table

of
Table of Contents Contents

User Reference 3 Adding objects to the Library . . . . . . . . . . 27


Cleaning up the Library. . . . . . . . . . . . 27
Accessing the Behavior Library . . . . . . . . . 27
Introduction to Anark Studio 5 About the Inspector tab . . . . . . . . . . . . . . 29
Introducing Anark Studio 4.0 . . . . . . . . . . 5 Units of measurement . . . . . . . . . . . . . 30
About this manual. . . . . . . . . . . . . . . . . . . 6 About the Assistant palette . . . . . . . . . . . 31
Windows system requirements . . . . . . . . . 6 About the Timeline tab . . . . . . . . . . . . . . 31
Installation instructions . . . . . . . . . . . . . . . 6
Configuring a computer running an interna-
Chapter 2: Preparing Models, Videos
tional version of Windows . . . . . . . . . . . . . 6
Learning Anark Studio . . . . . . . . . . . . . . . . 7
and Images 35
Providing feedback . . . . . . . . . . . . . . . . . . 8 Choosing a 3D program and export file format
36
About the AMX format . . . . . . . . . . . . 36
Chapter 1: Anark Studio Overview 9 About the Collada format . . . . . . . . . . 36
Working with project files . . . . . . . . . . . . 10 ColladaMaya translator . . . . . . . . . . . . 36
Organizing the palettes and workspace . . 10 ColladaMax translator . . . . . . . . . . . . . 36
Using the Palette menu button . . . . . . 11 Tips for creating models, materials and maps
About the Project window. . . . . . . . . . . . 11 37
Different ways of looking at your scene . . 12 General modeling guidelines and best prac-
Shortcuts for manipulating the edit cameras . tices . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
16 Guidelines for working in 3ds max . . . 37
Keyboard modifiers. . . . . . . . . . . . . . . 16 Guidelines for working in Cinema 4D . 39
Setting program and project preferences 17 Guidelines for working in Maya . . . . . . 39
Setting application preferences. . . . . . 17 Guidelines for exporting to .3ds . . . . . 39
Editing project settings . . . . . . . . . . . . 19 Guidelines for exporting to .dae . . . . . 39
Understanding objects and resources . . . 23 Guidelines for exporting to .amx . . . . . 40
About the Basic Objects tab . . . . . . . . . . 24 Working with exporter plug-ins . . . . . . . . 40
About the Storage tab . . . . . . . . . . . . . . . 24 Exporting models to .amx . . . . . . . . . . . . 41
Working with the Storage tab . . . . . . . . . 25 Exporting models to .3ds . . . . . . . . . . . . . 41
Adding objects from the Storage tab to the Preparing video clips and graphics as image
project . . . . . . . . . . . . . . . . . . . . . . . 25 maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
About the Library tab . . . . . . . . . . . . . . . 26 Preparing image files in Adobe Photoshop

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

Table of Contents

43 Updating behavior scripts . . . . . . . . . . . . 74


Troubleshooting models, materials, videos Exporting and printing behavior scripts . . 74
and images . . . . . . . . . . . . . . . . . . . . . . . 43 Customizing properties for any object . . . 75
General troubleshooting . . . . . . . . . . . 43 Creating custom parameters for objects . 75
3ds max troubleshooting . . . . . . . . . . 44 Working with custom properties . . . . . 76
Working with custom actions . . . . . . . 78
Chapter 3: Creating a Project 47 Working with custom events. . . . . . . . 79
Understanding layers . . . . . . . . . . . . . . . . 48
Understanding attachments. . . . . . . . . . . 49 Chapter 5: Setting Object Properties
Understanding the coordinate system . . . 50 81
How the object hierarchy affects attachments Understanding different types of properties .
50 82
Understanding pivot points . . . . . . . . . . . 50 About setting properties for resources . . . 82
Importing objects . . . . . . . . . . . . . . . . . . 51 About setting properties for instances . . . 83
Adding objects to the project. . . . . . . . . . 52 About linked properties. . . . . . . . . . . . 83
The duration of added objects. . . . . . . 54 Setting properties for the scene or slide . . 83
How the Ctrl key affects adding objects. . Setting properties for layers . . . . . . . . . . . 84
54 Setting properties for text . . . . . . . . . . . . 85
How text is added to the project . . . . . . . 54 Setting properties for cameras . . . . . . . . . 90
Currently supported media formats . . . . . 55 Working with fog . . . . . . . . . . . . . . . . 93
Working with source files . . . . . . . . . . . . . 55 Setting properties for lights . . . . . . . . . . . 93
Refreshing components in the project . . . 56 Setting properties for groups . . . . . . . . . . 95
Creating refreshable components . . . . . . 56 Setting properties for models. . . . . . . . . . 97
Converting legacy projects. . . . . . . . . . . . 57 Shortcuts for setting properties for groups,
Replacing versus refreshing . . . . . . . . . . . 58 models and text . . . . . . . . . . . . . . . . . . . 97
Copying and duplicating objects in the Changing rotation . . . . . . . . . . . . . . . 98
project . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Changing position . . . . . . . . . . . . . . . 98
Duration of the project . . . . . . . . . . . . . . 59 Changing scale . . . . . . . . . . . . . . . . . . 99
Exporting and importing components . . . 60 Working with obscured objects . . . . . . . 100
Selecting objects . . . . . . . . . . . . . . . . . . . 61 Setting properties for materials . . . . . . . 100
Special selection options . . . . . . . . . . . 62 Setting properties for images. . . . . . . . . 104
Selected items vs. active items. . . . . . . 62 Basic properties (for images) . . . . . . . 105
Working with the Object outline . . . . . . . 62 Advanced properties (for images) . . . 107
Renaming objects . . . . . . . . . . . . . . . . 63 Shared properties (for images) . . . . . 108
Rearranging objects . . . . . . . . . . . . . . 64 Mipmapping. . . . . . . . . . . . . . . . . . . 109
Using the Shy toggle and button . . . . . . . 64 Working with opacity . . . . . . . . . . . . 111
Using the Active toggle and button . . . . . 64 Creating a Light Map . . . . . . . . . . . . 111
Using the Lock toggle and button . . . . . . 64 Creating an Opacity Map . . . . . . . . . 112
Deleting objects. . . . . . . . . . . . . . . . . . . . 65 Setting properties for video . . . . . . . . . . 113
Controlling presentation playback . . . . . . 65 Setting properties for sound . . . . . . . . . 114
Undoing and redoing actions. . . . . . . . . . 66 Setting properties for music. . . . . . . . . . 115
Setting color properties . . . . . . . . . . . . . 116
Chapter 4: Customizing and Setting properties for behaviors . . . . . . . 116
Extending Anark Studio 71 Setting properties for components . . . . 117
What are behavior scripts? . . . . . . . . . . . . 72
Understanding behaviors . . . . . . . . . . . . . 72 Chapter 6: Working with Actions,
Creating behaviors. . . . . . . . . . . . . . . . . . 72 Slides and Components 119
Editing behaviors . . . . . . . . . . . . . . . . . . . 73 Understanding actions. . . . . . . . . . . . . . 120
Using the Behavior Editing tools . . . . . 74 Creating and deleting actions . . . . . . . . 120

ii Anark Studio User Guide


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

Understanding Action icons . . . . . . . 121 Autokeyframing . . . . . . . . . . . . . . . . 154


Selecting a Trigger or Target object. . . . 121 Selecting keyframes . . . . . . . . . . . . . 155
Specifying paths for Trigger and Target Deleting keyframes. . . . . . . . . . . . . . 155
objects . . . . . . . . . . . . . . . . . . . . . . . . 122 Turning keyframes on and off. . . . . . 155
Selecting an event. . . . . . . . . . . . . . . . . 122 Moving keyframes . . . . . . . . . . . . . . 156
Selecting an action . . . . . . . . . . . . . . . . 125 Copying and pasting keyframes . . . . 156
Making actions active and inactive . . . . 130 Controlling keyframe interpolation . . . . 157
Copying and pasting actions . . . . . . . . . 130 Playing back a presentation. . . . . . . . . . 159
Dynamically matching a property value using Using dynamic keyframes . . . . . . . . . . . 159
an action . . . . . . . . . . . . . . . . . . . . . . . . 131 How dynamic keyframes are executed . . .
Working with time labels. . . . . . . . . . . . 131 160
Creating a Go to Label action . . . . . . 132 Playback controls . . . . . . . . . . . . . . . . . 160
Using a Time Label as an event . . . . . 132 Scrubbing with the Playhead . . . . . . 160
Loading components dynamically . . . . . 132
Understanding slides . . . . . . . . . . . . . . . 133 Chapter 8: Working with Streaming
Adding slides . . . . . . . . . . . . . . . . . . 134 Media and Dynamic Images 165
Deleting slides . . . . . . . . . . . . . . . . . 134
Working with proxy video. . . . . . . . . . . 166
Rearranging slides. . . . . . . . . . . . . . . 134
Understanding paths for streaming media
Duplicating slides . . . . . . . . . . . . . . . 134
and dynamic images. . . . . . . . . . . . . . . 166
About Master slides . . . . . . . . . . . . . . . . 134
Adding streaming media files to a project . . .
Accessing and exiting the Master slide . . .
167
135
Setting up streaming files . . . . . . . . . . . 167
Linking and unlinking properties . . . . . . 135
Distributing streaming media files . . . . . 169
How objects are copied between slides. . .
Setting up dynamic images. . . . . . . . . . 169
136
How objects are attached between slides .
136 Chapter 9: Viewing and Distributing
Using components . . . . . . . . . . . . . . . . 136 Anark Media Files 173
How the Scene and component Timelines Previewing a presentation . . . . . . . . . . . 174
work . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Setting rendering options . . . . . . . . . . . 174
Playback in different Timelines . . . . . 139 Software renderer limitations . . . . . . 175
Working with slides, components and bread- Choosing a distribution format . . . . . . . 176
crumbs . . . . . . . . . . . . . . . . . . . . . . . . . 139 Exporting a presentation. . . . . . . . . . . . 176
Understanding the duration of compo- Exporting to Anark Player . . . . . . . . . . . 177
nents . . . . . . . . . . . . . . . . . . . . . . . 139 Exporting to Internet Explorer. . . . . . . . 177
Adding and attaching objects to compo- Exporting to video . . . . . . . . . . . . . . . . 178
nents . . . . . . . . . . . . . . . . . . . . . . . 140 Exporting to screen saver . . . . . . . . . . . 180
Copying objects in components . . . . 140 Exporting to projector. . . . . . . . . . . . . . 182
Viewing a presentation . . . . . . . . . . . . . 182
Chapter 7: Animating Objects 145 System requirements for viewing a presenta-
tion. . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Using the Animation toggle. . . . . . . . . . 146
Overview of the Time pane . . . . . . . . . . 147 Distributing a presentation . . . . . . . . . . 183
Scaling the Timeline . . . . . . . . . . . . . . . 147 Editing the HTML document. . . . . . . . . 184
Embedding Anark Media in an existing
Using the timebar . . . . . . . . . . . . . . . . . 148
Resizing timebars . . . . . . . . . . . . . . . 148 HTML file . . . . . . . . . . . . . . . . . . . . 186
Working with cameras and the timebar . . Running older presentations in Anark Cli-
ent 4.0 . . . . . . . . . . . . . . . . . . . . . . 186
150
Using the Playhead . . . . . . . . . . . . . . . . 150 Working with HTML events . . . . . . . 186
Using keyframes . . . . . . . . . . . . . . . . . . 152 Working with ActiveX control methods
and properties . . . . . . . . . . . . . . . . 189
Setting keyframes . . . . . . . . . . . . . . . 152

Table of Contents iii


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

Table of Contents

Preparing Anark Media for a CD-ROM . . 190 Understanding functions . . . . . . . . . . . . 221


Running a presentation on a CD-ROM by Creating functions . . . . . . . . . . . . . . 221
double-clicking . . . . . . . . . . . . . . . . 191 Using the parent property of a behavior .
Running a presentation on a CD-ROM au- 224
tomatically (Windows) . . . . . . . . . . . 191 Event handler functions . . . . . . . . . . . . . 224
Command line and configuration file options Accessing event information . . . . . . . 229
(Windows) . . . . . . . . . . . . . . . . . . . . . . . 192 Working with mouse events and event
Setting up a configuration file for a projec- bubbling . . . . . . . . . . . . . . . . . . . . . 230
tor file . . . . . . . . . . . . . . . . . . . . . . . 195 Cancelling bubbling . . . . . . . . . . . . . 231
Setting up a configuration file for Anark Understanding the onAttach and onDe-
Player (Windows). . . . . . . . . . . . . . . 195 tach functions . . . . . . . . . . . . . . . . . 232
Anark Player features . . . . . . . . . . . . . 195 Using the onCommand function. . . . 233
About the Anark Client controls . . . . . . . 196 Freezing and unfreezing objects . . . . . . 233
Anark Client Control Panel . . . . . . . . 196 Using conditional statements. . . . . . . . . 234
Anark Client Context menu . . . . . . . . 197 Using loops . . . . . . . . . . . . . . . . . . . . . . 236
Creating SCORM-conformant presentations. How behaviors affect animation. . . . . . . 237
197

Chapter 10: Using Scripting 203


Object Reference 241
Overview of scripting . . . . . . . . . . . . . . . 204
Scripting resources. . . . . . . . . . . . . . . . . 204 Scripting Object Reference 243
Scripting syntax . . . . . . . . . . . . . . . . . . . 204 Asset . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Data types . . . . . . . . . . . . . . . . . . . . . . . 206 Scene . . . . . . . . . . . . . . . . . . . . . . . . 247
Global functions. . . . . . . . . . . . . . . . . . . 207 Behavior . . . . . . . . . . . . . . . . . . . . . . 247
Keywords. . . . . . . . . . . . . . . . . . . . . . . . 211 Material . . . . . . . . . . . . . . . . . . . . . . 249
Assigned keywords . . . . . . . . . . . . . . 211 Image . . . . . . . . . . . . . . . . . . . . . . . . 250
Reserved keywords . . . . . . . . . . . . . . 211 Video . . . . . . . . . . . . . . . . . . . . . . . . 253
Objects . . . . . . . . . . . . . . . . . . . . . . . . . 211 Music . . . . . . . . . . . . . . . . . . . . . . . . 255
JavaScript intrinsic objects . . . . . . . . . 211 Node. . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Anark Studio intrinsic objects . . . . . . 212 Layer. . . . . . . . . . . . . . . . . . . . . . . . . 258
Specifying paths in scripting . . . . . . . . . 212 Camera. . . . . . . . . . . . . . . . . . . . . . . 260
Operators . . . . . . . . . . . . . . . . . . . . . . . 213 Light. . . . . . . . . . . . . . . . . . . . . . . . . 261
Object model overview . . . . . . . . . . . . . 214 Group . . . . . . . . . . . . . . . . . . . . . . . . 263
Creating objects using scripting . . . . . . . 215 Model. . . . . . . . . . . . . . . . . . . . . . . . 264
Using variables. . . . . . . . . . . . . . . . . . . . 216 Text . . . . . . . . . . . . . . . . . . . . . . . . . 269
Addressing objects and properties using Sound. . . . . . . . . . . . . . . . . . . . . . . . 271
scripting . . . . . . . . . . . . . . . . . . . . . . . . 217 Utility . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Defining the scope of objects and variables Color . . . . . . . . . . . . . . . . . . . . . . . . 272
218 Vector. . . . . . . . . . . . . . . . . . . . . . . . 275
Function scope . . . . . . . . . . . . . . . . . 218 Vector2. . . . . . . . . . . . . . . . . . . . . . . 279
Behavior scope . . . . . . . . . . . . . . . . . 218 Vertex. . . . . . . . . . . . . . . . . . . . . . . . 280
Working with the global keyword . . . 218 Rotation . . . . . . . . . . . . . . . . . . . . . . 281
Creating dynamic properties for objects . Matrix. . . . . . . . . . . . . . . . . . . . . . . . 284
219 Mouse . . . . . . . . . . . . . . . . . . . . . . . 287
Understanding dynamic objects. . . . . . . 219 Key . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Attaching dynamic objects to components Window . . . . . . . . . . . . . . . . . . . . . . 289
220 Memory . . . . . . . . . . . . . . . . . . . . . . 289
Animating copied dynamic objects . . 220 AKEvent. . . . . . . . . . . . . . . . . . . . . . . . . 291
Understanding how script-controlled proper- Miscellaneous . . . . . . . . . . . . . . . . . . . . 292
ties are handled . . . . . . . . . . . . . . . . . . . 220 Presentation . . . . . . . . . . . . . . . . . . . 293

iv Anark Studio User Guide


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

TimeContext . . . . . . . . . . . . . . . . . . 294 Appendix A: Supported Media For-


Player . . . . . . . . . . . . . . . . . . . . . . . . 295 mats 305
Container . . . . . . . . . . . . . . . . . . . . . 296
XMLNode. . . . . . . . . . . . . . . . . . . . . 298
Appendix B: Shortcut Keys 307
XML . . . . . . . . . . . . . . . . . . . . . . . . . 300

Appendix C: Key Names 315


Glossary and Appendices
303 Scripting Glossary 319

Index 325

Table of Contents v
Anark_Studio_User_Guide.book Page vi Monday, March 19, 2007 10:34 AM

Table of Contents

vi Anark Studio User Guide


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

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.

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

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

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

Introduction to Anark Studio Introduction

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.0


Anark 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.

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

Introduction
Introduction to Anark Studio

About this manual 1. From the Start menu, select Run. The
This manual is intended to introduce Run window will open.
you to version 4.0 of Anark Studio. It a. From the Run window, select the
provides installation instructions and Browse button. The Browse win-
detailed documentation of the Anark dow will open.
Studio interface. For other Anark
b. From the Browse window, select
product documentation, visit the Anark
your CD-ROM drive. The files on
Web site at:
the Anark compact disc should
http://www.anark.com/support. appear.
c. Double-click on the Anark Studio
Windows system setup file, Install.exe, to launch
requirements the installer. The setup program
Š Windows 2000 or Windows XP will now load.
2. Follow the instructions in the
Š Pentium®III processor @ 600 MHz (or
installer. After installation, Anark
better)
Studio will be available on the Start
Š 256 MB of RAM or more menu.
Š Microsoft DirectX 7 or later
Configuring a computer
Š Windows Media® Player 7 or later running an international
installed version of Windows
Š Minimum of 224 MB of free disk space To use Anark Studio when you are
running an international version of
Note: Anark Studio supports three Microsoft Windows operating system,
rendering engines. If you want to you will need to set some specific
view Anark Media presentations Regional Options in the Control Panel.
using the OpenGL® renderer, then
you will need a graphics card that Note: These settings only need to be
supports OpenGL 1.2.1 or later. For configured on the computer that is
more information about the render- creating the presentation; viewers
ing options, see “Setting rendering can view Anark Media regardless of
options” on page 174. their Windows settings.
To configure Regional Options for
Installation instructions Windows 2000:
Anark Studio uses a standard setup 1. Click on Start > Settings > Control
wizard. The steps for installation are Panel > Regional Options.
simple: 2. Do one of the following:
Insert the Anark Studio compact disc • Click on the General tab and change
into the CD-ROM drive on your “Your locale (location)” to English
computer. The Anark Studio Installer (United States). Then click OK. This
should automatically launch. If it will automatically set the correct
doesn’t auto-launch, do the following: numbering properties.

6 Anark Studio User Guide


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

Learning Anark Studio

• Click on the Numbers tab and versions of the following items: Tuto-
manually set the following values: rials, Sample Projects, Sample Assets,
- Set “Decimal symbol” to a period Documentation, Latest Behaviors, Script
(.). Reference, and Latest Exporters.

- Set “Digit grouping symbol” to a Help files


comma (,). After you have installed Anark Studio,
- Set “List separator” to a comma (,). the searchable Reference Manual is easily
accessible from the Help menu. The
3. Click OK.
Reference Manual fully documents the
To configure Regional Options for Anark Studio application interface and
Windows XP: also includes an overview of writing
1. Click on Start > Control Panel.
behavior scripts.
2. Click on “Date, Time, Language, and
Regional Options.” Samples
A Samples folder that contains a wide
3. Click on “Change the format of
variety of presentation assets, including
numbers, dates and times.”
3D models and components, sounds,
4. Do one of the following: music, video, and image maps, is
• In the Standards and formats included with the default Anark Studio
section, select English (United installation. The folder is included as a
States) from the pull-down menu. default directory on the Storage tab.
Then click OK. This will automati-
Behavior reference library
cally set the correct numbering
One way to add interactivity to your
properties.
projects is by using the ready-made
• Set the Number format to behaviors that are included in the
123,456,789.00, and click OK. Behavior Library. The Behavior Refer-
ence Library contains brief descriptions
Learning Anark Studio of each behavior and how they operate.
There are a number of resources Behaviors are separated into categories
available to help you learn Anark Studio. based on their functionality. The
Technical assistance is also available. majority of behaviors have sample
presentations that show how to correctly
Assistant palette setup and use the behavior. The
The first time you open Anark Studio Behavior Reference Library is also avail-
after installation, a welcome page will able as a default directory on the Storage
open in the Assistant palette. The Assis- tab. To access the Behavior Reference
tant palette provides quick access to the Library, select:
Behavior Reference Library and the
Help > Behavior Reference
Reference Manual. There is an Offline/
Online toggle in the upper-right corner Recently created behaviors
of the Assistant Palette that you can use These are behaviors that have been
to access the “online” mode of the written by Anark staff or by members of
palette. The online mode contains a the Anark user community. They are
searchable database of the latest/greatest posted in the Latest Behaviors section of

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

Introduction
Introduction to Anark Studio

the Online Assistant, which is available user community. Type your question
inside of Anark Studio and from the into the Question area, and then click
Support area of the Anark website. Search. You can find the knowledge base
Although the behaviors are not “guaran- at:
teed” to work, Anark is confident that http://www.anark.com/developer/
they are useful and represent a “value- knowledgebase.
add” to your projects.
If the author of the script wishes Technical support
to share their work, they should send The Support area of the Anark website
the script to support@anark.com or has links to the Anark Forum, Knowl-
post it on the Anark Forum at edge Base, and to the Studio Online
http://forum.anark.com. Assistant Palette. To learn more visit:
http://www.anark.com/products/
Anark community forum support.html.
Visit http://forum.anark.com to access
the Anark Community Forum. Anark If you don’t find the answer to your
Technical Support, Professional Services question on the support site, you can
and Content Development experts visit e-mail your question to:
the forums daily and will help answer support@anark.com.
your questions, plus fuel your creative
possibilities and productivity in Anark Providing feedback
Studio. Anark invites you to send your sugges-
tions and feature requests and to report
Anark knowledge base
any issues you may find with Anark
The knowledge base provides access to a
Studio by using the Send Feedback
large number of wiki-style short articles
option under the Help menu.
and FAQs that have been written by
Anark staff or by members of the Anark

8 Anark Studio User Guide


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

Chapter 1: Anark Studio


Overview
1

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.

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

Chapter 1
Anark Studio Overview

Working with project files Playhead” on page 160 for more


When Anark Studio is started, it creates a information.
blank project file for you to work in. To create a new project:
Only one project file can be open at a Do one of the following:
time. If you try to open or create a new
project while one is currently open, the Š Choose File > New.
program prompts you to save the current Š Press Ctrl + N.
file before closing it and opening or
creating the new one. Š Click on the New button.
Anark Media uses .amw (for “Anark To rename a project or move a copy to a
new location:
Media Workspace”) as its file extension.
Choose File > Save As, enter a new name
This file contains the project’s data and
or browse to a new location and click
workspace settings.
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.
The New, Open and Save buttons are avail-
To open an existing project:
able in the application tool bar.
1. Do one of the following:
To save a project:
1. Do one of the following:
• Choose File > Open.
• Press Ctrl + O.
• Choose File > Save.
• Click on the Open button.
• Press Ctrl + S.
2. Locate and select a project file from
• Click on the Save button.
the file browser and click Open.
2. If this is the first time you are saving
the file, enter a name for the file. Note: Earlier versions of Anark Studio
3. Click OK. cannot open files created in later
versions. Presentations created in
After a project has been saved,
Anark Studio 4.0 cannot be opened
previewing it (using the F12 key) or
in Anark Studio 3.5.
exporting it creates some additional files.
For more information about the files To revert to the last saved version of the
that are created when a project is project:
previewed, see “Previewing a presenta- Choose File > Revert and select Yes at the
tion” on page 174. For more information Are you sure? prompt. No backup file is
about the files that are created when a made, so any changes you made since
project is exported, see “Exporting a you last saved the file will be perma-
presentation” on page 176. nently lost. Reverting cannot be undone.

Note: Previewing is the only way to Organizing the palettes and


see behaviors and actions. They are workspace
not executed when the Playhead is The first time Anark Studio runs, it uses
scrubbed. See “Scrubbing with the the default workspace layout, which
displays all the available palettes. Each

10 Anark Studio User Guide


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

Using the Palette menu button

palette has a default set of tabs. Both the To resize a palette:


palettes and the tabs can be moved, 1. Position the mouse over the border
resized and hidden, allowing you to of a palette so that a double arrow
organize the workspace according to appears.
your personal preferences. All palettes 2. Drag the border or corner until the
are easily docked to other palettes and palette is the desired size.
can be undocked by dragging them.
Using the Palette menu button
Tip: Anark Studio saves your work- The Palette menu button ( ) allows
space settings as you change them. you to move the palette tabs and to
However, any time you want to reset create new palettes. The menu items are
your choices, and return all palettes dynamically generated based on the
to their original locations, you can palette and tab you are working in.
do this easily by clicking the Restore
To move a tab:
Defaults button at the bottom of the
Click on the Palette menu button and
Application Preferences dialog. (This
select a location to move the tab to from
dialog is opened by selecting Edit >
the pull-down menu.
Application Preferences.)
To create a new palette:
To move the application window: Click on the Palette menu button and
In order to move the application select Create New Palette from the pull-
window, Anark Studio must not be down menu.
maximized. Click on the application
Title bar and drag the window to the
About the Project window
desired location on your desktop.
The box in the center of the application
To display a palette: window is the Project window where the
From the View menu, select the palette content and action of the scene are
you want to view. displayed. When a new project is
To hide a palette: created, or when Anark Studio is first
Do one of the following: started, the Project window is blank. To
add items to the scene, you drag them
Š From the View menu, select the palette
from the Library or Storage palette or
you want to hide.
from a Windows Explorer window to
Š Click the Close button on the palette either the Project window or the Object
you want to hide. outline in the Timeline tab, creating
To move a palette: instances of them. For more information
Drag the palette by its Title bar to the on adding objects, see “Adding objects
desired location. to the project” on page 52.

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

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

Chapter 1
Anark Studio Overview

Different ways of looking at simulate actual visual perception.


your scene
Note: Please note that all perspectives
All scenes in Anark Studio are inherently
on a planar surface have some
3-dimensional. To view these 3D scenes
degree of distortion, similar to the
you have several choices. You can use
distortion created when portraying
the Scene Camera view (described
the earth’s surface on a planar map.
below), which shows how your presenta-
tion will be viewed when it is deployed. Š 3D Orthographic View – Orthographic
Alternatively, you can use edit camera projection is a means of representing a
views, which allow you to view the 3D three-dimensional object in two
space from several predefined angles. dimensions. It creates multiple views
You can view your scene from multiple of the object, using points of view
viewpoints; these alternate viewpoints rotated about the object’s center
are called edit cameras. The edit cameras through increments of 90°.
allow you to navigate and peruse the You can think of the appearances of
scene without making any changes to views as being projected onto planes
cameras present in the Scene Camera that form a transparent “box” around
view. 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
Anark Studio has nine different edit cameras (increasing values of Y).
to choose from.
Š Left View – Assumes a viewpoint
For information about the coordinate
looking directly up the X axis
system used by Anark Studio, see
(increasing values of X).
“Understanding the coordinate system”
on page 50. Š Right View – Assumes a viewpoint
The various edit camera views are: looking directly down the X axis
(decreasing values of X).
Š Scene Camera View – This viewpoint
is always co-located with the scene Š Front View – Assumes a viewpoint
camera. This is the default edit camera looking directly up the Z axis
view. (increasing values of Z).

Š 3D Perspective View – A type of Š Back View – Assumes a viewpoint


rendering that graphically approxi- looking directly down the Z axis
mates on the screen the images of (decreasing values of Z).
three-dimensional objects so as to

12 Anark Studio User Guide


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

Different ways of looking at your scene

A small toolbar consisting of five icons


allows you to control and manipulate Tip: When the edit camera dropdown
the position of the currently selected menu widget has focus, scrolling the
edit camera. For more information, see middle mouse button takes you
“Shortcuts for manipulating the edit sequentially through all the various
cameras” on page 16. edit cameras. In this manner, this
technique provides a quick way to
look at your scene from all possible
angles.

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

Chapter 1
Anark Studio Overview

Scene Camera View (Default)

3D Perspective View 3D Orthographic View

A comparison of the various 3-dimensional


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

14 Anark Studio User Guide


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

Different ways of looking at your scene

Top View Bottom View

Left View Right View

Front View Back View

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

Chapter 1
Anark Studio Overview

Shortcuts for manipulating zooming:


the edit cameras Left/right mouse button: Press and
You can use either the mouse or drag to zoom
keyboard shortcuts to manipulate the Middle mouse button: Spin to zoom
position of the currently selected edit
• Keyboard Shortcut: n/a
camera. The interface also includes
controls for making the same sort of
Tip: If you have a middle mouse but-
adjustments.
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
Toolbar icons for controlling the currently around the selected object(s) in the
selected edit camera. scene (after you do a ‘Fit Selected’); if
To select an edit camera tool: no object(s) are selected, it orbits
Click on the icon for it or press one of around the entire scene, while always
the following keys: looking towards the center of the
scene.
Š Fit Selected – Centers the current edit
• Mouse Shortcut: Use any mouse
camera view on the currently selected
button to orbit the camera:
model or group. If no object is selected,
the camera centers on the entire scene. Left/right mouse button: Press and
drag to orbit
• Mouse Shortcut: n/a
Middle mouse button: Spin to zoom
• Keyboard Shortcut: f
• Keyboard Shortcut: n/a
Š Edit Camera Pan – With the Pan tool
selected, the edit camera tracks mouse Note: This control is only enabled for
movements around in the XY plane. the 3D edit camera modes.
• Left/right mouse button: Press and
drag to pan
Š Shading Mode Toggle – Toggles the
rendering method from wireframe to
• Keyboard Shortcut: n/a shaded.
Tip: If you have a middle mouse but- • Mouse Shortcut: n/a
ton, you can click and drag it at any • Keyboard Shortcut: F3
time to enable the Pan tool.
Keyboard modifiers
Š Edit Camera Zoom – With the Zoom When some Edit Camera tools are
tool selected, the edit camera tracks enabled, you can temporarily enable a
mouse movements either in (towards different tool by holding down modifier
the objects in the scene) or out (away keys. The Edit Camera tool icon in the
from the objects in the scene). Project window will change to the
• Mouse Shortcut: Use any mouse currently enabled tool. The following
button to change the degree of

16 Anark Studio User Guide


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

Setting program and project preferences

table lists how the keys affect the Setting program and project
currently selected tool. preferences
Currently Selected Tool Anark Studio allows you to set prefer-
Modi- Fit Edit Edit Edit Shad- ences for each project and for the appli-
fier Selecte Cam- Cam- Cam- ing cation itself. The application settings are
Key * d era era era Mode saved when you close the project so that
Pan Zoom Orbit Toggle the next time you open Anark Studio, it
Alt No Zoom Orbit Zoom No will use the same application settings.
key effect effect
Ctrl No Orbit Pan Pan No Setting application preferences
key effect effect
To set application preferences:
* The mouse must be inside the perimeter of the
Project window when you press the modifier key. Choose Edit > Application Preferences.
The Preferences dialog opens. In
Windows, the Application tab will be
selected.

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

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

Chapter 1
Anark Studio Overview

pressing the arrow keys on the keyboard. snaps to every tall tick. Low snaps to
Defaults to .01. For more information every numbered tall tick.
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. Timeline Snapping resolution can be set to
low, medium or high.
Default Interpolation – Specifies whether
Anark Studio will create keyframes with For information about scaling the Time-
Smooth interpolation (also referred to as line, see “Scaling the Timeline” on
Bezier interpolation) or Linear interpola- page 147.
tion. The interpolation of any existing Studio Renderer – Sets the rendering
keyframes will not be changed; however, preference for presentations when
the interpolation of any new keyframes viewed in Anark Studio’s Project
will be set to this value. The interpola- window. This setting can be used to see
tion of individual keyframes can also be how the different renderers will display
set using the Timeline menu. For more the content of the scene.
information about keyframes and inter-
polation, see “Controlling keyframe Auto – This is the recommended set-
interpolation” on page 157. ting. It tries the following sequence of
renderers and uses the first one that’s
Quick Definition available: DirectX, OpenGL, then Soft-
Keyframe - A keyframe controls the ware.
data for a property at a single moment
in time. At least two keyframes, each DirectX – Uses Microsoft DirectX® for
with different values, are needed for a rendering the scene. DirectX is a group
property to be animated. of technologies that enable Windows-
based computers to run multimedia
Timeline Snapping Grid – The checkbox applications. Fast frame rates are
specifies whether elements on the Time- possible with DirectX rendering.
line tab, including the Playhead, time-
OpenGL – Uses OpenGL for rendering
bars and keyframes, will snap to marks
the scene. OpenGL is a cross-platform
on the Time measure. The pull-down
standard for 3D rendering and 3D
menu lets you select the snapping reso-
hardware acceleration. Fast frame rates
lution. High snaps to every tick. Medium
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

18 Anark Studio User Guide


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

Editing project settings

“Software renderer limitations” on Snapping Grid – Choose between low,


page 175 for more information. medium, and high resolution snapping.
If the machine Anark Studio is running If snapping is enabled, objects inside the
on does not support OpenGL or DirectX, Project window snap to this invisible
those options will not be available in the grid. The pull-down menu lets you select
Studio Renderer list. the snapping resolution. High snaps to
every tick. Medium snaps to every tall
Note: OpenGL is able to evaluate tick. Low snaps to every numbered tall
floating-point numbers more pre- tick.
cisely than DirectX does, which can
Editing view
lead to slight differences in render-
Background Color – Opens the standard
ing or to unexpected results in
Windows color picker. Choose the color
behaviors. In DirectX, if you set a
you want to see used for the background
value for an object to an exact deci-
of editing views inside the Project
mal point (e.g., 123.456) the value
window.
returned may not be that exact deci-
mal value (123.45600123173828 Preferred Startup View – Choose your
would be returned instead). preferred startup view. Your choice may
depend on the type of project you are
Preview Thumbnails – Controls whether currently working on. For more details
or not thumbnails will be displayed for about startup views, refer to “Different
importable file types in the Storage tab. ways of looking at your scene” on
When thumbnails are previewed, it may page 12.
take longer for the content on the
Storage tab to fully display. Restoring application defaults
Restore Defaults – Click to reset all pref-
Rulers erence settings and palette locations to
Major Increment – Sets the pixel incre- their original values.
ments that are labeled in the ruler. The
ruler is displayed around the perimeter Editing project settings
of the Project window. Pixels are always
The Project Settings tab allows you to
the unit of measure used in the ruler.
configure items specific to an individual
Origin – Sets the origin of the ruler. presentation.

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

Chapter 1
Anark Studio Overview

To edit project settings: example, if an object appears to take up


Choose Edit > Project Settings or press a third of the window before resizing, it
Ctrl + P. The Project Settings dialog will still appear to take up a third of the
opens. 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.

Presentation Size The project window is set to 512 X 300


You can change the size of the Project (top). Changing the height of the window to
window, which controls what the viewer 512 X 200 (middle) maintains the aspect
ratio of the objects within the space. Objects
will see during presentation playback. that appear to take up a third of the window
Layers and the objects attached to them before resizing still appear to take up a third
may extend beyond the borders of the of the window after resizing. Changing the
Project window, but only the portions width of the window to 300 x 300 (bottom)
does not maintain the aspect ratio of the
within its borders will be displayed.
objects. Objects located outside the bounds
Changing the size of the Project window of the new window size are cropped.
affects the view of objects in the scene Scale Mode – Sets how the size of the
because it changes the 3D “world space” Project window will be determined and
of the scene. Due to the way the 3D whether the viewer will be allowed to
space is calculated, changing the height resize the presentation window.
of the window maintains the aspect ratio
of the objects within the space. For

20 Anark Studio User Guide


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

Editing project settings

Fixed size – Uses the Width and Height


Note: If your presentation uses either
settings as the size of the Project
window. When the finished Flat text or an orthographic camera,
presentation is viewed, the user will and the Scale Mode isn’t Fixed Size,
not be able to resize the presentation. be sure to test how the presentation
resizes to make sure the objects scale
Scale to fit – Sets the Project window to they way you want them to. In some
fill the current workspace. When the cases, you may want to use the Fixed
finished presentation is viewed, the Size Scale Mode.
presentation will be automatically
sized to fit the viewer’s current browser Width – Sets the horizontal length of the
window size. The viewer can also resize Project window in pixels. Range = 1 to
the presentation. Changing the height 2048.
of the window maintains the aspect Height – Sets the vertical length of the
ratio of the objects within the space. Project window in pixels. Range = 1 to
Changing the width of the window 2048.
does not maintain the aspect ratio;
Constrain Proportions – Specifies
objects located outside the bounds of
whether the current proportions of the
the new window size will be cropped,
Project window will be kept at their
or additional space will be added to the
present settings. You can then change
edges.
either the Width or Height setting and
Fixed aspect ratio – Allows the viewer the program will automatically fill in the
to resize the presentation window but other number in order to maintain the
always maintains the original aspect current height-to-width ratio.
ratio of the objects within it.

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

Chapter 1
Anark Studio Overview

Export Options will see an error message within their


Border Color – Sets the color of the playback application.
border between the presentation Force Software – Limits the playback of
window and the playback application the presentation to the Software ren-
(e.g., a Web browser, Anark Player, etc.). derer only. OpenGL and DirectX ren-
Playback Preferred Renderer – Sets a flag derer choices will not be available
in the exported presentation that can be when playing back this presentation in
read by the playback application to help the end user’s playback application.
decide what rendering engine to use for
the presentation when it is viewed on a Important: The Force Hardware
user’s machine. Because of the vast option must be used when the
differences among video cards and Anark presentation is used as or
processors, the end user can also control made into a commercially distrib-
the rendering engine used on his or her uted video game that sells for more
machine. than $4.00 U.S., as explained in the
Auto – Allows the user’s machine to try
License Agreement.
a sequence of renderers and uses the
first one that’s successful. It tries the Note: Anark Media presentations that
renderers in the following order: were created in Anark Studio 2.0.1
DirectX, OpenGL, then Software. or earlier have Auto set as their Play-
back Preferred Renderer.
Auto is the recommended setting. For a
description of DirectX, OpenGL, and For more information about controlling
Software, see “Setting application pref- rendering for a presentation, see “Setting
erences” on page 17. rendering options” on page 174.
Force Hardware – Limits the playback Embed Fonts – Sets whether or not fonts
choices for the presentation to either used in text objects will be embedded in
OpenGL or DirectX. The Software ren- the finished Anark Media (.am) presenta-
derer choice will not be available when tion file. If fonts are embedded it will
playing back this presentation in the increase the file size but it also ensures
end user’s playback application. Users that viewers can see text in your chosen
viewing a presentation with the Force font. If fonts are not embedded and the
Hardware flag on a machine that does viewer does not have the chosen font
not have OpenGL or DirectX support installed on his or her computer, the
text will be displayed in Arial.

22 Anark Studio User Guide


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

Understanding objects and resources

Project Info viewed but are not directly visible them-


Author – Allows you to enter the name selves. Behaviors are a special type of
of the author of the project. object that add interactivity to the scene.
Company – Allows you to enter the name A resource refers exclusively to objects
of the company where the project was that have been added to the Library.
created. Resources act as templates for creating
Anark Client License – Enter a valid client instances of objects in the scene. Their
license code, which grants you a full data is embedded in the finished presen-
legal license to your content. Only tation file and increases its size.
licensed content has access to Anark Custom properties for objects are made
Playback Module loading, XML script at the Library resource level, so if a prop-
object loading or posting, or the use of erty is added to one instance, it is auto-
internal and external commands to matically propagated to the Library
interact with a web browser. resource and all other instances at the
same time. See “Working with custom
Preview Preferences properties” on page 76 for more details.
Select Application – Sets whether Anark
For information about working with
Player, the default Web browser, or
objects and behaviors in a scene, see
another type of viewer (custom) will be
“Chapter 3: Creating a Project” on
used for previewing the project. For
page 47. For more information about
more information about previewing a
resources and the Library palette, see
project, see “Previewing a presentation”
“About the Library tab” on page 26.
on page 174.
Quick Definition
Understanding objects and Object - An object is any visual or audi-
resources tory element that can be added to a
This manual frequently refers to objects scene, or any element that controls
and resources, which are closely related, how the contents of the scene are
but the distinctions between them are viewed.
important to understand. Resource - A resource is an object that is
An object can be loosely defined as any in the Library palette, and that can be
visual or auditory element that can be used to create instances of objects in
added to a scene, or any element that the scene.
controls how the contents of the scene Behavior - A behavior is a special type
are viewed. Objects such as 3D models, of object that contains instructions for
video images, streaming music and 2D how other objects should act. Behavior
graphics have a physical presence. They scripts are XML (Extensible Markup
can be seen or heard in the project. Language) documents with a .bvs
Several other objects, including layers, extension. They are typically used to
groups, lights and cameras, control the add interactivity to the scene.
way the visual objects are grouped and

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

Chapter 1
Anark Studio Overview

About the Basic Objects tab About the Storage tab

The Basic Objects tab contains a row of The Storage tab is a file repository that
buttons that allow you to add built-in lets you quickly access object files such
objects and primitives to your project. as 3D models, sounds, 2D graphics,
There are nine built-in resource object videos and behavior scripts that you
types: Component, Group, Text, Layer, may want to use in your project. It
Camera, Light, Behavior, Video and features folders for organizing objects by
Music. There are five primitive objects: type and a second pane to quickly access
Rectangle, Sphere, Cube, Cylinder and their contents.
Cone.
You can drag and drop items from the
Every time an item from the Basic Storage tab onto the Timeline or Project
Objects tab is dragged into the project, window, or you can add items to the
it’s added to the Library and therefore Library using the Add to Library button.
increases the finished file size. Whenever Items on the Storage tab are not
possible, it’s a good idea to reuse existing included in a project until you add
Library resources instead of continually them.
adding new resources. An exception to
this rule is text objects. Because they are Note: Text and components are not
not added to the Library, you must drag added to the Library, although the
instances from the Basic Objects tab objects inside a component are. For
each time, or otherwise copy or dupli- more information, see “How text is
cate them. For more information about added to the project” on page 54.
adding basic objects to your project, see
“Adding objects to the project” on Two default folders are included when
page 52. Anark Studio is installed: the Behavior

24 Anark Studio User Guide


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

Working with the Storage tab

Library and Samples. You can add and someone else, you must edit the
delete folders, edit their names, etc. path to be relative and ensure that
they have the same directory struc-
Working with the Storage tab ture; otherwise, only their default
When you add a folder to the Storage folders will be displayed. For more
tab, it creates a dynamic link to a direc- information about specifying paths,
tory or file on your computer or see “Understanding paths for
network. If you rename, add, move or streaming media and dynamic
delete a file or directory from your images” on page 166.
computer or network, that change will
be reflected on the Storage tab. You can Note: If you add a directory to the
also refresh the Storage tab manually Storage tab from a network drive
during a session. that contains an extremely large
number of files, it may slow down
To add files to the Storage tab you must
the loading time of any Anark Stu-
either map an existing directory on your
dio presentation that includes that
computer to the Storage tab or add files
folder.
to a directory on your computer or
network that is already mapped to a To delete a folder:
folder on your Storage tab. 1. Select a folder.
To add a folder: 2. Click on the Palette menu button
1. Click on the Palette menu button ( ) and select Delete Folder. Delet-
( ) and select Add Folder. The Add ing a folder will not remove the files
Folder dialog box will open. from your hard drive or network. It
2. Select a name and a root directory for will only delete the Storage tab’s link
the folder. If you don’t type in a to the directory.
name, the directory’s current name 3. Click Yes.
will be used. To edit a folder:
3. If you want this directory to be avail- Click on the Palette menu button ( )
able for all your Anark Studio and select Edit Folder. Change any
projects, check “Create as default settings you want and click OK.
folder on application launch.” If you
want to use it for this project only, Adding objects from the Storage
leave it unchecked. tab to the project
4. Click OK. Files on the Storage tab can be added to
the Library or directly to the Project
All of the files, folders and subfolders window or Timeline (which automati-
within the root directory will be cally adds it to the Library, as well). This
included in the new folder on the only works for individual files, not
Storage tab. folders. While components are not
added to the Library, their contents are.
Note: When you initially add a direc-
tory to the Storage tab, the absolute To add a resource to the Library:
path is used. If you plan to share Do one of the following:
your project file (the .amw file) with Š Select the object file and click the Add

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

Chapter 1
Anark Studio Overview

to Library button. About the Library tab


Š 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.
The Library tab is a storehouse for the
Tip: When models are dragged onto
resources that you are using in your
the Project window, they are placed project. Resources act as templates for
creating instances of objects in the
in the center by default. Holding
down Alt as you drag a model will scene.
place it at the location of the mouse For a description of the differences
instead. 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.

26 Anark Studio User Guide


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

Adding objects to the Library

The Library displays the name of each may also want to clean out the Library as
built-in and imported resource and the you are working on a project. There are
icon for its object type. These resources two ways to get rid of unused items in
serve as templates for the objects and the Library.
interactive behaviors that you add to the To delete a single resource from the
project (using the instructions in Library:
“Adding objects to the project” on 1. Select a resource in the Library.
page 52).
2. Do one of the following:
To rename items in the Library:
• Press the Delete key.
1. Select the item in the Library and
then double-click on the text of the • Right-click and select Delete Item
item’s name or press the F2 key. from the Context menu.
2. Type a new name and press Enter. If there is an instance of the resource in
the presentation, an error message will
Adding objects to the Library appear. If you still want to delete the
resource, you must first delete all
There are several ways to add items to
instances in the presentation and delete
the Library.
the resource again.
Š From the Storage tab using the Add to To delete all unused resources:
Library button. If the Library is on a With the mouse over the Library, right-
separate palette, items can also be click and select Delete Unused Resources
dragged onto the Library from the from the Context menu. Every resource
Storage palette. See “Adding objects that is not currently being used in the
from the Storage tab to the project” on scene will be deleted.
page 25 for more information.
Š From the Basic Objects tab by adding Accessing the Behavior Library
objects to the project. See “Adding When you are ready to start working
objects to the project” on page 52 for with behaviors, which create the interac-
more information. tivity of the scene, you can import any
of the common interactive behaviors
Š From the Library tab using the Import that are included in the Behavior Library
Resource menu item. See “Importing tab on the Storage tab or you can create
objects” on page 51 for more informa- your own.
tion.
A Behavior Reference HTML page that
Text cannot be brought into the Library. provides information about what each
For more information, see “How text is behavior does is easily accessible from
added to the project” on page 54. the Help menu or from the Online Assis-
tant (accessible from the Anark website).
Cleaning up the Library
As you add and remove objects from The Behavior Reference Library contains
your scene, the Library may get cluttered brief descriptions of each behavior and
with resources that aren’t being used. how they operate. Behaviors are sepa-
This can significantly increase the final rated into categories based on their func-
file size. Before you publish your project, tionality. The majority of behaviors have
you should clean out the Library. You

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

Chapter 1
Anark Studio Overview

sample presentations that show how to toolbar to create an empty Behavior


correctly setup and use the behavior. object and then edit the behavior
To create a custom behavior, you can using the instructions in “What are
click on the Behavior button in the behavior scripts?” on page 72.

28 Anark Studio User Guide


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

About the Inspector tab

About the Inspector tab 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.
Quick Definition
Parameter - 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
The Inspector tab is used to edit the in this manual, the two terms are used
properties of selected objects and behav- interchangeably.
iors.
To turn on the Animation toggle for an
When a resource is selected in the object or property:
Library or an object is selected in either Do one of the following:
the Timeline or the Project window, the
current settings for its editable properties Š Click on the box next to the object’s
are displayed in the Inspector. When an name to turn on the Master Animation
object in the Timeline is selected, toggle, which turns on the toggle for
Animation toggles ( ) also appear. all of its properties as well.

Each object type has its own set of prop- Š Click on the box next to a property to
erties. The editable properties of behav- turn on only that Animation toggle.
iors are also displayed in the Inspector The Animation toggle must be turned on
when selected. in order to set keyframes for a property.
The Inspector features several types of For more information about the Anima-
parameter controls, such as pull-down tion toggle, see “Using the Animation
menus, sliders and numerical entry toggle” on page 146.
boxes. For added flexibility, the interface

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

Chapter 1
Anark Studio Overview

To set a numeric property in the create animation), see “Setting


Inspector: keyframes” on page 152.
1. Click in the edit field of the property
To enable or disable tool tip display:
you want to change.
Select View > Tool Tips.
2. Do one of the following:
To resize the property entry fields:
• Type in the desired value and press Drag the divider bar at the top of the
Enter/Return. Inspector to the desired location.
• 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 Units of measurement
value in increments of 10. Holding Unless otherwise indicated, the parame-
down the Ctrl key changes the value by ters of objects are set in generic “world”
.10. units. Unlike standard measurements
For information about setting properties like inches or centimeters, these units
for objects, see “Chapter 5: Setting are arbitrarily defined by the 3D space
Object Properties” on page 81. For infor- taken up by the various elements of the
mation about setting keyframe data project.
using the Inspector (which is used to

30 Anark Studio User Guide


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

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 tab


The 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.

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

Chapter 1
Anark Studio Overview

A. Breadcrumbs – Helps you quickly nav- • Locked – Determines whether an


igate between components and the object’s properties can be edited. For
Scene. more information, see “Using the
B. Current time – Displays the current Lock toggle and button” on page 64.
time in the presentation, according to D. Playhead – Points to the current time
the location of the Playhead. in the Project window. For more
C. Filter buttons and toggles – Control information, see “Using the Playhead”
whether objects will appear in the on page 150.
Object outline or project, and E. Actions column – Indicates when an
whether they can be edited. object has an action associated with
• Shy – Determines whether an object it. For more information, see “Under-
will be shown in the Object outline. standing actions” on page 120.
If the Shy toggle is on for an object F. Object outline – Contains a hierar-
and the Shy filter button is on, chical list of all objects and behaviors
neither the object nor any of its that have been added to the project,
children will appear in the list. For along with any animatable parame-
more information, see “Using the ters. For more information, see
Shy toggle and button” on page 64. “Working with the Object outline” on
• Active – Determines whether an page 62.
object will be active in the project. G. Time pane – Contains controls for
For more information, see “Using animating the parameters of objects
the Active toggle and button” on and behaviors. For more information,
page 64. see “Overview of the Time pane” on
page 147.

32 Anark Studio User Guide


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

About the Timeline tab

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

Chapter 1
Anark Studio Overview

34 Anark Studio User Guide


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

Chapter 2: Preparing Models,


Videos and Images
2
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.

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

Chapter 2
Preparing Models, Videos and Images

Choosing a 3D program and materials and maps. The Anark Maya


export file format AMX Exporter includes everything
except texture map data.
Currently, Anark Studio can read 3D files
created in the following applications: As new exporter plug-ins become avail-
able, they will be posted in the online
Š .3ds files created in 3ds max™ Release Assistant Palette.
2.5 or later
Š .amx files created in: About the Collada format
COLLADA (COLLAborative Design
• 3ds max Release 5.0 or later
Activity) is a royalty free, open standard
• Maya version 4.0 or later for the interactive entertainment
• LightWave 6.5 or later industry. The standard defines an XML-
• Cinema 4D 8 based schema for 3D authoring applica-
tions to freely exchange digital assets
Š .dae (Collada) files created in 3ds max without loss of information. This
or Maya enables multiple software packages to be
3ds max, Maya, LightWave and Cinema combined into powerful tool chains.
4D are 3D modeling, animation and
rendering programs. ColladaMaya translator
The Maya Collada plug-in supports
Exporting to the AMX format is recom-
importing/exporting Maya scenes
mended for most projects unless the 3D
according to the Collada format specifi-
scene includes instances, which are
cations. The binaries, source code and all
supported in .3ds but not in .amx. If
associated documents are released under
your 3D scene includes animation,
the MIT License. Please take the time to
exporting to .dae will allow you to
read the documentation before using
import that animation into Anark. For
ColladaMaya.
information about the exporter plug-ins,
see “Working with exporter plug-ins” on Anark Studio ships with a custom-built
page 40. exporter plug-in for Maya. This exporter
fixes some known bugs existing in the
About the AMX format ColladaMaya exporter available from
AMX is a file format created by Anark to Feeling Software, and is available in the
generalize the format of 3D files so that Collada folder of the Anark Studio instal-
the widest variety of 3D models and lation directory. Use this exporter if you
scenes can be imported into Anark wish to create Collada files with Anark
Studio. Studio.
To enable the various modeling and
ColladaMax translator
conversion programs to export 3D
Anark Studio can import Collada files
models and scenes in the AMX format,
exported from 3ds max using the 1.05
Anark has created exporter plug-ins for
version of the Feeling Software Collad-
those programs. With the exception of
aMax exporter. You can find the installer
files that were originally created in
for this exporter, plus installation
Maya, AMX files include all geometry,
instructions, in the Collada folder of the
hierarchy, groups, precise normals,
Anark Studio installation directory.

36 Anark Studio User Guide


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

Tips for creating models, materials and maps

Tips for creating models, Š Avoid using a negative scale value for
materials and maps polygons. If any of the polygons in
When creating models in a 3D modeling your model have a negative scale
program or converting them from other value, they will be interpreted incor-
formats into AMX, these tips will help rectly in Anark Studio. If the model is
produce the best results. exported as an AMX file, the negative
values are retained and the polygons
Note: Because the Anark Maya AMX will appear black. If the model is
Exporter does not export texture exported as a 3DS file, Anark Studio
map data, you can ignore all guide- will turn the negative values into posi-
lines related to image maps. tive values.
Š It’s always a good idea to name all
General modeling guidelines and models, materials and maps.
best practices
Š Anark Studio limits a single model’s Important: Due to the parameters of
complexity to 65,000 vertices or the .3ds format, the name of a map
21,000 faces. All models must be can only be eight characters long
triangulated. (plus the three-character file exten-
sion). For example, if you applied a
Š If you want to apply any kind of texture named RockTexture.png to a
texture map in Anark Studio, your
model, you would have to rename it
model must have UV coordinates on it.
ROCKTEXT.PNG before exporting
Š If you apply any kind of bitmap image the model. The AMX format does
to a model, it will more than double not have this limitation.
the finished file size.
Š If you plan to apply video or bitmap
Š All bitmap images that have been images without color shifting, set the
applied to a model will import as Diffuse Color of the Material to White.
uncompressed bitmaps. If you want to
Quick Definition
reduce the file size, select the image in
Image Map - An image map is a 2D
the Library palette in Anark Studio and
graphic image that has been wrapped
set the desired compression using the
around a 3D object by mapping it to
Inspector. Setting compression levels
the object’s material. Some 3D model-
on one image will distribute the
ing applications refer to image maps as
settings to all instances of the image.
bitmaps, textures or texture maps.
See “Setting properties for images” on
page 104 for more information.
Guidelines for working in 3ds
Š As you work in a modeling program, max
create and edit your models in the Š To ensure that the units will be the
native format. Export them to .3ds or same in 3ds max and Anark Studio, set
.amx after they are completed. See the units to 1 inch in 3ds max. To
“Choosing a 3D program and export do this:
file format” on page 36 for more infor-
mation about deciding what file a. Pull down the File menu.
format to use.

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

Chapter 2
Preparing Models, Videos and Images

b. Select Preferences. The Preferences Wire and 2-sided are.


window will open. • Extended Parameters are not
c. Select the General tab. exported.
d. On the General tab, set System • The following maps are preserved
Unit Scale to: 1 unit = 1.0 inches. during export:
e. Click on the Automatic Unit Con- - Diffuse Color
version button. - Specular Color
Š Settings in Smoothing Groups will take - Opacity
precedence over any settings in
Shading Mode (also called Rendering - Self-Illumination (or Emissive)
Mode). For example, even if you set - Reflection
the Material Shading Mode to All other maps (such as Ambient
Constant (or Smooth), if adjacent sets Color, Filter Color, Bump and
of facets have different Smoothing Refraction) are converted into Dif-
Groups, it will render an edge between fuse Color maps when imported
them. into Anark Studio.
Pivot point guidelines Š You can assign different materials to
Š When setting the pivot point on a individual faces or a grouping of faces.
model, make sure it is aligned to the Refer to the 3ds max documentation
world. To do this in 3ds max: for instructions on doing this.
a. Select the model. Map guidelines
b. Click on the Hierarchy tab. Š Only Bitmap maps are preserved
c. Select Affect Pivot Only. during export. Others such as Mix,
d. Click on the Align to World Noise, Cellular, Smoke, etc., are not
button. exported.

If a model is not aligned to the Š Bitmap Parameters are not used.


world before it is exported, an extra Š Most Coordinates information is
group will be added to the model’s
preserved, with the exception of Blur
hierarchy with a “pivot” extension
settings.
in order to preserve the pivot infor-
mation. Š W Angle settings on maps in 3D max
are not imported into Anark Studio. If
Material Editor guidelines you want a map to be rotated on an
Š While all Basic Parameters are object, set the UV Rotation on the
preserved when a model is exported, image directly in Anark Studio using
there are a few Material settings that the Inspector palette.
either aren’t used in Anark Studio or
Š When working in 3ds max, if you need
are used differently than in the
to rotate, scale or edit an image map,
modeling program. They include:
do not do it in the Material Editor;
• Face Map and Faceted (under adjust the UV coordinates instead.
Options) are not exported, although

38 Anark Studio User Guide


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

Guidelines for working in Cinema 4D

See “Preparing video clips and graphics Guidelines for exporting to .3ds
as image maps” on page 41 for more tips Š Be sure to use “eight dot three” file
on working with maps. names (eight-character name plus
three-character file extension) for all
Guidelines for working in maps and ensure these maps are in the
Cinema 4D same directory as the saved .3ds file.
Š Only pure polygon objects can be
Š If a bitmap has been applied to the
exported, so do not include any spline,
model (or if you intend to apply an
lathe, patch or other object types.
image to it in Anark Studio), it must
Š All polygon normals must be facing have UV coordinates on it and you
the proper direction. You can switch must check Preserve Texture Coordi-
on the Show Normals option to check nates in the Export dialog box.
that the normals are facing the proper
direction. Guidelines for exporting to .dae
Š Do not import 3ds files. They are not Geometry
interpreted correctly and thus will not Š All polygon geometry is supported.
export to the AMX format correctly.
Š NURBS and sub-division surfaces need
Guidelines for working in Maya to be tessellated first before they can be
Š If a model you are working on in Maya exported.
has a texture map applied to it, Maya
automatically sets the Shader diffuse Materials
color to black. When the model is Š Supported ColladaMaya material types:
brought into Anark Studio, the texture • Constant (flat shading)
map information is not imported and
• Blinn
the diffuse color is set to light gray.
• Phong
Š Only polygonal models will be
• Lambert
exported; NURBs (non-uniform
rational B-splines) and Subdivision Note: The shading types Blinn,
Surface models should be converted to Phong and Lambert are switched to
polygons before exporting. use Gouraud shading at the time of
Š Layered and Surface shaders are not conversion.
exported, although Anisotropic, Blinn,
Š Supported color types:
Lambert, Phong and PhongE shaders
are. • Diffuse
Š There is a 100:1 ratio of scale between • Ambient
Maya and Anark Studio units. Any • Specular
model that is created at a 1 unit size in Š Opacity, specular power, and emissive
Maya (such as any primitive model’s power are supported.
default size) will need to be scaled up
100 times to be seen in Anark Studio’s Š Material modes supported:
default viewport setting. • Solid

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

Chapter 2
Preparing Models, Videos and Images

• Wireframe Š Splines and other curve animations are


• Double-sided (normals may need be not supported (however, using the
flipped in Maya first if they appear ‘Sampling’ option in the ColladaMaya
odd when imported) exporter forces them to be exported as
keyframes).
Textures
Š Lights and cameras are ignored.
Š 2D-placed texture only
Š Supported map channels: Guidelines for exporting to .amx
• Diffuse Š The .amx file format enables the use of
GIFs as image maps. However, GIFs
• Opacity
cannot be imported into Anark Studio
• Specular directly. They must be mapped to a
• Reflection model using a modeling program and
• Shininess then exported to the .amx format.
Once imported into Anark Studio, they
• Emission can be used on other models in addi-
Š Supported texture parameters: tion to the model to which they were
originally attached.
• Coverage U/V
• RepeatU/V Š With the exception of files that were
originally created in Maya, all texture
• OffsetU/V
bitmaps are saved into the AMX file. It
• RotateU/V is not necessary to keep the texture
bitmaps on disc with the AMX file. The
Transformation
Anark Maya AMX Exporter does not
Š Translation, rotation, scaling, rotate export texture map data.
pivot all supported.
Š Cameras and lights are not exported.
Š No scale pivot, skewing/shearing. However, target nodes may be
exported as empty groups in the AMX
Animation
file.
Š Animatable properties:
Š The current version of the Anark AMX
• Rotation.
exporter does not correctly save out
• Transformation (translation, rotated pivot point/axis information.
scaling).
• Materials – diffuse color, ambient Working with exporter
color, specular color, specular plug-ins
power, emissive power, opacity. In order to work with a wide variety of
3D modeling programs, each of which
Unsupported features
has a specific file format, Anark has
Š No Collada FX support (no shaders, created the AMX file format. To export a
etc.). 3D model into this format so that it can
Š No physics support. then be imported into Anark Studio, you
need to install an exporter plug-in for
Š No joints and rigging.

40 Anark Studio User Guide


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

Exporting models to .amx

the modeling or conversion program. exported unless their parent objects


Currently, there are plug-ins for: are selected as well. This option is
not available in Cinema 4D.
Š 3ds max Release 5.0
2. Create a name for the file and select
Š Maya version 5.0 or later for Windows Anark Exchange (*.AMX) from the
Š LightWave 3D for Mac OS X version Save as Type pull-down.
7.5 or later and Windows version 6.5 Anark Exchange files are imported
or later exactly like all other files. See “Adding
objects to the project” on page 52 for
Š Cinema 4D version 8.0 or later for Mac
more information.
OS X
From time to time, new AMX Exporter Exporting models to .3ds
plug-ins may be available in the online Once you have created a model in 3ds
Assistant Palette, along with instructions max, you must prepare it for export into
for installing and working with them. the .3ds file format. The final steps
The plug-ins and their associated before exporting the file are:
ReadMe files are located in your Anark 1. Reset the Xform (Transform). To do
Studio installation directory inside the this:
AMX Exporter Plug-ins folder.
a. Select the model(s).
Exporting models to .amx b. Click on the Utilities tab.
After you have created and saved a c. Click the Xform button.
model or scene in 3ds max, Maya or 2. Collapse the stack of each model.
Cinema 4D, you can export it. Exporting
files to the AMX format requires that If a bitmap has been applied to the
you first install a plug-in for the 3D model (or if you intend to apply an
modeling program. image to it in Anark Studio), it must
have UV coordinates on it and you must
Note: The LightWave plug-in offers check Preserve Texture Coordinates in
some additional features that aren’t the Export dialog box.
covered in this section. See the
ReadMe files for the plug-in for Preparing video clips and
more information. graphics as image maps
To export a file to the AMX format: When preparing images for use in either
1. When you are finished working on a modeling program or Anark Studio,
your scene or model in 3ds max, Cin- these tips will help produce the best
ema 4D or Maya, do one of the fol- results:
lowing: Š When working with images and video,
• Select File > Export (Export All in you should always try to keep the
Maya). dimensions in powers of 2, such as 8,
• Select the models you want to 16, 32, 64, 128, 256, 512, etc. Any
export and select File > Export combination will work (16 x 128, 128
Selected. Child objects will not be x 256, 8 x 512, 128 x 64, etc.),
although square dimensions work best

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

Chapter 2
Preparing Models, Videos and Images

with certain video cards. If you decide Anark Studio. To successfully map the
to use dimensions that are not in video to the model in Anark Studio,
powers of 2, such as 210 x 112, during you need to delete the single-frame
playback, the graphics card will auto- image map attached to the model’s
matically rescale the image to 256 x material, import the .avi file directly
128, which can make the image appear into Anark Studio and reattach it to
fuzzy. Not using a power of two for the material. For more information
certain video types that are set to tile about working with video, see “Adding
may cause a black margin to appear streaming media files to a project” on
between the tiled images. page 167.
Š Try to limit image dimensions to less Š If the video will be mapped to a rect-
than 256 pixels in width and height to angle or square, you can maintain the
conserve Texture memory and band- aspect ratio while compressing the file
width for Internet broadcasts. from 320 x 240 (the standard setting)
down to 256 x 192 in order to improve
Š In general, you should import uncom-
performance. If the video will be
pressed images and then use the
mapped to an object with curves,
Compression Type, Compression
where it will already be distorted, it’s
Quality and Image Size Reduction
recommended that you compress it
settings in Anark Studio. Avoid
down to 256 x 256.
importing .jpg images because all
image files are recompressed in Anark Š Be judicious about the codecs and
Studio, which can inadvertently compression you choose to ensure that
increase the file size. See “Setting prop- the file sizes are only as large as needed
erties for images” on page 104 for more in order to conserve processor power
information. and bandwidth. For example, a Reflec-
tion Map can be highly compressed
Š For video clips, choose a compression
and the results will still be rendered
type that is suitable for your band-
well.
width. Compression Technologies’
CinepakPro™ (http:// Š When applying video or images
www.cinepak.com/) is known to work without color shifting, be sure to set
fairly well. the Diffuse Color of the Material to
White.
Š When an AVI is used as a map for a
material in 3ds max, only the first See “Map guidelines” on page 38 for
frame of the video is used as the map more information on applying images to
when the model is imported into models.

42 Anark Studio User Guide


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

Preparing image files in Adobe Photoshop

Preparing image files in Adobe 5. For the question “What image format
Photoshop would you like?” select “PNG.” Click
the Next button.
General settings 6. Use the browser window to select a
Anark Studio can only work with 8-bit name and location for the file.
per channel image files, which is the
default setting in Photoshop. If you have 7. Click OK.
changed the Photoshop file to the 16-bit For more information about using the
per channel mode, you will need to image as an Opacity Map, see “Creating
change it back to the 8-bit mode when an Opacity Map” on page 112.
you export it for Anark Studio. There
Quick Definition
should be no loss of quality when you
Alpha channel - An alpha channel is the
do this.
portion of an image’s data that specifies
To set a Photoshop file to 8-bit mode: the transparency of each pixel in the
Select Image > Mode > 8 Bits/Channel. image. Some popular image types, such
You can then export the image to the as JPEG, do not support alpha channel
file format you want to use in Anark data.
Studio.

Creating a PNG file for an Opacity Map Troubleshooting models,


If you are creating an image in Adobe materials, videos and images
Photoshop that you plan to use as an
Opacity Map in Anark Studio, it’s recom- General troubleshooting
mended that you export it to the .png When I add an image to a material on a
format. This is because .png is a 32-bit model, it has a seam along the back of the
file format that includes alpha channel object.
information. The alpha channel is what The seam is the result of the way Anark
specifies the transparency of each pixel Studio wraps the image around the
in the image. model. This is normal, but if the back of
the model will show in your presenta-
Adobe Photoshop 5 or later includes a tion, one way to minimize the seam is to
wizard that walks you through the select the image and set the U Repeat to
export process. Use the following 2 (or more) and U Tiling to Mirrored. See
instructions to export the image: “Setting properties for images” on
1. Create an image on a layer in Photo- page 104 for more information on
shop and add the transparency where setting U Repeat and U Tiling.
you want it. An image or a model appears to flicker or
2. Select Help > Export Transparent has a “window blinds” effect on it.
Image. The export wizard will open. The object may need to be brought
forward in the scene slightly. This is
3. Select “My image is on a transparent
because when two objects are either on
background.” Click the Next button. the same plane or are very close to it, the
4. For the question “What will this rendering engine can’t always decide
image be used for?” select “Online.” which to render in front of the other. An
Click the Next button. example of this might be a label model
mapped on top of a CD case model. To

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

Chapter 2
Preparing Models, Videos and Images

fix the problem, simply move the label b. Turn on Connect to Source by
slightly closer along the Z axis. checking the box.
I want to use an AVI video file in my project, c. Drag the Playhead.
but it won’t import, even though it’s listed as
a supported file type.
The video should now be displayed.
Anark Studio works with most, but not
all AVI files. Some video card manufac- 3ds max troubleshooting
turers create proprietary AVI codecs, When I import a model and drag it onto the
which Anark Studio may not be able to Project window, it doesn’t appear.
work with. There are several possibilities:

There’s a black border between tiled video Š The scale of the object may be so large
clips on a model. that the camera is actually inside it,
The video dimensions need to be set to a which means you won’t be able to see
power of two such as 8, 16, 32, 64, 128, it unless you move the camera or the
etc. object or you reduce the scale of the
When I apply an image to a material on an object.
imported model, only a single color is
applied.
Š Alternatively, the scale of the object
The model doesn’t have UV coordinates. may be so small that you can’t see it on
You must create UV coordinates for it in the screen. You can either increase the
your 3D modeling application and re- object’s scale or you can move the
import it or refresh the file. camera closer to the object.
When I drag a video resource onto a layer or Š In some cases, 3ds max may have
a material on a model, the object turns created an empty object (i.e., a node
black. Where’s the video? that doesn’t contain any geometry),
There are a couple of possibilities. which Anark Studio is unable to read.
Š Your video may have an unsupported Go back into 3ds max and view all the
bit depth. In Windows, only 32-bit objects in the file (the schematic view
depth video files will work. Video files and the Select Objects dialog box are
with other bit depths will not show up two options for doing this). Delete any
at all. object that does not contain geometry
that is visible in the scene, save the
Š The video may still be loading or Anark .3ds file and reimport it into Anark
Studio may not be connecting to the Studio.
resource properly. Large video files,
When I import a .3ds object, the models are
high resolution video and uncom- no longer in the same position in relation to
pressed video can all take a while to each other.
load. If the video takes longer than You must go back into 3ds max and reset
normal to appear, try the following: the Xform (Transform) and collapse the
a. Check to see if there is a Remote stack of each model before importing
Source for the video resource. This the object into Anark Studio. For
is the URL of the video file or the detailed instructions, see “Exporting
fully qualified absolute or relative models to .3ds” on page 41.
path to it.

44 Anark Studio User Guide


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

3ds max troubleshooting

When I add an image to the material on a (anything except UV mapping) or you


model that I imported from 3ds max, the can go back into 3ds max and set UV
image doesn’t appear.
mapping coordinates for the model.
The .3ds model was never given UV
Then save the .3ds file and reimport it.
mapping coordinates. You can either
choose another type of texture map

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

Chapter 2
Preparing Models, Videos and Images

46 Anark Studio User Guide


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

Chapter 3: Creating a Project 3

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.

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

Chapter 3
Creating a Project

Understanding layers block contains a 3D scene with elements


A layer is a special way to group the that interact with each other, but not
elements of the scene. Layers in Anark with the elements of the other layers.
Studio are similar to the layers used in Effects like fades can be applied to one
many 2D graphic design programs. In layer without affecting the other layers.
2D graphics, layers are rendered like As with 2D layering, the final image is a
stacked sheets of acetate. composite of all the layers, so that
objects attached to layers that are more
The content of each layer remains distant will never pass in front of objects
distinct from the content of other layers attached to the top layers. There can be a
so that effects can be applied to the single layer or many layers in a project.
content of a particular layer without When a layer is added to the project, it
affecting the content of other layers. The already has a default light and a default
final image is a composite of all the camera attached to it. The default layer,
layers, which means that the content of light and camera are on the Master Slide.
the top layers may obscure the content For more information about the Master
of lower (or “farther”) layers. Slide, see “About Master slides” on
3D layers in Anark Studio are used in a page 134.
similar way, but instead of being The only object that layers can be
rendered like sheets of acetate, they are attached to is the Scene object.
rendered like a stack of glass blocks. Each

48 Anark Studio User Guide


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

Understanding attachments

Understanding attachments object as a child of a layer (which can


Anark Studio uses hierarchical attach- only be attached to the scene), then
ments between objects and behaviors to attach a Planet object as a child object of
organize the visual content of the the Sun, and attach the Moons Group as
project and to provide fine-grained a child object of the Planet. In the
control over the animation and interac- Object outline it would look like this:
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 The effect of this structure is that as the
directly to a parent object, which influ-
planet moves in its orbit around the sun,
ences some of its properties. Child
the moons move with it so that the path
objects can have children attached to
of the moons is directly affected by the
them.
path of the planet. These hierarchical
Š Root – An object at the top of the hier- attachments are one-directional,
archy. Root objects can have children, however, so the path of the moons does
but no parents. The scene is the root not affect the path of the planet.
object in Anark Studio. As you begin adding objects to your
These attachments allow you to set up project, you’ll need to consider how you
animation parameters and interactive want them grouped and attached. If you
behaviors for groups of objects with a want to work with several objects as a
single setting and to animate objects in single unit, you will need to attach them
relation to other objects. to a group. If you want objects to move
in relation to one another, you will need
A good example of both groups and hier-
to create a parent/child hierarchical
archical attachments is the solar system.
attachment between them.
Several moons revolving around a single
planet can be thought of as a group with For information about creating attach-
an attachment to the planet. The planet, ments between objects, see “Adding
in turn, is attached to the sun around objects to the project” on page 52. For
which it revolves. information about changing existing
attachments, see “Working with the
To create this solar system in Anark
Object outline” on page 62.
Studio, you would first attach the Sun

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

Chapter 3
Creating a Project

Understanding the coordinate Understanding pivot points


system The pivot point for an object serves as
Anark Studio uses a left-handed coordi- the center for its rotation and provides
nate system. This means that positive Z the coordinates for scaling. In Anark
is toward the screen (away from the Studio, the pivot point is displayed as an
viewer), positive Y is up, and positive X axis tripod (green = Y, red = X, blue = Z).
is to the right. Only the pivot point of the topmost
selected object is displayed.
Positive rotation is clockwise around the
axis of rotation. 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.

Anark Studio uses a left-handed coordinate


system.

How the object hierarchy


affects attachments
The 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 An object’s pivot point is displayed as an
in the Object outline will be the bottom axis tripod (top). Notice how on the jet
(below), only the topmost selected object’s
layer (i.e., the farthest layer) in the pivot point is shown.
project.
To display or hide pivot points:
Behaviors can be attached to any object, Choose View > Pivot Point (Ctrl + Alt +
but objects cannot be attached to P).
behaviors.

50 Anark Studio User Guide


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

Importing objects

Importing objects project. For more information, see


In addition to the basic objects that are “Exporting and importing compo-
nents” on page 60.
included in Anark Studio on the Basic
Objects tab, most projects would typi- The imported item will appear in the
cally include digital 3D mesh objects, Library. Text objects and components
music, sounds, video clips and/or are handled a little differently than the
graphics created in other applications. other object types. For more information
These objects must be imported into about them, see “How text is added to
your Anark Studio project. the project” on page 54.
To import an object or behavior: If the item was dragged onto the Project
Do one of the following: window or the Object outline, then it
will create an instance of the object in
Š Drag an item from the Basic Objects or
the project as well. If the selected file is
Storage tab to the Library, the Object
not a supported media format, an error
outline in the Timeline or the Project
message will appear.
window.
When a 3D file is imported or added to
Š Drag a file from a Windows Explorer the Library, Anark Studio recognizes all
window onto the Project window, the of its models, materials and image maps
Library or the Object outline in the and creates a Group object to contain
Timeline. You can drag multiply- them. These attachments are reflected in
selected objects this way. the Library’s display.
Š 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 The Library tab displays a model’s hierarchi-
exported can be imported and cal attachments (left), while the Storage tab
attached to an object already in the displays only the file directory (right).

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

Chapter 3
Creating a Project

Adding objects to the project an image to a material.


When 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
When you drag an object onto the Timeline,
it to the Library and creates an instance you add it and set its attachments at the
of it at the same time. same time.
Because adding items to your library Š Objects can be dragged onto the
increases the finished file size, you
Project window. When added this way,
should reuse Library resources whenever
object attachments are determined in
possible. For example, if you want to
the following way:
create three different buttons using a
custom model, you can create one • Music, layers, sounds and behaviors
instance by dragging the model from the are added to the Scene object.
Storage palette and then drag out two • Images and video are automapped
more instances using the Library to a material on a model. This
resource instead of the Storage palette means that a new rectangle primi-
(which would add additional Library tive is created and the image or
resources). video is attached to the rectangle’s
material.
Note: Text and components are never
• If currently inside a component, all
added to the Library, although the objects are attached to the
objects inside the component are. component.
For more information, see “How
text is added to the project” on • All other object types are attached to
page 54. the currently active layer. The
currently active layer is the layer
There are three ways to add objects to that is currently selected in the
your scene: Object outline or that has an
Š Objects can be dragged onto the attached object currently selected. If
nothing is selected, then the object
Object outline in the Timeline tab.
is attached to the topmost layer.
This allows you to directly attach
objects to other objects. For example, You can then drag items in the
you can attach a model to a group, or Object outline to change their
attachments if needed, following
the instructions in “Rearranging
objects” on page 64.

52 Anark Studio User Guide


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

Adding objects to the project

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
When you drag an object onto the Project
remote source for the streaming file
window, it gets attached to either the Scene
or the currently active layer. using the instructions in “Chapter 8:
Working with Streaming Media and
Š Components that were previously Dynamic Images” on page 165.
exported can be imported and
To add an externally created object to the
attached to an object already in the presentation:
project. For more information, see 1. Select an item in the Library or Stor-
“Exporting and importing compo- age tab or in a Windows Explorer
nents” on page 60. window. If using Windows Explorer,
you can select multiple items.
Tip: It’s a good idea to give every
2. Do one of the following:
object in your project a unique
name whenever possible. See • Drag it onto the Project window. It
“Renaming objects” on page 63 for will be attached to the currently
more information. active layer.
To add a basic object to the presentation: • If the item is from the Library,
1. Click on one of the basic object but- Storage tab or a Windows Explorer
tons on the Basic Objects tab to select window, you can drag it onto the
it. bar of the item in the Object outline
to which you want it attached.
2. Do one of the following:
• Drag it onto the Project window. It Tip: When models are dragged onto
will be attached to the currently the Project window, they are placed
active layer. in the center by default. Holding
• Drag it onto the bar of the item in down Alt as you drag a model will
the Object outline to which you place it at the location of the mouse
want it attached. instead.

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

Chapter 3
Creating a Project

The duration of added objects Š The start handle of the object’s timebar
With the exception of layers, sounds and is set to the current position of the
music, when an item is added to the Playhead.
project, its duration is set to match the
Š If the Playhead is currently located
duration of its parent object and the
before the parent object’s end handle,
item is automatically selected.
the end handle of the object being
The duration of the default layer in the added is matched to the end handle of
scene is initially set to 10 seconds. When the parent.
subsequent layers are added, their dura-
tion is also set to 10 seconds. Š If the Playhead is currently located
after the parent object’s end handle,
The duration of sounds and music is set the duration of the object’s timebar is
to the length of the data they contain. set to 10 seconds.
For example, a sound might have a dura-
tion of 2 seconds and a music file might
How text is added to the
have a duration of 4 minutes.
project
How the Ctrl key affects adding Text objects aren’t added to the Library.
objects In order to add new instances of text to a
Holding down Ctrl as you drag an object project, you must drag them from the
to the Project window or the Timeline Basic Objects palette each time. If you
has the following effects on the object’s want to keep the same property settings
timebar: for additional instances of text, you can
copy or duplicate an existing instance.

54 Anark Studio User Guide


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

Currently supported media formats

Currently supported media


formats
Anark Studio currently supports the
following media formats:
Media Formats File Extensions
3D objects .amx, .3ds, .dae
Sound files .ogg (Ogg Vorbis), .wav, aiff/.aif
Video types Windows Media: .avi, .asf, .wmv
QuickTime: .qt, .mov
MPEG Audio: .mp2, .mp3
MPEG Audio/Video: .mpg, .mpeg, .m1v, .mpe
Image files .png, .tga, .tif, .psd, .bmp, .jpg
Behavior scripts .bvs
Anark component .amc

There are many factors that can affect To update all source files in the Library at
Anark Studio’s ability to work with once:
specific files. For more information Right-click anywhere in the Library and
about file limitations see “Working with select Refresh all Resources from the
exporter plug-ins” on page 40. Context menu.

Important: Refreshing objects that


Working with source files
have child attachments (except for
With the exception of streaming video
externally created 3D models, which
and music, Anark Studio embeds the
are refreshed as described below)
data of imported objects, rather than
will not maintain the child attach-
just linking to the source file. This
ments. For example, if you imported
means that you can move, edit or delete
a custom 3D model into Anark Stu-
the files after they’ve been imported into
dio and then attached an imported
Anark Studio without any effect on the
image to one of its materials, the
resource in the Library. However, some-
image would be lost if you refreshed
times you may want to update the files
the model.
you have already imported into your
project with changes you made to them Externally created 3D models, which are
outside of Anark Studio. always imported as Group objects in
You can quickly update 3D models, Anark Studio, are updated in the
behaviors, images and sounds by following way:
refreshing the Library resource. Š The Library resource and any instances
To update a source file: of the group and model will be
1. Select a resource in the Library. updated.
2. Right-click and select Refresh File Š If there are several models within the
from the Context menu. group that is being refreshed, every
3. Browse to the correct file and click model will be updated.
Open.

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

Chapter 3
Creating a Project

Š If the new source file contains addi- 1. An artist creates a re-usable compo-
tional models, the new models will be nent as its own presentation. All
added to both the Library and to any changes to the master component
instances of the group. need to occur in this file.
Š If the new source file had models 2. The artist exports the component to
deleted from it, those models will also disk as a standalone Anark Media
be deleted from the Library and from Component (.amc) file.
any instances of the group. If any of
3. The .amc file is imported into
those models were moved so that they
another presentation. Instances of
were attached to other objects instead
the component are positioned, ani-
of the original group, then those
mated, and otherwise customized in
instances will be deleted as well.
this presentation.
If you don’t refresh a file in Anark
4. When necessary, the master compo-
Studio, then even if you move or delete
nent presentation is changed, and
the source file, no changes will be made
the updated .amc file is re-exported
to the presentation.
to disk.
For information about working with
5. The artist using the component
streaming video and music, see “Chapter
selects the component in the Library
8: Working with Streaming Media and
palette and chooses Refresh from
Dynamic Images” on page 165. For
File. Anark Studio updates instances
information about adding instances of
of the component in the scene to use
objects to a project, see “Adding objects
the new changes, and preserves the
to the project” on page 52. For informa-
per-instance changes that the artist
tion about object attachments, see
previously made.
“Understanding attachments” on
page 49. Quickly finding a library item
To easily find and select the associated
Refreshing components in the Library asset, select the component in
project the Timeline and enter the keyboard
The Refresh File command allows you to shortcut Ctrl-L.
update multiple components within a
scene from a single .amc file. In order to Creating refreshable
refresh a component in a presentation, components
you right-click on the component in the A single presentation potentially calls for
Library palette and select Refresh File. many components that are similar, but
This feature allows large design teams to not the same. For example, there may be
distribute the work of creating reusable ten Menu buttons, and ten more
components, and facilitates collabora- Options buttons. These two button types
tion. are different enough to justify their own
master presentations and .amc files, but
Workflow similar enough that it would be redun-
Briefly, the steps you follow to use refre- dant to build both from scratch.
shable components are:

56 Anark Studio User Guide


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

Converting legacy projects

The dilemma component and choose Duplicate


Suppose you have already created the from the Context menu.
master presentation for the Menu button
component, and you want to use this as Note: You will see a new component
the basis for the Options button compo- in the Library with the word “copy”
nent. Suppose that you then create a appended to its name. You will also
copy of the presentation file, modify it see all the contents of the imported
to be an Options button, and export the component in the Library.
new .amc file. Because both components
4. Delete the imported component by
(and some contained items) would still
right-clicking on the item and choos-
have the same internal graphics unique
ing Delete Item from the Context
identifier (GUIDs), you would run into
menu.
trouble if you used both components in
the same presentation. 5. Save the new project. (File > Save)

When you import a component with the At this point, the new project may
same GUID (but different file path) as be customized and the component
another component already in the inside it exported as an .amc file,
presentation, Anark Studio detects the with no danger of conflicting with
conflict and shows a dialog: the original component.

Converting legacy projects


Projects created with Anark Studio
version 3.5 or earlier do not automati-
cally benefit from the Component
Refresh feature. Components imported
There is no way to import two different com- into these projects were not associated
ponents into a presentation if they share the
with a file on disk, and the contents of
same internal ID; you can import one or the
other, but not both. the components were not associated
with the component.
The solution
A legacy project can be updated to the
These are step-by-step instructions for
new format by refreshing each compo-
creating a new component based on an
nent and saving the project. Because the
existing component, in a way that
presentation is missing information that
allows both to be included in the same
Anark Studio needs in order to perform
presentation.
the “smart” refresh, the first Refresh File
1. Create a new Anark Studio project. command performed on these legacy
(File > New) components will actually use Replace
2. Import the .amc file for the original mode (see “Replacing versus refreshing”
component into the new project. on page 58).
(File > Import Resource) Some legacy presentations may have
3. Duplicate the component in the instances in the scene that share Library
Library. This creates new GUIDs for items that are also used by items inside
every item inside the component. the component. If this cross-linking is
To do this step, right-click on the present, the presentation is in an incon-

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

Chapter 3
Creating a Project

sistent state. The presentation is not This action is different from just deleting
corrupt – there is no data loss – but is set all the instances and starting over,
up in a way that is explicitly prevented however. The values of properties on the
in brand new presentations. Refreshing outside of each instance are preserved
components in such a presentation may during a replace. This applies to standard
show Library assets that would normally properties (such as position, rotation,
be hidden. The update that occurs to scale, opacity, etc.) as well as any custom
those Library items affects scene properties the two components may
instances outside the component share.
sharing that Library item.
The only way to clean up such a presen- Copying and duplicating
tation (if it is deemed necessary) is to objects in the project
delete the items from the scene sharing There are three slightly different ways
the item, import a new copy of the item of copying an object: duplicating it,
into the Library, and re-add the scene copying it, and cutting and pasting it.
instances from that item.
All of these methods create an exact
duplicate of the original object. The
Replacing versus refreshing copy’s timebar remains its original
When using the Refresh File command length, and the copy will include any
for a component, it is possible to select actions, animation keyframes and child
an .amc file for a completely different objects.
component. When this occurs, the two
There are some minor differences
components are so wholly different that
between copying, duplicating, and
no per-instance artist changes are
cutting and pasting.
preserved. Instead, the component
instances are said to be “replaced” rather Š Duplicating makes a copy and auto-
than refreshed. matically attaches it to the same parent
Anark Studio detects such a situation as the original.
when the internal GUID for the new Š Copying allows you to select a
component does not match the GUID different object to copy it to.
for the Library item, or when a legacy
component is refreshed for the first time. Š Cutting deletes the original object
The following dialog is shown: 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.
If the artist selects OK, the contents of
each component instance in the scene 2. Do one of the following:
is replaced with instances of the new • Select Edit > Duplicate Object, or
component. This means that all per- press Ctrl + D. The duplicate will be
instance customizations are discarded. attached to the same parent as the

58 Anark Studio User Guide


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

Duration of the project

original. To copy or cut and paste an object


between instances of Anark Studio:
• Right-click on the name of the item
1. Select an item in the Object outline
in the Object outline and select
or the Project window.
Duplicate Object from the Context
menu. 2. Do one of the following:

• While holding down Ctrl, drag it • Copy the object by selecting Edit >
onto the bar of the object in the Copy or pressing Ctrl + C.
Timeline tab to which you want it • Cut the object by selecting Edit >
attached. Cut Object or pressing Ctrl + X.
To copy an object in the presentation: 3. Launch a new instance of Anark Stu-
1. Select an item in the Object outline dio or switch to one that is already
or the Project window. running.
2. Do one of the following: 4. Select the object you want the copied
• Select Edit > Copy, or press Ctrl + C. object to be attached to.
• Right-click and select Copy Object 5. Do one of the following:
from the Context menu. • Select Edit > Paste Object or press
3. Do one of the following: Ctrl + V.
• Select Edit > Paste Object or press • Right-click on the name of the item
Ctrl + V. in the Object outline and select
• Right-click and select Paste Object Paste Object from the Context
from the Context menu. menu.
To cut and paste an object:
1. Select an item in the Object outline Duration of the project
or the Project window. The duration of a presentation is based
on the duration of the content within it.
2. Do one of the following:
To determine a project’s duration, the
• Select Edit > Cut Object, or press system looks for the last end handle of
Ctrl + X. the last layer and sets the duration of the
• Right-click on the name of the item project to that point.
in the Object outline and select Cut During playback, the content will be
Object from the Context menu. played from 0 seconds to the final end
3. Select the object you want the cut handle of the last layer. If the scene is set
object to be attached to. to loop, it will continuously loop
between those points. If the first layer’s
4. Do one of the following:
start time begins after 0 seconds, play-
• Select Edit > Paste Object or press back will begin with a blank screen at 0
Ctrl + V. seconds; and, even if the timebars of
• Right-click on the name of the item other objects extend past the last layer’s,
in the Object outline and select nothing past the last layer’s end handle
Paste Object from the Context will be displayed.
menu. There is no explicit limit on the duration
of a project. When a project is first

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

Chapter 3
Creating a Project

created, its duration defaults to 10 the Storage tab.


seconds, because that’s the length of the Instructions for exporting Playback
default layer’s timebar. Modules can be found below.
See “Setting properties for the scene or For more information about dynami-
slide” on page 83 for more information cally loading Playback Modules, see
about setting the Loop property. For “Loading components dynamically”
information about setting the duration on page 132.
of objects, see “Using the timebar” on
page 148. Note: Loading Anark Playback Mod-
ules requires a valid license key.
Exporting and importing Please contact your Anark sales rep-
components resentative for licensing informa-
A component in one presentation can be tion.
exported for use in another project. For To export an Anark Media Component:
example, you could create a complex 1. In the Object outline, select the
menu component and then reuse it in component you want to export. The
other presentations. component, its property settings, all
You can export a component in two of its children and any keyframed
different ways for two different uses: animation will be exported.
Š If you want to import the data from a 2. Right-click and select Export Compo-
component into another Anark Studio nent from the Context menu.
project, export it as an Anark Media 3. Select a location for the file, rename
Component file (.amc). These files it if desired, and click Save.
include all Anark Studio Workspace
To export a component as a Playback
information for the object(s), so things Module:
like timebar text and custom timebar 1. In the Object outline, select the
colors are included. These files appear component you want to export. The
in the Storage tab and can be dragged component, its property settings, all
onto the Project window or Object of its children and any keyframed
outline. An exported .amc file cannot animation will be exported.
be played independently. It can only
2. Right-click and select Export Play-
be imported into another presentation.
Instructions for importing a compo- back Module from the Context
nent are given below. menu.
3. Select a location for the file, rename
Š If you want to dynamically load a it if desired, and click Save.
component into a presentation during
playback, export it as a Playback To import a component:
Module, which uses the .am file exten- Do one of the following:
sion. Playback Modules do not include Š Select the item in the Object outline to
Anark Studio Workspace information which you want the component
because they can only be loaded attached, right-click and select Import
during playback using actions or Component from the Context menu.
behavior scripts. They do not appear in Browse to the desired .amc file and

60 Anark Studio User Guide


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

Selecting objects

click on the Open button. To select an item directly in the Project


window, do one of the following:
Š If the component you want to use is 1. Enable the Group Select tool by click-
available in the Storage palette, drag ing the button, then click on the
the component onto either the Project desired object in the Project window.
window or the item in the Object The topmost group containing the
outline to which you want the compo- object will be selected. If the object is
nent attached. not part of a group, then just the
Š In the Library palette, select Import object will be selected.
Resource. Browse through your files to 2. Enable the Item Select tool by click-
choose the appropriate .amc file. For ing the button, then click on the
your convenience, this command is desired object in the Project window.
also available from the File menu. The Item Select tool differs from the
In order for the importation to be Group Select tool in that it selects
successful, the component must be only the specified object even if it’s a
“attachable” to the object you’ve member of a group.
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.
A green bounding box appears around a
group when it is selected (left). A red bound-
Selecting objects ing box appears around a single selected
There are several ways to select objects in object (right) and, if the object has child
Anark Studio. You can select an item in objects attached to it, the child objects will
the Timeline tab by simply clicking on be surrounded by a blue bounding box.
it, or you can enable one of two selec- The current properties of the selected
tion modes that allow you to use the object or topmost selected parent will
mouse to click on items in the Project appear in the Inspector.
window. You can also turn off the
If there are any component objects in
bounding boxes that surround selected
the project, then the Timeline can also
objects.
affect what can and cannot be selected.
See “Setting properties for components”
Note: Only models, including primi-
on page 117 for more information.
tives, text, groups and components
can be selected in the Project win- To deselect an item:
dow. All other object types can only Click on another object or the back-
be selected using the Timeline tab. ground in the Project window.
To turn bounding boxes on or off:
Select View > Bounding Boxes or press
Ctrl + B.
Selection tools.

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

Chapter 3
Creating a Project

Special selection options Š The active slide is the one whose


There are two special selection options contents are currently displayed in the
that allow you to toggle between Timeline and Project window.
resources in the Library and instances of
If a layer or slide is not currently
objects in the Timeline and scene. These
selected, then the one that was most
can be used to quickly locate instances
recently selected is still active.
of a Library resource in the Timeline, or
the Library resource for a particular
instance.
Working with the Object
outline
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 items


The Object outline.
When an item is selected, it is also
active; however, certain items remain The Object outline displays all the
active when they are no longer selected. objects that have been added to the
Specifically, there is always an active project and provides access to their hier-
layer and an active slide, even when one archical attachments and animated
isn’t currently selected. properties. You can access the contents
Selected items can be copied, moved, of an object, including any child objects
deleted and edited. None of those opera- and the properties that have been
tions can be performed on a slide or selected for animation by using the
layer that is active but not selected. Expand/Collapse arrow next to it. In
“Active” has a more limited definition: addition, you can filter the items in the
outline, rename them and rearrange
Š The active layer is the one that objects them.
are attached to when they are dragged
onto the Project window.

62 Anark Studio User Guide


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

Renaming objects

To expand or collapse the contents of an name you use to create instances of the
object or behavior: object or to initially address the object in
Click on the Expand/Collapse arrow to scripting. For more information about
the left of the item’s name in the Object addressing objects in scripting, see
outline. “Object model overview” on page 214.
Shift + double-clicking on an object’s Giving every object in your project a
icon expands or collapses all children as unique name is recommended for two
well. 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.
Clicking on the Expand/Collapse arrow next
to an object (left) expands the list to display Š If there are two or more objects with
the contents of the object, including ani-
mated properties and child objects (right).
the same name attached to the same
object, then any reference to the object
To resize the Object outline: in a behavior script forces the scripting
Drag the bar between the Object outline engine to make an arbitrary decision as
and Time pane to the desired position. to which object to address. This means
To copy an object’s path to the clipboard: you may get different results each time
Right-click on the item in the Object you play a presentation.
outline and select Copy Object Path To rename items:
from the Context menu. This copies the 1. Do one of the following:
hierarchical path to the object (e.g.,
Scene.Layer.Cube3.Material13.rays). • Right-click on the name of the item
This is particularly useful for copying an in the Object outline and select
object’s complete path into a behavior Rename Item from the Context
script or an edit box in the Inspector of a menu.
custom behavior. For more information • Select the item in the Object outline
about the hierarchical path of objects, and then click on the text of the
see “Object model overview” on item’s name.
page 214. For more information about • Click on the name of the item in the
editing behavior scripts, see “Editing Object outline and press F2.
behaviors” on page 73.
2. Type a new name and press Enter.

Renaming objects
Note: Since objects whose names
Renaming instances of objects or behav- begin with a number cannot be
iors in the Object outline does not affect addressed by name in behavior
the name of the resource object in the scripts, you should avoid naming
Library, but it does change the item’s objects that way and rename any
name in the Inspector. objects that were previously named
If you want to create custom behaviors that way.
for a specific object, this will be the

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

Chapter 3
Creating a Project

Rearranging objects will appear in the outline. To bring shy


When rearranging items in the Object objects back into view, unclick the Shy
outline, be aware of their hierarchical filter button.
attachments so that you don’t inadvert-
ently break attachments you want to Using the Active toggle and
keep or create unintentional attach- button
ments. You can change the attachments
of objects and behaviors by moving
them from one object to another. When The Active toggle controls several
a parent object is moved, all of its child features of objects:
objects are moved with it. You can also
change the order of an object’s children
Š It specifies whether an object and its
without changing their attachments as child attachments will be visible in the
long as you don’t move them away from Project window.
the parent object and keep them within Š It controls whether behaviors are
the confines of their current level in the turned on or off.
hierarchy.
Š It specifies whether the data for the
To change an item’s attachment from
object will be exported.
one object to another:
Click on the item in the Object outline Š If the Active filter button is turned on,
and drag it onto the object to which you it also controls whether the object and
want it attached. its child attachments will be visible in
To change the order of items without the Object outline.
changing their attachments:
If a parent object is inactive (meaning
Click on the item in the Object outline
the Active button is off), neither it nor
and drag it onto the line above or below
its children will be visible and neither
the object where you want it to reside.
will be exported in the final presenta-
The target position must be on the same
tion. This means that any object that is
level of the hierarchy to maintain the
inactive in Anark Studio will not be
attachment to the parent object; other-
accessible from a behavior script.
wise, the object’s attachment will be
changed. The Active toggle and filter button are
set to show and export objects by
Using the Shy toggle and default. Materials and the Scene object
do not have an Active toggle.
button
Using the Lock toggle and
The Shy toggle and filter button control button
whether a specified object will be visible
in the Object outline. The Shy toggle
allows you to selectively choose objects The Lock button controls whether the
to temporarily hide from the Object animatable properties of a behavior or
outline. If the Shy toggle is on for an an object and its child attachments are
object and the Shy filter button is on, editable. When an object or behavior is
neither the object nor any of its children locked, both its name in the Object

64 Anark Studio User Guide


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

Deleting objects

outline and its timebar are grayed out. For information about deleting items
You cannot select it or change anything from the Library, see “Cleaning up the
about it until the Lock button is Library” on page 27.
disabled.
Locking or unlocking a parent object Controlling presentation
automatically locks or unlocks all of its playback
child objects. Materials do not have a A presentation can play, pause or
Lock button. reverse, either automatically or based on
user interaction. There are several ways
Deleting objects to control how a presentation will be
Objects can be deleted from either the played.
Object outline or the Project window. If Š The Initial Play State property of the
the object is a parent, all of its children Scene object can be set to either Play or
will be deleted with it. If the object is on Pause.
the Master slide, then all instances of the
object on all slides will be deleted when Š Play or Pause actions can be used to
any one of them is deleted. See “About play or pause the scene.
Master slides” on page 134 for more Š Go to Time actions can be used to
information.
pause or continue playing. Play or
To delete an item: Pause actions can then be used to start
1. Select an item in the Object outline playback again or to pause playback.
or in the Project window.
Š Reverse Play actions can be used to
2. Do one of the following: reverse playback from its current direc-
• Press the Delete key. tion (either forward or backwards).
• If you selected an object in the For information about the Initial Play
Object outline, right-click and select State property of the Scene, see “Setting
Delete Item from the Context menu. properties for the scene or slide” on
page 83. For information about setting
up actions, see “Creating and deleting
actions” on page 120.

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

Chapter 3
Creating a Project

Undoing and redoing actions Š Adding objects to the Library.

Note: The behavior editing interface


has a separate undo/redo stack.
The Undo and Redo buttons are available in
Windows. To undo an action:
Press Ctrl + Z or click the Undo button.
Anark Studio allows you to undo actions
(i.e., commands) and redo actions after Undo can be repeated up to the last 100
you have undone them. This includes actions or until you have reached the
actions made using the Inspector palette end of the stack of actions you
or by dragging objects in the Project performed since loading the project.
window. However, the following actions To redo an action you have undone:
cannot be undone or redone: Press Ctrl + Shift + Z or Ctrl + Y or click
the Redo button.
Š Deleting objects from the Library. If
you do delete an object from the Redo can be repeated until you have
Library, the stack of actions that can be reached the end of the previously
undone is cleared, so no previous undone actions or until you issue a new
actions can be undone. command.

66 Anark Studio User Guide


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

Undoing and redoing actions

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

Chapter 3
Creating a Project

68 Anark Studio User Guide


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

Undoing and redoing actions

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

Chapter 3
Creating a Project

70 Anark Studio User Guide


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

Chapter 4: Customizing and


Extending Anark Studio
4

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.

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

Chapter 4
Customizing and Extending Anark Studio

What are behavior scripts? do it. Some common behaviors include


While Anark Studio provides an easy-to- familiar interactive behaviors like
use GUI for creating interactivity and buttons, linking, menus, toolbars, key
animation, custom behavior scripts can commands, etc.
be used to greatly expand the animation To create custom behaviors using the
capabilities and interactive states of your scripting interface, you’ll need to follow
projects. The scripts that are used in the instructions in “Using Scripting” on
Anark Studio are called behavior scripts. page 203.
Behavior scripts use the .bvs file exten-
The instructions contained within a
sion. They contain sets of instructions
behavior are executed only during the
for how objects in the scene should
behavior’s duration, so be sure to change
behave.
the duration of a behavior when needed.
The Anark Studio Behavior Library For example, if a behavior that makes a
includes a number of commonly used model glow during mouseovers is
behaviors (such as buttons and links), in attached to a model, and you extend the
addition to more advanced behaviors, model’s duration but not the behavior’s
but you may also want to create your duration, then the model will only glow
own custom behaviors. during mouseovers for as long as the
This section of the manual explains how behavior is active in the Timeline. For
to create and edit custom behaviors in more information about controlling the
Anark Studio. Detailed information duration of objects, see “Using the
about writing the content for scripts is timebar” on page 148.
covered in “Chapter 10: Using Scripting”
on page 203. Note: Scrubbing with the Playhead
will not execute behaviors. To see
For information about using the Anark your behaviors being executed you
Studio Behavior Library, see “Accessing must either view the final presenta-
the Behavior Library” on page 27. tion or preview using the F12 key.

Understanding behaviors Creating behaviors


Behaviors in Anark Studio are generally To write your own behaviors, you need
used to add custom interactive elements to create an empty behavior object in
to the project, and they also offer a way Anark Studio and edit it using the
to create specialized animation effects scripting interface.
based on runtime information.
Behavior scripts are just XML (Extensible
Behavior scripts are similar to the other Markup Language) documents with a
object types in that they can be brought .bvs extension. While they can be edited
into the Library as resources and can be in an external text editor, it’s recom-
attached as children to objects in the mended that you use Anark Studio’s
Object outline. Conceptually they are script editor to ensure that the proper
quite different from the other object XML tags are included in the file.
types, however. Behavior scripts are
To create a new behavior in Anark Studio:
chunks of code that tell the objects they
1. Do one of the following:
are attached to what to do and when to

72 Anark Studio User Guide


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

Editing behaviors

• Choose Script > New. “instructions” so you must edit it to


make it effective.
• Click on the Behavior button ( )
on the Basic Objects tab and drag a Line numbers are turned on by default,
behavior instance onto either the but you can turn off using the menu or
Project window or the Object shortcut key.
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 Script Editing window.
The Anark Studio scripting interface For detailed information about writing
error-checks your script each time you behavior scripts, see “Chapter 10: Using
compile or save and close. If any compile Scripting” on page 203.
errors are found, the first error will be To edit a behavior:
displayed and highlighted in yellow. Do one of the following:
When you compile your edits, the
changes are propagated to all instances Š Right-click on the behavior in the
of the behavior in the project. Library and select Edit Asset from the
Context menu.
Editing behaviors Š Double-click on the behavior in the
Using the Anark Studio scripting inter- Library or Object outline.
face, you can edit any behavior script
The text of the behavior will open in a
that is a resource in the Library. If you
script editing area in the Project
created the behavior by clicking on the
window. When you compile your edits,
Library button rather than importing it,
the changes are propagated to all
it is essentially an empty object with no
instances.

User Reference 73
Anark_Studio_User_Guide.book Page 74 Monday, March 19, 2007 10:34 AM

Chapter 4
Customizing and Extending Anark Studio

To display or hide line numbers:


Choose Script > Show Line Numbers or
press F8. The Close button.
The Close button checks the script for
Using the Behavior Editing tools
errors. If none are found, it saves and
These tools are only available on
closes the script. If an error is found,
Windows systems.
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
A. Compile button – Checks the script No, the errors will be saved in the script
for syntax errors and either saves the and will be propagated to any instances
edited script if none are found or of the behavior in the Object outline.
highlights the first error it comes
across. You can also choose Script > Updating behavior scripts
Compile or press the F7 key to com- When a behavior script is compiled or
pile the script. The Compile button is refreshed in Anark Studio, the following
only available when a script has been changes are propagated to all instances
edited. With the exception of certain of the behavior in the Object outline:
changes to the editable parameters
themselves, compiled changes will be Š Any edits to function text. Functions
propagated to all instances of the are the heart of any script because they
behavior in the Object outline. For contain the instructions for what the
information about how editable objects in the scene are supposed to
parameters are updated, see “Updat- do.
ing behavior scripts” on page 74. Š Changes to the values of any of the
B. Find – Opens the Find dialog box, following Script Parameters:
which allows you to search and
• Type
replace any text element in the script.
• Min Value
C. Find Previous – Searches backward
through the script for the text you • Max Value
specified in the Find dialog box. • List Values
D. Find Next – Searches forward through • Default Value (for List type only)
the script for the text you specified in
Changes to the values of any other Script
the Find dialog box.
Parameters are not propagated to the
E. Indent Right – Allows you to improve instances of the behavior.
the format of your script by indenting
a selected line of code four spaces to Exporting and printing
the right. This button is only active
when a section of code is highlighted.
behavior scripts
You can export a behavior to a .bvs file
F. Indent Left – Moves an indented line
from Anark Studio. You can also print a
of code four spaces to the left. This
currently open behavior.
button is only active when a section
of code is highlighted.

74 Anark Studio User Guide


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

Customizing properties for any object

To export a behavior as a .bvs file: Creating custom parameters


1. Choose Script > Export Behavior.
for objects
2. Enter a name for the .bvs file and The Edit Custom Parameters dialog
click OK. allows you to define custom properties
for any object, and custom actions and
Important: While exporting behavior
events for behaviors, and “expose” (i.e.,
scripts allows you to share them publish) them to Anark Studio so that
with other developers, certain errors they will be available on the Inspector or
in the script – particularly to the Actions tab.
XML parameters – may prevent an
externally edited script from prop- You must also write the code that
erly loading into Anark Studio when defines what the property, action or
refreshed or imported. event will actually do in a behavior
script.
To print a behavior:
Choose Script > Print Behavior. To access the custom parameter inter-
face:
For information about writing behavior
scripts, see “Creating behaviors” on 1. If you want to add a property to any
page 72. object other than a behavior, make
sure the Behavior Editor isn’t open.
Otherwise, only the behavior’s prop-
Customizing properties for
erties can be accessed.
any object
2. Select any object in the Library or
The Edit Custom Parameters dialog can
Object outline.
be used to expose custom properties on
any object that can then be accessed by a 3. Choose Edit > Edit Custom Parame-
behavior script or a Set Property action. ters. The Edit Custom Parameters dia-
A behavior must be written to define log box will open.
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 For instructions on creating each param-
page 125. 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

User Reference 75
Anark_Studio_User_Guide.book Page 76 Monday, March 19, 2007 10:34 AM

Chapter 4
Customizing and Extending Anark Studio

page 79 2. On the Properties tab, click on the


Add Property button ( ) or select
Working with custom properties an existing property from the list.
Custom 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.
3. Set the desired properties as
Custom properties appear in the Basic explained below.
Properties in the Inspector palette for the
• Display Name – Creates a label for
object.
the property that will appear in the
While custom properties are published Anark Studio Inspector palette.
to both the Library resource and all the
• Type – Sets the type of property
instances of the resource in the project,
being created. This dictates what
the values for the property are set on a
type of user interface editing tool
per-instance basis.
will be created for the property in
See “Understanding objects and the Inspector palette. Each type has
resources” on page 23 instances and some optional properties that you
resources. can set for it.
See “Chapter 10: Using Scripting” on Long – Creates an integer edit box.
page 203 for information about writing (See later bulleted information
behavior scripts. about selecting a minimum value
To create or edit a custom property: and maximum value.)
1. Open the Custom Parameters dialog Float – Creates a floating-point num-
using the instructions in “Creating ber edit box. You can optionally
custom parameters for objects” on specify a Minimum Value and Maxi-
page 75. 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

76 Anark Studio User Guide


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

Working with custom properties

Value will be checked (true) or optionally set a Default Value for


unchecked (false). the text.
Vector – Creates X, Y and Z edit • Name – Sets the scripting “handle”
fields. You can also set default val- for the property.
ues for X, Y and Z. • Help String – Specifies a help string
Rotation – Creates X, Y and Z edit to display in Anark Studio for this
fields that are specified in degrees. property. This string will appear as a
You can also set default values for X, tool tip when the user mouses over
Y and Z. the parameter. This field is optional.
Color – Creates a Color picker. You • Animatable – Specifies whether the
can optionally set a Default Color property will automatically be
using the Color picker. animatable in Anark Studio. The
following property types may be
String – Creates a text editing field.
animated: Float, Rotation, Vector
You can optionally set a Default
and Color.
Value for the String.
• Minimum Value, Maximum Value,
List – Creates a pull-down menu.
and Default Value – You can option-
You must specify the possible List ally specify an integer (e.g., 0, -4, 7,
Values as a comma-delineated list etc.) as the Minimum Value and
(e.g., Bounce,Dip,Twirl,Kick). Note Maximum Value. If the minimum
that there should be no spaces after and maximum are not equal, then a
the commas. You can set a Default slider tool will be created for the
Value for the list; otherwise the first parameter in addition to the
item in the list will be used as the number editing box. You can
default. optionally set a Default Value;
Object Reference – Creates an object otherwise, 0 will be the default
picker that uses either the absolute setting.
or relative path to the object. The 4. Click OK to save your changes.
absolute path locates the object by
walking down the object model The custom properties will appear in the
hierarchy. The relative path locates Inspector or Actions tab for objects.
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 Inspector palette for the Incrementor behav-
ior script

User Reference 77
Anark_Studio_User_Guide.book Page 78 Monday, March 19, 2007 10:34 AM

Chapter 4
Customizing and Extending Anark Studio

To delete a custom property: action. This string will appear as at


Select the property and click on the the bottom of the Action selection
Trash button ( ). pull-down when the user mouses
over the action. This field is
Working with custom actions optional.
You can expose a custom-written action Function Name – Identifies the name
to the Anark Studio GUI so that it will of the function as it will be called in
appear as an available action for a the text of the behavior script.
behavior object. The action can have
4. If you have defined any arguments
additional custom properties set for it
for the function in your behavior
that will appear on the Actions tab when
script, you can expose them to the
the action is selected.
Anark Studio interface so that they
You must also write the function code will appear on the Actions tab when
that defines what the action will actually the function is selected as an action.
do in the behavior script itself. See To do this, select a function and click
“Chapter 10: Using Scripting” on on the Add Property button ( ).
page 203 for information about writing The order in which the arguments
behavior scripts. are added must be the same as the
To create or edit an action for a behavior: order in which they are passed to the
1. Open the Custom Parameters dialog function. The Name of each parame-
using the instructions in “Creating ter is ignored for actions.
custom parameters for objects” on
5. Set the desired properties. The avail-
page 75.
able properties are generally the same
2. On the Actions tab, click on the Add as those documented in “Working
Action button ( ) or select an with custom properties” on page 76.
existing action from the list. 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.

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 On the Actions tab, custom actions are now

78 Anark Studio User Guide


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

Working with custom events

available in the Actions pull-down menu for 3. Set the desired event properties as
the behavior. explained below.
To delete a custom action: Name – Sets the name of the event as
Select the action and click on the Trash it will appear in the Event pull-
button ( ). down for the behavior. If this even
will be fired by script, this name
Working with custom events must be the same string that is set
You can expose a custom-written event for the AKEvent that fires it.
to the Anark Studio GUI so that it will Help String – Specifies a help string
appear in the Event pull-down menu on to display in Anark Studio for this
the Action tab for a behavior object. event. This string will appear as a
You must also write the event code that tool tip when the user mouses over
uses the AKEvent object and the the event. This field is optional.
fireEvent method of Behaviors, or use 4. Click OK to save your changes.
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. 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 ( ).

User Reference 79
Anark_Studio_User_Guide.book Page 80 Monday, March 19, 2007 10:34 AM

Chapter 4
Customizing and Extending Anark Studio

80 Anark Studio User Guide


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

Chapter 5: Setting Object


Properties
5
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.

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

Chapter 5
Setting Object Properties

Understanding different types that state for all selected objects until
of properties you change it again.
There 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 Click on the Expand/Collapse arrow to
and music have shared properties. access or close the Basic, Advanced or
Shared properties.
Changing a shared property on any
one instance automatically changes it In addition to these types of properties,
for all other instances and for the individual properties can be linked
Library resource. across instances and/or slides. See
To open or close a property group: “Linking and unlinking properties” on
Click on the Expand/Collapse toggle page 135 for more information.
next to the property group in the
Inspector. Anark Studio remembers About setting properties for
whether you have expanded or collapsed resources
the Advanced properties and maintains The 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

82 Anark Studio User Guide


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

About setting properties for instances

settings of previously added instances of see “Chapter 7: Animating Objects” on


the object will not be affected. However, page 145.
the Shared Properties for music, images
and video are shared across all instances. About linked properties
If any of the Shared Properties are If an object is on the Master slide, its
changed on any instance or the Library properties are automatically linked
resource, they are also automatically between the instances on other slides.
updated everywhere. When properties are linked, changes
Under their Advanced Properties, all made to one object are propagated to the
Library resources have a read-only other objects. For information about
Object Size property that indicates the how to link and unlink object proper-
runtime size of the object in kilobytes, ties, see “Linking and unlinking proper-
which can be used to help gauge ties” on page 135.
memory usage.
Setting properties for the
scene or slide
When the Scene or a slide is selected, the
Slide properties appear in the Inspector.

About setting properties for Slides control how the Scene is played.
instances The Scene is the root object in the Anark
When a resource has been added to the Studio object hierarchy. It encompasses
project, it becomes an instance. An the overall 3D space in which a project
instance of an object has a set of default takes place.
properties that are constant throughout All layers are attached directly to the
its duration. To change a property over Scene. The only other objects that can be
time, you’ll need to set up animation attached to the Scene are behaviors,
keyframes for it. The value of the first sound and music.
animation keyframe set for an object
The Background Color property of the
property will override any default
Scene is shared across all slides.
settings. The object will begin its dura-
tion at the value of the first keyframe For more information about slides, see
and will end its duration at the value of “Understanding slides” on page 133.
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,
Slide – Displays the name of the current
Slide. For information about renaming

User Reference 83
Anark_Studio_User_Guide.book Page 84 Monday, March 19, 2007 10:34 AM

Chapter 5
Setting Object Properties

objects, see “Renaming objects” on Setting properties for layers


page 63. Layers in Anark Studio are a special kind
Basic Properties of group that are used to organize the
Playback Speed – Controls the speed at
content of the scene and to control
which playback is executed. This affects certain properties for all the attached
the speed of any animation, including objects. They are second only to the
any animation created by a behavior scene in Anark Studio’s object hierarchy,
that uses the contextTime property. A which means that all objects (except
setting of 2 means animated objects will music and behaviors) must be attached,
appear to move twice as fast as normal; a either directly or through other attach-
setting of .5 means they will appear to ments, to a layer. There can be a single
move half as fast as normal, etc. A nega- layer or many layers in a project. When a
tive value (e.g., -.3, -2, etc.) makes the layer is added to the project, it already
scene play in reverse. This setting does has a default light and a default scene
not affect the frame rate of the presenta- camera attached to it.
tion or how often the scene is updated. For more information about how layers
Initial Play State – Controls whether the
work, see “Understanding layers” on
slide will initially play or be paused. page 48.
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. Layer – Displays the current name of the
Layer. For information about renaming
Ping – Sets the scene to play forward objects, see “Renaming objects” on
and back only once. page 63.
Play Through – Sets the scene to play
from beginning to end once and then Basic Properties
continue onto the next slide. X Position – Offsets the layer from the
left side of the scene (along the X axis),
Shared Properties creating a left margin for it. Specified as
In addition to the properties available in a percentage of the overall height of the
the Anark Studio Inspector that are listed scene.
here, some additional values are avail- Y Position – Offsets the layer from the
able for slides: top of the scene (along the Y axis),
Background Color – Sets the background creating a top margin for it. Specified as
color for the entire scene in all slides. a percentage of the overall width of the
scene.

84 Anark Studio User Guide


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

Setting properties for text

Width – Sets the scale of the layer along Layer Color – Sets the background color
the X axis. Specified as a percentage of for the layer. The background color will
the overall width of the scene, up to only be drawn if the Use Layer Color
400%. parameter has be turned on.
Height – Sets the scale of the layer along
Advanced Properties
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 X Pivot – Sets the X position of the pivot
opacity is set to 0, the objects will be point of the layer. Specified as a
drawn in the scene, but will be invisible. percentage of the layer size.
This is different from Use Layer Color, Y Pivot – Sets the Y position of the pivot
which controls whether the “empty point of the layer. Specified as a
space” of the layer will be drawn. See percentage of the overall width of the
“Working with opacity” on page 111 for scene.
information about the effect of opacity
settings on how objects are rendered and Setting properties for text
the multiplicative relationship of the
Opacity properties of layers, groups, Text enables the creation of a variety of
models and materials. text objects, such as one-word labels,
headlines, captions and entire para-
Use Layer Color – Enables the Layer Color
graphs of scrollable text.
property. When Use Layer Color is on
(checked), this layer will completely All fonts that are used in a project can be
obscure any layers behind it (i.e., that embedded in the presentation file so
were drawn first). This is different from that they can be displayed on the
Opacity, which controls only the trans- viewer’s computer. See “Export Options”
parency of the objects that are attached on page 22 for more information.
to the layer. Defaults to off (unchecked). 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-

User Reference 85
Anark_Studio_User_Guide.book Page 86 Monday, March 19, 2007 10:34 AM

Chapter 5
Setting Object Properties

sentation Size” on page 20 for more sions are limited to the width and
information. 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.

Text – Displays the current name of the


Text. For information about renaming
objects, see “Renaming objects” on
page 63.
Flat text can be used to display blocks of
Basic Properties information.
Text Type – Specifies whether the text
will be treated as line text or as a Depth – Renders the text on a plane
paragraph. that can be moved forward or back-
ward and can be rotated around the Z
Line – Line text grows or shrinks in axis. As with Flat text, the text will
length as it’s edited, but it does not always face the camera, even if the text
wrap to the next line. The Text Box object is rotated. Depth text is particu-
Width and Height are dynamically
updated for line text, and the dimen-

86 Anark Studio User Guide


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

Setting properties for text

larly useful for creating labels for parts Pivot – Adjusts the position of the text’s
or for diagrams. 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
Depth text can be used to create labels.
Position in order to lock the text in
place relative to its parent
Full Perspective – Renders the text on a
plane that can be moved, rotated and Text Color – Sets the color of the text.
scaled like any other 3D object. Full Defaults to white. The Text Color prop-
Perspective text would typically be erty bar in the Timeline will match the
used for motion graphics and 3D but- selected Text color.
tons. 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
Full Perspective text can be used to create must turn on Embed Fonts in the Project
motion graphics. Preferences. See “Setting program and
project preferences” on page 17 for more
Text String – Specifies the text to be
information.
displayed. All languages supported by
Microsoft Windows can be input. If fonts are not embedded in the presen-
tation and the viewer does not have a
Position – Adjusts the position of the
font installed on his or her computer,
text, relative to its parent. While all text
the text will be displayed in Arial.
objects can be moved along the X and Y
axes, only text with a Render Style set to Fonts are never embedded in the .amw
either Depth or Full Perspective can be file, so other Anark Studio users would
moved along the Z axis. need to have the font installed in order
to see it.
Rotation – Adjusts the rotation of the
text, relative to its parent. Text objects Font Size – Specifies the size of the text in
with a Render Style set to Depth or Flat points. If the presentation is resized
can only be rotated around the Z axis. during playback, Flat text continues to
be rendered at the specified font size.
Scale – Adjusts the scale of the text, rela-
However, Depth and Full Perspective
tive to its parent. Only text objects with
text are resized if the height of the
a Render Style set to Full Perspective can
window is changed. See the section on
be scaled.
Presentation Size under “Editing project

User Reference 87
Anark_Studio_User_Guide.book Page 88 Monday, March 19, 2007 10:34 AM

Chapter 5
Setting Object Properties

settings” on page 19 for information


about how objects are resized when the
playback window is resized.

88 Anark Studio User Guide


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

Setting properties for text

Horizontal Alignment – Determines how Text Box Height – Sets the height of the
paragraph text is positioned between the text box as a percentage of the current
left and right borders of the text box. layer’s dimensions. Text that extends
Left – Aligns the text along the left side beyond the boundaries of the text box is
of the text box. clipped. This property is only available
when the Text Type is set to Paragraph.
Centered – Centers the text within the
text box. Word Wrap – Enables word wrapping so
that text automatically wraps to the next
Right – Aligns the text along the right line when the text hits the horizontal
side of the text box. edge of the text box. This is only avail-
Vertical Alignment – Determines how able when the Text Type is set to Para-
paragraph text is positioned between the graph. This property is only available
top and bottom of the text box. when the Text Type is set to Paragraph.
Top – Aligns the text along the top of
Advanced Properties
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 Vertical Scroll – Moves the text down (by
text. If the opacity is set to 0, the text decrementing the value) or up (by incre-
will be drawn in the scene, but will be menting the value) in the text box.
invisible. See “Working with opacity” on Horizontal Scroll – Moves the text to the
page 111 for information about the right (by decrementing the value) or to
effect of opacity settings on how objects the left (by incrementing the value) in
are rendered. the text box.
Leading – Sets the spacing between lines Use Background Color – Enables the
of text. Background Color property. When Use
Tracking – Sets the spacing between all Background Color is on (checked), the
letters in a word, sentence and/or para- background of the text object will
graph. obscure the objects behind it. Defaults to
Text Box Width – Sets the width of the
off (unchecked).
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. 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.

User Reference 89
Anark_Studio_User_Guide.book Page 90 Monday, March 19, 2007 10:34 AM

Chapter 5
Setting Object Properties

Setting properties for cameras different fields of view, targets and


Cameras in Anark Media control the way animation.
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. Camera – Displays the current name of
the Camera. The name of resources in
While each layer is seen through its own the Library can only be changed using
camera, the final image of the scene is a this box. For information about
composite picture incorporating the renaming objects, see “Renaming
views of every layer through their active objects” on page 63.
cameras. This allows you to create a
variety of interesting visual effects using Basic Properties
Orthographic – 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

90 Anark Studio User Guide


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

Setting properties for cameras

Size” on page 20 for more that are not attached to it will appear to
information. 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
A normal camera view (top), and an of this plane will be rendered.
orthographic camera view of the same scene
Clipping End – Sets a radial rear clip
(bottom).
plane for the camera. Nothing behind
Position – Adjusts the position of the this plane will be rendered.
camera, relative to its parent.
Rotation – Adjusts the rotation of the Quick Definition
camera, relative to its parent. If a Target Clipping planes - A clipping plane is a
Lock has been set, then any Rotation plane that is vertical to the line of
setting will be ignored, because the sight, beyond which objects disappear.
camera will not “look away” from the The near clipping plane, which defines
Target. the point at which objects moving
Scale – Adjusts the scale of the camera towards camera will disappear, is set
and any child objects attached to it. with the Clipping Start property. The
Scaling the camera affects the objects in far clipping plane, which defines the
the scene that are not attached to it point at which objects moving away
inversely. If the camera is scaled to a from the camera will disappear is set
value of 2, then the objects in the scene with the Clipping End property.

User Reference 91
Anark_Studio_User_Guide.book Page 92 Monday, March 19, 2007 10:34 AM

Chapter 5
Setting Object Properties

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.
When Clipping Start is set to 200, portions Fog Enable must be turned on in order
of the objects in the foreground aren’t ren- for this setting to appear.
dered (top), and when Clipping End is set to
End of Fog – Sets the radial distance from
400, the objects in the background are not
rendered. the camera at which fog makes every-
thing opaque. Fog Enable must be
Basic Properties turned on in order for this setting to
Target Lock – Enables the Target prop- work.
erty and locks the camera’s view to the
Fog Color – Sets the color of the fog. Fog
specified Target. Even if the camera’s
Enable must be turned on in order for
position is changed, it will stay focused
this setting to appear.
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. Fog makes objects in the background appear
fainter.
Enable Fog – Enables fog settings for the
camera, including Fog Color, Start of Fog

92 Anark Studio User Guide


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

Working with fog

Working with fog can also add new lights to the layer.
Video cards can display two types of fog: There can be up to eight simultaneously
vertex and table. Vertex fog is drawn active lights for each layer.
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. Light – Displays the current name of the
Light. For information about renaming
Š If possible, you should test your project objects, see “Renaming objects” on
on different computers with different page 63.
video cards to see what affect the
different types of fog will have on your Basic Properties
project. Light Type – Specifies whether the light
will be Point, Directional or Spot.
Setting properties for lights Directional – A Directional light casts
Lights are used to create natural lighting light in parallel rays, much like sun-
like sunlight, artificial lighting like light hitting the earth. The light is cast
indoor lighting, or more stylized lighting at the same angle on all the objects in
effects like theatrical productions the scene with equal brightness. The
might use. angle is determined by the Rotation
setting of the light. Because directional
When a new layer is created, it has a
lights don’t have a Brightness prop-
Light object already attached to it that
erty, you must change their Diffuse
provides lighting for the scene. You can
edit the properties of this light, and you

User Reference 93
Anark_Studio_User_Guide.book Page 94 Monday, March 19, 2007 10:34 AM

Chapter 5
Setting Object Properties

Color in order to increase or decrease Spot – A Spot light casts a cone-shaped


their brightness. beam of light from a single point.

A Directional light illuminates the group with A Spot light illuminates the group with a
flat, even lighting. cone of light.
Point – A Point light casts light in all Position – Adjusts the position of the
directions from a single point. Because light, relative to its parent. This property
it emits light equally in all directions, has no effect on Directional lights.
any Rotation setting is ignored for this Rotation – Adjusts the rotation of the
light type. 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.
A Point light set inside a group illuminates
the objects from within.

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.

94 Anark Studio User Guide


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

Setting properties for groups

Setting properties for groups


Groups hold other objects. They are used
Cone Angle – This setting is only avail-
to apply the same settings to multiple
able if the Light Type is Spot. It adjusts objects at once or to animate them.
the falloff at the edge of a Spot light’s
Note: Components, which are used
cone of light. Range = 0 to 180 degrees.
to create independently timed ani-
Default = 180.
mation for objects, have several of
Advanced Properties the same properties as groups. They
also have some unique properties,
which are documented in “Setting
properties for components” on
page 117.

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 Group – Displays the current name of the
the speed at which the light from this Group. For information about renaming
light source fades to darkness. “Real objects, see “Renaming objects” on
world” light fades exponentially, but it page 63.
may seem too dark for computer
Basic Properties
graphics. The higher the setting, the
Position – Adjusts the position of the
faster the fade. Linear Fade can be used
members of the group, relative to the
together with Exponential Fade to create
pivot point of the group’s parent.
interesting light effects. Range = 0 to
200. Default = 0. Rotation – Adjusts the rotation of the
group around its pivot point.
Specular Color – Adjusts the color of
highlights in the scene. Scale – Adjusts the scale of the members
of the group based on the group’s pivot
Ambient Color – Adjusts the color of
point.
indirect light in the scene.

User Reference 95
Anark_Studio_User_Guide.book Page 96 Monday, March 19, 2007 10:34 AM

Chapter 5
Setting Object Properties

camera. When Distance Fade is on,


Note: The position, rotation and
objects that are part of the group that are
scale of groups can also be set using beyond the Fade Far setting will not be
mouse controls or the arrow keys. rendered at all, while objects that are
See “Shortcuts for setting properties closer than the Fade Near setting will be
for groups, models and text” on fully rendered. Any objects between
page 97. these ranges will be progressively more
Pivot – Adjusts the position of the transparent. This can be used to opti-
group’s pivot point. The pivot point mize rendering speeds of complex
serves as the center for group’s rotation presentations with many objects and
and provides the coordinates for scaling. polygons and can improve the appear-
When a group is added to the project, its ance since aliasing of distant objects
pivot point is set to the World Center may be reduced.
(0, 0, 0). The Distance Fade setting applies to all
objects in the group; however, if the
Note: The pivot point of the group is group contains a subgroup that has
not based on the location of the Distance Fade selected and that has
objects within the group. Even if the different settings for Fade Near and Fade
objects within the group are moved Far, those settings will be used for the
around, the group’s pivot point does objects within the subgroup instead.
not move. It stays at the world cen- (Turning off the Distance Fade setting
ter until the group object itself is for the subgroup uses the settings of the
moved. parent; it does not disable Distance Fade
Opacity – Adjusts the transparency of all for that subgroup.)
models attached to the group. If the Fade Near – Sets the distance where
opacity is set to 0, the object will be objects begin to fade. Objects closer than
drawn in the scene, but will be invisible. this range are not affected by Distance
See “Working with opacity” on page 111 Fade at all.
for information about the effect of Fade Far – Sets the culling distance where
opacity settings on how objects are objects are completely invisible. Objects
rendered and the multiplicative relation-
in the group that are beyond this range
ship of the Opacity properties of layers, are not rendered.
groups, models and materials.
Tip: Typically, the Fade Far is “far-
Advanced Properties
ther” from the camera than the Fade
Near, but the reverse can also be
used to make objects in the fore-
ground disappear instead.
Distance Fade – Enables “Soft Culling”
based on the distance of objects from the

96 Anark Studio User Guide


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

Setting properties for models

Setting properties for models See “Shortcuts for setting properties


There are a variety of primitive models, for groups, models and text” on
page 97.
such as cubes, spheres, cones and rectan-
gles available on the Basic Objects tab. In Pivot – Adjusts the position of the
addition, you may want to use 3D mesh object’s pivot point. The pivot point
objects that were created in other appli- serves as the center for the model’s rota-
cations. If you are creating them your- tion and provides the coordinates for
self, you should use the guidelines that scaling.
are outlined in “Chapter 2: Preparing
Opacity – Adjusts the transparency of the
Models, Videos and Images” on page 35.
model. If the opacity is set to 0, the
Once you have created a model, you
object will be drawn in the scene, but
must import it into the Library palette as
will be invisible. See “Working with
a resource using the instructions in
opacity” on page 111 for information
“Importing objects” on page 51.
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 text
In 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
Model Name – Displays the current name includes controls for quickly changing
of the Model. For information about these properties in the Inspector palette.
renaming objects, see “Renaming
objects” on page 63. Tip: Press and hold down with the
middle mouse button to momen-
Position – Adjusts the position of the
tarily switch the focus to the edit
model, relative to its parent.
camera tool icons. The tool with the
Rotation – Adjusts the rotation of the focus is brighter than the other
model, relative to its parent. tools.
Scale – Adjusts the scale of the model These controls can be used to change
and its children. both the default settings or to animate
these properties over time. For informa-
Note: The position, rotation and tion about animating properties, see
scale of models can also be set using
mouse controls or the arrow keys.

User Reference 97
Anark_Studio_User_Guide.book Page 98 Monday, March 19, 2007 10:34 AM

Chapter 5
Setting Object Properties

“Chapter 7: Animating Objects” on


2. Enable the Rotate tool ( ).
page 145.
3. Do one of the following:
• While holding down the left mouse
button, click on the object and
Transform tools for selected objects.
rotate it to the desired position in
To select a Transform tool: the Project window.
Click on the icon for it or press one of
• Press the arrow keys on your
the following keys:
keyboard to rotate the object to the
R = Rotate desired position in the Project
W = Position window. The up and down keys
rotate the it around the X axis. The
E = Scale
left and right keys rotate it around
When any Transform tool is enabled, the Y axis.
you can temporarily enable a different
tool by holding down modifier keys. The Note: Only text objects with a Render
tool icon in the Project window will Style set to Full Perspective can be
change to the currently enabled tool. rotated in X and Y. See “Setting
The following table lists how the keys properties for text” on page 85 for
affect the currently selected tool. more information.

Currently Selected To rotate an object along the Z axis:


Tool 1. Select the object using the instruc-
tions in “Selecting objects” on
Modifier Key Rotate Position Scale
page 61.
Alt Scale Scale Rotate
Ctrl Position Rotate Position
2. Enable the Rotate tool ( ).
Using the keyboard shortcuts to change 3. Do one of the following:
group, model or text properties is called
• While holding down the Shift key,
nudging.
use the up and down arrow keys and
To change the number of units each rotate the object to the desired posi-
keypress transforms the object:
tion in the Project window.
1. Choose Edit > Application Prefer-
ences (Ctrl + P). The Preferences dia- • Right-click on the object and rotate
log will open. it to the desired position in the
Project window.
2. Set a new Nudge Increment.
3. Click OK. Note: All text objects can be rotated
around Z.
Changing rotation
To rotate an object along the X and Y
Changing position
axes: To move an object along the X and Y
1. Select the object using the instruc- axes:
tions in “Selecting objects” on 1. Select the object using the instruc-
page 61. tions in “Selecting objects” on
page 61.

98 Anark Studio User Guide


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

Changing scale

ties for text” on page 85 for more


2. Enable the Position tool ( ).
information.
3. Do one of the following:
• While holding down the left mouse Changing scale
button, click on the object and To change the overall scale of an object:
move it to the desired position in 1. Select the object using the instruc-
the Project window. Holding down tions in “Selecting objects” on
the Shift key as you drag constrains page 61.
the movement to one axis (i.e., the
X axis when the mouse is dragged 2. Enable the Scale tool ( ).
horizontally and the Y axis when it’s 3. Do one of the following:
dragged vertically).
• While holding down the left mouse
• Press the arrow keys on your button, vertically drag the object to
keyboard to move the object to the the desired scale.
desired position in the Project
• Press the arrow keys on your
window. The up and down keys
keyboard to reach the desired scale.
move it along the X axis. The left
The up and down keys scale the
and right keys move it along the Y
object along the X axis. The left and
axis.
right keys scale it along the Y axis.
To move a group or model along the Z
axis: To scale an object along the Z axis:
1. Select the group or model using the 1. Select the object using the instruc-
instructions in “Selecting objects” on tions in “Selecting objects” on
page 61. page 61.

2. Enable the Position tool ( ). 2. Enable the Scale tool ( ).

3. Do one of the following: 3. Do one of the following:

• While holding down the Shift key, • Hold down the Shift key and use the
use the up and down arrow keys on up and down arrow keys to reach
your keyboard and move the group the desired scale.
or model to the desired position in • Right-click on the object and verti-
the Project window. cally drag it to the desired scale.
• Right-click on the group or model
Note: Only text objects with a Render
and move it to the desired position
in the Project window. Style set Full Perspective can be
scaled. See “Setting properties for
Note: Text objects with a Render text” on page 85 for more
Style set to Flat cannot be moved information.
along the Z axis. See “Setting proper-

User Reference 99
Anark_Studio_User_Guide.book Page 100 Monday, March 19, 2007 10:34 AM

Chapter 5
Setting Object Properties

Working with obscured into Anark Studio. Primitives created


objects using the buttons on the Basic Objects
tab already have materials attached to
When working in the 3D space of the
them. Multiple materials can be applied
Project window, objects that are larger or
to the different polygons of a model in
closer may obscure other objects.
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 model obscured by the cylinder can be the Object outline and then clicking on
moved, scaled or rotated using the mouse by the Expand/Collapse arrow next to
clicking in the matting outside the Project Materials.
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 Material Name – Displays the current
model has the desired setting. name of the Material. For information
about renaming objects, see “Renaming
objects” on page 63.
Setting properties for
materials Basic Properties
Materials are used to create the surface Diffuse Color – Adjusts the color of the
appearance of a model. They control the material as viewed in direct light.
color, shininess and opacity of a model, Emissive Power – Specifies the intensity
among other things. Materials do not of the emissive property of the material.
have timebars of their own, because the An emissive material appears to give off
duration of a material is always the same its own light.
as the duration of the model to which it
Blending Mode – Controls how the pixels
is attached.
of this material blend with the pixels of
When a model is imported into Anark the rest of the scene. Blending Modes are
Studio, information about any materials based on mathematical operations that
that have been applied to its surface is compare the color values of the pixels of
imported along with the model’s file this material with the color values of the

100 Anark Studio User Guide


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

Setting properties for materials

pixels of whatever else is in the scene


Note: Opacity settings (on models,
that intersects this material (the base
color). Several of the Blending Modes materials, layers or groups) have dif-
use the Hue, Luminosity or Saturation ferent results with different Blend-
values of the colors when blending. ing Modes. In some cases, opacity
Those terms are defined in “Setting color settings are applied as they normally
properties” on page 116. 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.

User Reference 101


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

Chapter 5
Setting Object Properties

Normal – Uses no special Blending the highlights and shadows of the base
Mode and makes only the material color.
color the result. Bleach – Takes the saturation of the
Screen – Additively blends the material material color and adds it to the base
color with the base color by multiply- color. The effect is similar to bleaching
ing the inverse of the color values to (lightening) with specific colors.
create the result. Screen always creates Ghost – Multiplies the material color’s
a lighter final color. The Opacity prop- opacity value (i.e., its alpha channel
erty does not affect this mode. data) by its luminosity value and mul-
Multiply – Additively blends the mate- tiplies the result with the inverse of the
rial color with the base color by multi- base color to create the final result. The
plying the color values to create the Opacity property does not affect this
result. Multiply always creates a darker mode.
final color. Saturate – Doubles the material color’s
Overlay – Overlays the material color values and blends them with the base
onto the base color while preserving color. The Opacity property does not
affect this mode.

102 Anark Studio User Guide


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

Setting properties for materials

Opacity – Adjusts the transparency of the must be checked in order for this setting
material. If the opacity is set to 0, the to appear.
object will be drawn in the scene, but Double Sided – Specifies the type of
will be invisible. See “Working with culling to perform on this object. This
opacity” on page 111 for information can be used as an optimization tool to
about the effect of opacity settings on reduce the number of polygons that
how objects are rendered and the multi- must be rendered to accurately display
plicative relationship of the Opacity this material on an object.
properties of layers, groups, models and
materials. 2 Sided – Specifies that no culling will
be performed.
Advanced Properties 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.
Render Mode – Specifies whether the
object is displayed as a wireframe, a
Note: If the material is too dark when
point cloud, or a solid. Defaults to Solid.
1 Sided is set, increase the Emissive
Ambient Color – Adjusts the color of the Power.
material as viewed in indirect light.
Quick Definition
Enable Specularity – Specifies whether Culling - Culling is the process of elimi-
the material will display specular nating the polygons that face away
highlights (i.e., glossiness) and enables from the viewer and therefore can’t be
the Specular Color and Specular Power seen. Culling speeds up the rendering
properties. of the scene, since all those unseen
polygons use up valuable processing
power.

Depth Write – Sets whether the normal


depth render order will be enabled for
Specular Color – Adjusts the color of the the material. If set to Default, then the
material’s reflected highlights. Specular opacity of the material will determine
Enable must be checked in order for this whether or not the normal back-to-front
color setting to appear. render order will be applied. If turned
Specular Power – Specifies the sharpness on, then the normal render order will be
of the specular highlights of the mate- applied, regardless of the opacity of the
rial. A higher value creates a tighter and material. If turned off, then the normal
more intense highlight. Specular Enable render order will not be applied to this
material. See “Working with opacity” on
page 111 for more information.

User Reference 103


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

Chapter 5
Setting Object Properties

Setting properties for images Note: Most video cards can’t support
Images in Anark Studio are the equiva- more than four images per model or
lent of image or material maps in 3D material, and some can only support
modeling programs. Any 2D graphic two images, so it’s a good idea to use
image can be an image map. It may as few images per material as
contain a black and white or color possible. Be aware of the limitations
graphic or photograph. Any image map and capabilities of your video card.
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
Image Name – Displays the current name
maps, see “Preparing video clips and
of the image for the image. For informa-
graphics as image maps” on page 41.
tion about renaming objects, see
Images can only be attached to layers, “Renaming objects” on page 63.
groups or materials. When an image is
For specific information on the different
attached to a layer or a group, it is auto-
types of image properties, and how to
matically mapped to a newly created
use them, see the following sections:
model (a rectangle primitive) in both the
Object outline and the Library, and the Š “Basic properties (for images)” on
original image is turned into a child page 105
object of the new model’s material.
Š “Advanced properties (for images)” on
Double-clicking on an image in the page 107
Object outline will open it in your
default image viewing application. Š “Shared properties (for images)” on
page 108
For a complete list of supported image
formats, see “Supported Media Formats” Š “Mipmapping” on page 109
on page 305.

104 Anark Studio User Guide


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

Basic properties (for images)

Basic properties (for images) object, which the object then reflects.
Texture Mapping – Controls the way the This is often used to create the look of
image is wrapped around or projected glass or metal, which reflect what’s
onto the object. around them.
Texture Type – Specifies how the image
will affect the appearance of the
material.

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
Diffuse Map – Applies the image to the
portion of the image seen on the
material’s diffuse color and ambient
object will change. Camera Projection
color.
maps are best viewed when Ortho-
graphic has been turned on for the Opacity Map – Applies the image to the
active camera. material’s alpha channel (or transpar-
ency). See “Creating an Opacity Map”
Object Projection – Projects the image
on page 112 for more information.
onto the object like a slide projector,
and fits the image to the dimensions of Specular Map – Applies the image to
the object. This is useful for light maps the material so that it acts as the mate-
and reflections maps. rial’s specular highlights. The map will
additively blend with any other map
Environmental Mapping – Maps the
on the material.
image to a sphere surrounding the

User Reference 105


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

Chapter 5
Setting Object Properties

Light Map – Applies the image to the Negative Map – Applies the image to
material as a light map. Light maps are the material in the inverse, resulting in
used to simulate real-world lights on a negative of the image.
materials. This map type is less dra- U Tiling – Specifies the type of tiling (or
matic than the Specular Map and will repetition) to apply horizontally to the
slightly brighten the material without image. Tiling is typically used to create
over-brightening. For more informa- wallpaper-like patterns with a simple
tion about creating light maps, see image. Tiling works best when the orig-
“Creating a Light Map” on page 111. inal image size is a power of 2 (8 x 8
Emissive Map – Quadruples the color pixels, 64 x 64 pixels, etc.).
saturation and luminosity (or bright- Tiled – Repeats the image over and
ness) of the material based on the color over.
information of this image.
Mirrored – Flips the image repeatedly.
SuperCharge Map – Doubles the color
saturation and luminosity of the mate- No Tiling – Does not repeat the image.
rial based on the color information of
this image.

106 Anark Studio User Guide


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

Advanced properties (for images)

V Tiling – Specifies the type of tiling (or Advanced properties (for


repetition) to apply vertically to the images)
image. V Tiling uses the same types as
U Tiling.

U Position – Adjusts the horizontal posi-


tion of the image in normalized units. A
An image with U and V Repeat set to 4 and setting of .5 moves the image over by
U and V Tiling set to Tiled (left); the same
image with U and V Tiling set to Mirrored half of its distance. A setting of 2 moves
(right). the image over by twice its distance,
which would mean that it is no longer
U Repeat – Adjusts the horizontal scale of
displayed unless U Tiling has been
the image so that it can be repeated on
enabled.
the model (using tiling).
V Position – Adjusts the vertical position
V Repeat – Adjusts the vertical scale of
of the image in normalized units. A
the image so that it can be repeated on
setting of .5 moves the image over by
the model (using tiling).
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 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 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-
An image with UV Rotation set to 12. 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.

User Reference 107


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

Chapter 5
Setting Object Properties

V Pivot – Sets the vertical location of the No Transparency – Prevents the ren-
pivot point of the image on the object. derer from using the image’s alpha
Because the pivot point is calculated in channel data.
global space, a Position V offset must For more information on how opacity
also be set in order to see a difference in settings are handled in Anark Studio, see
the pivot point in the local space of the “Working with opacity” on page 111.
image. If the U Pivot and V Pivot are set
to 0, then the pivot point is located in Shared properties (for images)
the bottom left hand corner of the The contents of this area of the Inspector
model. Specified in values between 0 pane vary considerably. For example,
and 1.0. 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

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
Shared properties, including the
models, the alpha channel data of
compression settings, are automatically
images may cause the model to be
applied to all instances of an image. If
rendered improperly. For example, trans-
more than one resource of the same
parency is often added to the skin of
image has been imported into the
character models in order for them to
Library, then the compression settings
look more realistic. Because this can
are applied to all of them. Real-time
cause those portions of the model itself
compression information about the
to be rendered as transparent, you can
image is displayed in the Inspector
use Propagate Image Opacity to tell the
palette.
renderer not to use the image’s transpar-
ency in that instance.
Use Image Alpha – Allows the renderer Current compression information for the
to decide whether to use an image’s image is in the Inspector palette.
alpha channel data, if any exists. Image Size Reduction – Reduces the
Force Transparency – Forces the ren- image dimensions in such a way that
derer to use an image’s alpha channel both file size and the video card memory
data. required for display are reduced. When-
ever possible, this should be the first
type of compression applied to an

108 Anark Studio User Guide


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

Mipmapping

image, although it can make the image images” on page 169 for more
appear grainier when close up. information.
Compression Type – Specifies the type of Connect to Source – Allows you to view a
compression algorithm to be applied to remote image while working in Anark
the image. There is a trade-off between Studio. The Remote Source must also be
image quality and finished file size. In specified. When Connect to Source is
general, you should compress images as checked, you cannot edit the Remote
much as possible while maintaining the Source property.
level of quality you need.
Lossless – Slightly compresses the file
Mipmapping
size without any loss of image quality. Mipmaps help improve the visual
quality of rendered images. Mipmapping
JPEG – Compresses continuous tone works by creating lower resolution,
images such as photographs while prefiltered versions of an image that you
maintaining optimal image quality intend to use as a texture map. When
and enables the Compression Quality rendering the image, the appropriate
slider. resolution mipmap is chosen and
Compression Quality – Controls the size thereby the texture pixels (texels) are
of the color palette for the image. If an already down-sampled and filtered when
image uses 256 colors and Compression they arrive on the screen.
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 The downsampled images of the brick wall
are shown to the right. Each new image is
embedded image (i.e., the image exactly half the size—in each direction—of
resource in the Library) will be the previous image on which it is based.
displayed. If Connect to Source is
The computations for the mipmapping
checked, you cannot edit the Remote
are handled on the video card, so it can
Source property. This property can be
be rendered quickly.
used to load a sequence of images if used
in conjunction with a properly written The three mipmapping algorithms you
behavior. Because it may take a moment can choose from are:
or two to load a remote image, you can • Bi-linear
use the PreBufferAsset behavior to begin
• Tri-linear
loading the image asset before the image
is displayed. See “Setting up dynamic • Tri-linear anisotropic

User Reference 109


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

Chapter 5
Setting Object Properties

The options for bi-linear and tri-linear that are far away and steeply angled
are the same; with tri-linear anisotropic, with respect to the camera.
you are presented with another option,
Quick Definition
anisotropy degree.
Anisotropy (the opposite of isotropy)
Š Bi-linear – Bi-linear filtering uses points is the property of being directionally
from the mipmap to perform bilinear dependent. Something that is
interpolation between the four texels anisotropic may appear different,
nearest to the point that the pixel or have different characteristics in
represents. different directions.

Š Tri-linear – Tri-linear filtering interpo-


lates between the results of bilinear MipMap LOD Bias – LOD is an abbrevia-
filtering on the two mipmaps nearest tion for Level of Detail. LOD bias
to the detail required for the polygon increases the efficiency of the rendering
at the pixel. 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),
Š Tri-linear anisotropic – The tri-linear features in the distance (far from the
anisotropic algorithm enhances the
camera) will look fairly sharp.
image quality of textures on surfaces
Anisotropy Degree – Choose between
Low, Medium, and High. A high degree
requires more iterations of computing
than a low degree.

110 Anark Studio User Guide


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

Working with opacity

Working with opacity Š One way is to use the Depth Write


Opacity is a powerful feature of Anark property of the material. Depth Write
Studio that helps create a sense of depth allows you to specify that the initial
and greatly expands the types of effects render order for a particular model’s
that can be applied to objects in the polygons should be overridden. If you
scene. When working with the Opacity notice that a model – or even a partic-
property of a layer, group, model, text or ular material on the model – is not
material, it’s important to keep a couple displaying correctly when an opacity
of concepts in mind. setting is changed, then you will have
One is that the Opacity properties of to experiment with the Depth Write
objects have a multiplicative relation- setting for each material on the object.
ship. This means that if a model has an If there is only one material on the
opacity value of 50% and both its parent model, try turning on Depth Write. If
group and layer have an opacity value of there is more than one material on the
80%, then the model will actually model, you may need to set Depth
appear to have an opacity of 32% (50% x Write on for some and off for others.
80% x 80% = 32%). Keep in mind that if the object is
rotated, then the render order will be
The second important concept is the inaccurate again.
effect of opacity on the render order of
the polygons that make up the models Š Another option is to use the Propagate
in the scene. In order to generate Image Opacity property of images.
smooth animation for real-time 3D Propagate Image Opacity allows you to
graphics, computer systems must make control whether or not the alpha
some initial decisions about how to draw channel data for an image will
the polygons that compose the objects contribute to the transparency of a
in the scene, including in what order to model. If you import a complex model
render them. Whenever an object is and find that some of the polygons
made transparent by setting the opacity appear to be rendering in the wrong
to anything other than 100%, the initial order, setting Propagate Image Opacity
render order may no longer be accurate. to No Transparency may help.
The same thing may also happen when a
complex model with transparent Creating a Light Map
textures is imported into Anark Studio. Light Maps are a special kind of Texture
Type that softly project an image onto
During playback, the render order of the
the model in order to simulate photo-
objects in the scene is recalculated each
realistic lighting.
time the scene is drawn; however, recal-
culating the render order of all the poly- To use Light Maps in Anark Studio and
gons of all the objects for every frame your presentations:
1. Import a 3D model into Anark Studio
would be too processor-intensive for
smooth playback. and drag an instance of it onto the
Project window or the Object
Anark Studio provides a couple of ways outline.
for you to control how a model’s poly-
2. Import a grayscale image to be used
gons should be rendered.
as a Light Map.

User Reference 111


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

Chapter 5
Setting Object Properties

3. Click on the imported Light Map 2. Import the image to be used as the
resource in the Library. Opacity Map.
4. Set the Texture Mapping to Object 3. Set the Texture Type to Opacity Map.
Projection. 4. Expand out the material of the model
5. Set the Texture Type to Light Map. you want to apply the Opacity Map
6. Expand out the material of the model to by clicking on the Expand/Col-
you want to apply the Light Map to lapse arrow next to it in the Object
by clicking on the Expand/Collapse outline.
arrow next to it in the Object outline. 5. Drag the Opacity Map image from
7. Drag the Light Map image from the the Library onto the model's
Library onto the model's material. material.

From left to right: a 3D model, a grayscale From left to right: a 3D model, a grayscale
image, and the image applied to the model image, and the image applied to the model
as a Light Map. as an Opacity Map.

Creating an Opacity Map If for some reason you only have a 24-bit
Opacity Maps allow you to create trans- image to work with, Anark Studio
parent holes in an object. In order to do provides a way to create an alpha
this, Anark Studio needs alpha channel channel for it so that it can be used as an
data for the image. The alpha channel Opacity Map.
specifies the transparency of each pixel
in the image, just as the red, green and Important: The Make Opacity Image
blue channels together specify the color operation that creates the alpha
of each pixel. Some popular image types, channel for the image turns the
such as .jpg, do not have any alpha image into a grayscale and changes
channel data. They are 24-bit images as the color data. Once it has been exe-
opposed to 32-bit images (such as .png cuted, it cannot be undone inside
and .tga), which include 8 bits of alpha Anark Studio. You should only use it
channel data. on 24-bit images that you want to
use as Opacity Maps. If you run the
In general, if you want to create an
operation and decide you want to
Opacity Map, you should use a 32-bit
undo it, you will have to delete the
image.
Library resource and reimport the
To create an Opacity Map using a 32-bit original image.
image:
1. Import a 3D model into Anark Studio To create an Opacity Map using a 24-bit
and drag an instance of it onto the image:
Project window or the Object outline 1. Import a 3D model into Anark Studio
and drag an instance of it onto the

112 Anark Studio User Guide


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

Setting properties for video

Project window or the Object For a complete list of supported video


outline. formats, see “Supported Media Formats”
2. Import the image to be used as the on page 305.
Opacity Map. For some tips on optimizing the file size
3. Right-click on the image resource in and getting the best results from video
the Library and select Make Opacity clips, see “Preparing video clips and
Image from the Context menu. The graphics as image maps” on page 41.
image now has alpha channel data. Video is streamed remotely rather than
To do this, Anark Studio creates a embedded with the file data when it’s
grayscale of the image by taking the imported into Anark Studio. See
average of the red, green and blue “Chapter 8: Working with Streaming
channels for each pixel and uses the Media and Dynamic Images” on
result as both the alpha channel and page 165 for more information.
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 video


Videos serve much the same function as Videos share most of the same properties
images, but instead of encapsulating a as images (except compression settings).
single 2D graphic, they contain a video For a complete description and visual
file that can be streamed by Anark examples of the properties that images
Studio. As with images, any video infor- share with video, see “Setting properties
mation that has been applied to a model for images” on page 104. In addition,
is included with the material informa- videos have the following properties.
tion when the model is imported into
Basic Properties
Anark Studio.
Volume – Adjusts the loudness of the
Videos can only be attached to layers, video’s sound. Range = 0 to 100. Defaults
groups and materials. When a video is to 100, which is 100% of the loudest
attached to a layer or group, it is auto- setting the end user has enabled on his
matically mapped to a newly created or her system.
model (a rectangle primitive) in both the
Loop – Specifies that the video should
Object outline and the Library, and the
continuously loop for the duration of its
original video resource in the Library is
timebar. Defaults to off.
turned into a child object of the new
model’s material.

User Reference 113


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

Chapter 5
Setting Object Properties

Auto Start – Sets whether the video will specified. If no Remote Source is given or
automatically start playing when it first if Connect to Source is not turned on
appears in the Timeline. If Auto Start is (checked) then the model may be
off (unchecked) you can set the video to displayed with a rainbow pattern on it
play based on a scripted behavior. instead of the video. If Connect to
Defaults to on (checked). Source is checked but the connection
fails for some reason, then a transparent
Advanced Properties image is used that makes the object
transparent.

Setting properties for sound


Sound 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
Cue – Specifies a location within the them into the Library palette as
video to begin playing. If Loop is turned resources using the instructions in
on for this video, then this will be the “Importing objects” on page 51.
starting point of the video each time it is For a complete list of supported sound
played. Specified in seconds. formats, see “Supported Media Formats”
on page 305.
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 Sound – Displays the current name of the
of the video file or the fully qualified Sound. For information about renaming
absolute or relative path to it. The rela- objects, see “Renaming objects” on
tive path must be preceded by ./ to indi- page 63.
cate the current directory (or ../ to go up
Basic Properties
one directory level, etc.). See “Under-
Sound Type – Sets whether the sound will
standing paths for streaming media and
be Normal, Polyphonic or Point.
dynamic images” on page 166 for more
information. Normal – A Normal sound is played at
the specified Volume and Balance set-
Connect to Source – Allows you to view
tings.
the video while working in Anark
Studio. The Remote Source must also be

114 Anark Studio User Guide


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

Setting properties for music

Polyphonic – A Polyphonic sound can using the instructions in “Importing


be played multiple times simulta- objects” on page 51.
neously. This feature would most typi- For a complete list of supported music
cally be used with a behavior that calls formats, see “Supported Media Formats”
on the sound based on user actions on page 305.
such as clicking on a button. For exam-
ple, if the user clicked a button several Music is streamed remotely rather than
times in a row, the sound would be embedded with the file data when it’s
played over itself each time. imported into Anark Studio. See
“Chapter 8: Working with Streaming
Volume – Adjusts the loudness of the
Media and Dynamic Images” on
sound. Range = 0 to 100. Defaults to 100, page 165 for more information.
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). Music Name – Displays the current name
Auto Start – Sets whether the sound will of the Music. For information about
automatically start playing when it first renaming objects, see “Renaming
appears in the Timeline. If Play Sound is objects” on page 63.
off (unchecked), you can set the sound
to play based on a scripted behavior. Basic Properties
Defaults to on (checked). Volume – Adjusts the loudness of the
music. Range = 0 to 100. Defaults to 100,
Advanced Properties which is 100% of the loudest setting
enabled on the end user’s system.
Balance – Adjusts the left-to-right
Cue – Specifies a point within the sound balance of the music. Range = -100 (full
to begin playing. This is only valid the left) to 100 (full right). Default = 0.
first time the sound is played, so if the Loop – Sets whether the music will
sound is looping it will play from the continuously loop for the duration of its
beginning after the first time. timebar. Defaults to off (unchecked).
Auto Start – Sets whether the music will
Setting properties for music automatically start playing when it first
Music objects in Anark Studio encapsu- appears in the Timeline. If Auto Start is
late a specific music recording. Digital off (unchecked), you can set the music
music files must first be created in other to play based on a scripted behavior.
applications. You can then import them Defaults to on (checked).
into the Library palette as resources

User Reference 115


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

Chapter 5
Setting Object Properties

Advanced Properties 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-
Cue – Specifies a location within the sents the way colored light (such as that
music to begin playing. This is only valid on computer monitors) is mixed.
the first time the sound is played, so if It also supports the HSL model. They
the sound is looping it will play from the stand for Hue, Saturation, and
beginning after the first time. Luminosity.
Shared Properties 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.
The following properties of music are Saturation controls the strength or
only available for resources in the purity of the color. It represents the
Library. These settings are automatically amount of gray in proportion to the hue.
applied to all instances of the music. If It’s measured as a number from 0
more than one resource of the same (completely gray, no color) to 240 (fully
music file has been imported into the saturated).
Library, then these settings are applied
Luminosity refers to the relative light-
to all of them.
ness or darkness of the color. It runs
Remote Source – Specifies either the URL from 0 (black) to 240 (white).
of the streaming audio file or the fully To change a color property:
qualified absolute or relative path to it. On the Inspector palette, click on the
The relative path must be preceded by ./ color swatch next to the property. A
to indicate the current directory (or ../ to Color chooser will appear. Either select a
go up one directory level, etc.). See color from those available or create your
“Chapter 8: Working with Streaming own.
Media and Dynamic Images” on
page 165 for more information.
Setting properties for
Setting color properties behaviors
Behavior scripts that can be run in Anark
All color properties of objects in Anark
Studio are just XML (Extensible Markup
Studio (such as the background color of
Language) documents with a .bvs exten-
layers and the diffuse, ambient and spec-
sion. Every behavior can have a unique
ular colors of materials) are selected
set of editable properties created for it
using a color chooser. The standard
using scripting and the Edit Custom
Windows color chooser allows you to
Parameters dialog. You can then use the
either select a color from a preset group
or to create a custom color.

116 Anark Studio User Guide


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

Setting properties for components

Inspector palette to edit those properties Lua – Lua is a free, light-weight pro-
just as you would for an object. 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


For information about creating editable
parameters for behaviors, see “Working
components
with custom properties” on page 76. Components, which are based on group
objects, have all of the properties of
The ready-made behaviors available in
regular groups. They also have several
the Anark Studio Behavior Library
special properties. From the compo-
already have editable parameters for you
nent’s parent’s Timeline, a component
to set. For information about using the
object’s regular group properties appear
Anark Studio Behavior Library, see
in the Inspector palette.
“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 Group, Position, Rotation, Scale, Pivot
scripting engine, this should always be and Opacity are the same for compo-
set to the default of JavaScript. nents as they are for regular groups. The
JavaScript – JavaScript is an open, Advanced properties Distance Fade, Fade
cross-platform scripting language for Near and Fade Far are also the same for
the Internet. components. For information about
these properties, see “Setting properties
for groups” on page 95.

User Reference 117


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

Chapter 5
Setting Object Properties

When any of these properties are as fast as normal, etc. A negative value
animated, the keyframes are evaluated in (e.g., -.3, -2, etc.) makes the component’s
the parent Timeline, which would be Timeline run backwards. This setting
either the Scene’s Timeline or, if it’s a does not affect the frame rate of the
nested component, the parent compo- presentation or how often the scene is
nent’s Timeline. updated.
The special component properties Play Initial Play State – Controls whether the
Mode, Playback Speed and Initial Play component will initially play or be
State appear in the Inspector palette only paused. Defaults to Play.
when you’re inside the component. 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
Slide – Displays the name of the current
component.
Slide. For information about renaming
objects, see “Renaming objects” on Ping Pong – Sets the component’s
page 63. Timeline to continuously play forward
and then in reverse for the duration of
Playback Speed – Controls the speed at
the component.
which the component’s Timeline is
executed. This affects the speed of the Ping – Sets the component’s Timeline
animation for all the objects inside the to play forward and back only once.
component, including any animation Play Through – Sets the component to
created by a behavior that uses the play from beginning to end once and
contextTime property. A setting of 2 then continue onto the next slide.
means animated objects will appear to
move twice as fast as normal; a setting of
.5 means they will appear to move half

118 Anark Studio User Guide


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

Chapter 6: Working with


Actions, Slides and
Components
6
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.

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

Chapter 6
Working with Actions, Slides and Components

Understanding actions Creating and deleting actions


An action is simply an instruction for an To set up an action:
object that is triggered by an event. The 1. In the Object outline or the Project
instruction can be to change a property window, select an object.
value, to link to a Web page, to execute a
2. On the Actions tab, click on the New
chunk of code, to load a new slide, etc.
Action button. The new action is
The event can be based on system infor-
added to the end of the list of actions
mation such as when the object is
for the object.
attached to the scene, or it can be based
on user interaction such as pressing a 3. Select a Trigger Object. The Trigger
key or clicking the mouse. Object can be the current object or
any other object available in the pull-
Actions can be applied to any object in
down menu. The Trigger Object will
the scene (including the Scene object).
listen for the event to happen. See
For each action, there is a Trigger Object
“Selecting a Trigger or Target object”
that will wait for an event and a Target
on page 121 for information about
Object that will perform the action.
which objects are available.
When you set up an action, you first
4. Select an Event. Only events that are
choose an object in the Timeline and
valid for the Trigger Object can be
then create an action for it on the
selected. For a description of the
Actions palette. The selected object can
available events, see “Selecting an
be the Trigger, the Target or both; or, it
event” on page 122.
can be neither, acting as a router for the
action between the Trigger and Target 5. Select a Target Object. The Target
objects. The Trigger and Target objects Object will perform the action. It can
can be the same object or completely be the currently selected object or
different objects. 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.

120 Anark Studio User Guide


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

Understanding Action icons

Understanding Action icons 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-
Action icons indicate whether an object or its down. If your presentation has many
children have any actions set for them. components or has more than one slide,
When the icon is blue, it means the action is
on an object on the Master slide. this means that only the following
objects will be available:
= This object has an action.
Š Objects on the master slide and on the
= A child of this object has an action. selected object’s current slide.
= Both this object and one of its children Š If a component is on the current slide,
have an action. then any objects that are on the
= Both this component and an object component’s master slide.
within it have an action.
Š If the action is on an object inside a
= There is an action within this compo- component, then objects that are on
nent. the master slide of the Scene (or the
parent component if it is nested).
Selecting a Trigger or Target
Š If the selected object is on the master
object
slide, then only objects on the master
When you create an action, you start by slide (or on the master slide of any
selecting an object. This object can be master components).
the Target, the Trigger or both, or it can

User Reference 121


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

Chapter 6
Working with Actions, Slides and Components

Specifying paths for Trigger and When a component is exported, any


Target objects references set to Absolute Reference are
When you select a Trigger or Target exported as root-level paths.
object for an action, you have the option When a Playback Module is exported,
of using either an Absolute or Relative any references set to Absolute Reference
Reference to the object. are exported as relative paths.
For information about setting up an
action, see “Creating and deleting
actions” on page 120.

Selecting an event
An 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-
The object selection box lets you use either a in events. In addition, Time Labels
relative or absolute reference to the object. applied to points in the Timeline can be
An Absolute Reference locates the object used as events. For more information
using a direct reference to it. If the object about Time Labels, see .
is moved around in the scene, the Abso- The list of available events is determined
lute Reference will be updated to object’s by the type of object selected as the
new location. Use the absolute path Trigger Object.
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 The event selection box lets you choose from
object like a component with another a list of events that are available for the
Trigger object for an action.
object, or wish to move the action to
another object and have the object that For information about setting up an
the action refers to automatically action, see “Creating and deleting
change. actions” on page 120.

122 Anark Studio User Guide


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

Selecting an event

In addition to the following list of avail- onKeyUp – This event is fired when any
able events, you can write custom events key is released.
for a behavior and expose it to the Anark
Studio interface using the instructions in Loading events
“Working with custom events” on onLoadProgress – This event is fired
page 79. continuously as a Playback Module is
loading. For more information about
Attach events loading Playback Modules, see “Loading
onAttach – This event is fired when the components dynamically” on page 132.
Trigger object is attached to the scene. onLoadError – This event is triggered
Attachment corresponds to the moment when a Playback Module cannot prop-
when the object’s timebar starts. erly load. For more information about
onDetach – This event is fired when loading a Playback Module, see “Loading
when the Trigger object is detached from components dynamically” on page 132.
the scene. Detachment corresponds to onLoadComplete – This event is triggered
the moment when the object’s timebar when a Playback Module has finished
ends. loading. For more information about
loading a Playback Module, see “Loading
Key events
components dynamically” on page 132.
onKeyDown – This event is fired when
any key is pressed.

User Reference 123


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

Chapter 6
Working with Actions, Slides and Components

Mouse events onRightMouseUp – This event is fired


onMouseDown – This event is fired when when the right mouse button is released
the left mouse button is pressed while while over the Trigger object.
over the Trigger object. onRightMouseClick – This event is fired
onMouseUp – This event is fired when when the right mouse button is both
the mouse button is released while over pressed and released while over the
the Trigger object. Trigger object.
onGroupedMouseOver – This event is onMiddleMouseDown – This event is
fired when the mouse moves over the fired when the middle mouse button is
Trigger object exclusively. Unlike the pressed while over the Trigger object.
onMouseOver event, this will not be onMiddleMouseUp – This event is fired
fired if the mouse moves from one child when the middle mouse button is
to another child of the Trigger object. released while over the Trigger object.
For example, if the Trigger object is a
group that contains a number of models, onMiddleMouseClick – This event is fired
if the mouse moves off one of the when the middle mouse button is both
models onto another of the models, pressed and released while over the
onGroupedMouseOver will not be Trigger object.
called.
Time events
onGroupedMouseOut – This event is fired onPlay – This event is triggered when the
when the mouse moves off the Trigger presentation or component begins
object exclusively. This will not be fired playing.
if the mouse moves from one child to
onPause – This event is triggered when
another child of the Trigger object. For
the presentation or component has been
example, if the Trigger object is a group
paused.
that contains a number of models, if the
mouse moves off one of the models onto onLoop – This event is triggered when
another of the models, onGroupedMou- the presentation or component begins
seOut will not be called. another loop of playback.
onMouseClick – This event is fired when
Update events
the mouse button is both pressed and onUpdate – This event is triggered every
released while over the Trigger object. time the scene is refreshed. The scene is
onMouseDblClick – This event is fired updated a maximum of 30 times per
when the mouse button is double- second on fast machines; on slower
clicked while over the Trigger object. machines the refresh rate may be lower.
onMouseWheel – This event is fired when objects or children.
the mouse wheel is turned (spun) while
Media events
over the Trigger object.
onMediaBuffered – This event is fired
onRightMouseDown – This event is fired when the Trigger object, which is either
when the right mouse button is pressed a music or video file, has loaded enough
while over the Trigger object. information to make it ready to play, but
is not yet completed.

124 Anark Studio User Guide


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

Selecting an action

onMediaComplete – This event is fired Selecting an action


when the Trigger object, which is a An object can perform an action itself, it
music or video file, has finished playing.
can tell another object to do something,
onMediaError – This event is fired when or it can tell the system to do something.
the Trigger object, which is either a
The list of available actions is deter-
music or video file, cannot properly
mined by the type of object selected as
load.
the Target Object.
Action Additional parameters Can be applied to
Set Property – Sets a property of the Any object property can be set here. Model
Target object to a specified value. For a complete listing of the available
Group
properties for each object type, see
“Chapter 5: Setting Object Properties” Component
on page 81. Setting the Value Type to Image
From Another Property allows you to Material
dynamically match the specified prop-
Scene
erty of the Target object to the value of
a different object property. For more Behavior
information, see “Dynamically match- Layer
ing a property value using an action” Text
on page 131.
Light/Camera
Video
Music
Sound
Load – Loads a specified Playback Slide - Sets the slide that the loaded Model
Module. The content of the loaded .am file will appear in. If playback exits
Group
.am file will only appear in the spec- the slide and then goes back to it at
ified Slide. some point, the specified section Component
Loading Anark Playback Modules would have to be loaded again in order Image
requires a valid license key. Please to appear. Material
contact your Anark sales representa- URI - The URI (Uniform Resource
Behavior
tive for licensing information. Identifier) for the .am file. URI is the
For information about creating Play- generic term for all types of names and Layer
back Modules, see “Exporting and addresses that refer to objects on the Text
importing components” on page 60. World Wide Web. A URL is one kind of Light/Camera
URI. Relative paths can be used. See
“Loading components dynamically” Video
on page 132 for more information. Music
Do not share buffer data - When Sound
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.

User Reference 125


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

Chapter 6
Working with Actions, Slides and Components

Action Additional parameters Can be applied to


Detach – Detaches the Target object n/a Model
from the scene.
Group
Note: The Scene object cannot Component
be detached. Image
Material
Behavior
Layer
Text
Light/Camera
Video
Music
Sound
Fire Event – Enables any object to Event – Specifies the event to be fired. Model
fire an event based on another
Group
event. This action would typically
be used to fire a custom event on a Component
behavior as part of an action. Image
Material
Scene
Behavior
Layer
Text
Light/Camera
Video
Music
Sound
Alert – Displays a message box con- Description – Sets the text string to be Model
taining the Description text and an displayed when the alert is called.
Group
OK button.
Component
Image
Material
Scene
Behavior
Layer
Text
Light/Camera
Video
Music
Sound

126 Anark Studio User Guide


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

Selecting an action

Action Additional parameters Can be applied to


Output – Sends the Description text Description – Sets the text string to be Model
to the debug console in Windows. displayed in the debug console.
Group
It’s useful when debugging an Anark
Media presentation. To view the Component
output in Windows, you need to Image
run either a development applica- Material
tion or a debugging application
Scene
such as Sysinternals’ DebugView©
freeware (available at http:// Behavior
www.sysinternals.com). 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 Command – Sets the command text Model
way for an Anark Media presenta- string to be passed to the HTML script.
Group
tion to communicate with the Value – Sets the value text string to be
browser. This action is only avail- passed to the HTML script. Component
able on Windows. Image
The specified Command and Value Material
text is passed to the HTML script,
Scene
where the strings must be defined
using the onExternalCommand Behavior
HTML event. Layer
Please note, the internal and the Text
external commands are disabled Light/Camera
unless you possess a valid license
key. Please contact your Anark sales Video
representative for licensing informa- Music
tion. Sound

User Reference 127


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

Chapter 6
Working with Actions, Slides and Components

Action Additional parameters Can be applied to


Navigate – Navigates to the speci- URL – Sets the URL, fully qualified Model
fied URL. You can optionally set path or UNC (Universal Naming Con-
Group
Flags and a Target frame. vention) location of the resource to
display. Component
TargetFrame – Windows only. Speci- Image
fies the name of an HTML frame in Material
which to display the resource or file. If
Scene
the named frame is not currently avail-
able, the document opens in a new Behavior
window. Layer
PostData – Windows only. Specifies Text
data to send to the server during the
Light/Camera
HTTP POST transaction. For example,
the POST transaction is used to send Video
data gathered by an HTML form to a Music
program or script. If this parameter Sound
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.

128 Anark Studio User Guide


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

Selecting an action

Action Additional parameters Can be applied to


Execute Scriptlet – Specifies a small Scriptlet – Clicking on this property Model
snippet of code to be executed. opens a small scripting window that
Group
allows you to enter a brief script.
This can be used to create a simple cus- Component
tomized behavior for an object. For Image
example, the following code, if applied Material
to a rectangle or cube as part of an
Scene
onLoadProgress event, could be used
to create a loading progress bar: Behavior
scale.x = latestEvent.per- Layer
centDone * 3 Text
This action can also be used to modify Light/Camera
an onLoadProgress event. For example, Video
the following code could be used as a Music
Scriptlet to modify a key event so that
the code would only be executed when Sound
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.
Go to Time – Jumps playback to the Pause – Controls whether playback Components
specified Time. should continue or pause.
Scene
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.
Play – Makes the presentation, com- n/a Component
ponent or media file play. It won’t
Scene
have any effect unless the item was
paused. Video
Music
Sound
Pause – Makes the presentation, n/a Component
component or media file pause. It
Scene
won’t have any effect unless the
item was currently playing. Video
Music
Sound

User Reference 129


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

Chapter 6
Working with Actions, Slides and Components

Action Additional parameters Can be applied to


Seek – Repositions a media file Seek Time – Specifies the time in the Video
(video, sound or music) to a speci- media file, in seconds, to which to
Music
fied location and continues playing. seek.
If the media is currently stopped or Sound
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.
Reverse Play – Makes the presenta- n/a Component
tion or component begin playing in
Scene
reverse.
Go to Label – Jumps playback to the Time Label – Selects the Time Label to Component
specified Time Label. Go to Label which to jump playback.
Scene
can only jump to a Time Label in
the current slide. See for more infor-
mation.
Go to Slide – Jumps playback to the Slide – Selects the slide to which to Component
specified slide. jump playback from among the Target
Scene
Scene or component’s slides.
Next Slide – Jumps playback to the n/a Component
next slide.
Scene
Previous Slide – Jumps playback to n/a Component
the previous slide in the presenta-
Scene
tion’s slide list.
Preceding Slide – Jumps playback n/a Component
to the last viewed slide.
Scene

Making actions active and are listed in, you can use copy/paste to
inactive reorder them when needed. Pasted
actions are added to the end of the
The Active toggle ( ) next to each
Actions list.
action allows you to make the action
inactive or to reactivate it. This is partic- While any action can be pasted onto any
ularly useful for controlling whether or object, the action will only be valid
not an action will be active for all under the following circumstances:
instances of an object on the Master Š The Trigger and Target objects must be
slide. See “About Master slides” on active at the same time as the object
page 134 for more information. that now has the action.

Copying and pasting actions Š The path to the Trigger and Target
Actions can be copied or cut from one objects from the current object must
object and then pasted onto another still be valid. See “Specifying paths for
object, or even the same object. Because Trigger and Target objects” on
actions are executed in the order they page 122 for more information.

130 Anark Studio User Guide


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

Dynamically matching a property value using an action

To copy or cut and paste an action: Target object, you can match it to any
1. Select an action in the Actions pal- other vector property (Scale, Position,
ette. Pivot, etc.). Similarly, if you want to set
2. Do one of the following: the Brightness property of a light, you
can match it to any other floating-point
• Copy the action by selecting Edit > property, including Emissive Power or
Copy Action or pressing Ctrl + C. Opacity.
• Cut the action by selecting Edit >
Cut Action or pressing Ctrl + X. Working with time labels
3. Select the object to paste the action A Time Label is a marker for a particular
on. point in time in the presentation. They
4. Do one of the following: can be applied to either the Scene or to a
component object, although they
• Select Edit > Paste Action or press
cannot be added to the Master slide.
Ctrl + V.
Time Labels can be used in actions in
• Right-click in the Actions palette for two ways.
the item in the Object outline and
select Paste Object from the Context Š They can be used as a time marker in a
menu. Go to Label action. During playback,
the specified event will cause the
The pasted action is added to the end of
presentation to jump to the Time
the list of actions for the object.
Label.
Dynamically matching a Š They can be used as an event that
property value using an action executes some other kind of action.
When you create a Set Property action,
you have the option of selecting a Value
Type. The default is to set a specific
To insert a new Time Label:
value, which is appropriate for most situ-
1. Select the Scene or a component in
ations. Under certain circumstances,
however, you may want to use the From the Object outline. To insert a Time
Another Property option. The From Label on a component, you must be
Another Property value allows you to inside the component’s Timeline. For
match the property of the Target object more information, see “How the
to the current value of a different Scene and component Timelines
object’s property. work” on page 138.
2. Move the Playhead to the location
Among other things, this can be used to
dynamically draw values from the on the Timeline where you want to
custom properties of a behavior, to place the Time Label.
synchronize the movement of objects, or 3. In the Time Pane, right-click on the
to quickly align one or more objects Timeline bar for the Scene or compo-
based on user interaction. nent and select Insert Time Label
Only similar property types can be from the Context menu.
selected. For example, if you want to set The Time Label will be added at the
a vector property such as Position for the current location of the Playhead.

User Reference 131


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

Chapter 6
Working with Actions, Slides and Components

To rename a Time Label: Using a Time Label as an event


1. Double-click on the Time Label’s Time Labels can be used as events for
name in the Time pane and enter a actions. When the Playhead reaches the
new name for it. given Time Label during playback, the
2. Press Enter. event is fired and the specified action is
executed.
To edit a Time Label:
Right-click on the Time Label and select Because time labels are applied to the
Edit Time Label from the Context menu. scene, you must select the Scene or the
To delete a Time Label:
component as the Trigger object.
Right-click on the Time Label and select To set up a Time Label event for an
Delete from the Context menu. action:
1. Select an object in the Object outline.
Creating a Go to Label action 2. On the Actions tab, click on the New
The Go to Label action is only available Action button.
when the Scene object or a component
3. Select the Scene or component in the
has been selected as the Target object.
Object outline as the Trigger Object.
Any available object can be used as the
If you are setting up a Time Label
Trigger object. For more information
event for a component, you must be
about setting up Time Labels, see
inside the component Timeline.
“Working with time labels” on page 131.
4. From the Event pull-down menu,
To set up a Go to Label action:
select a time label from the Time
1. Select an object in the Object outline.
Labels folder.
2. On the Actions tab, click on the New
5. Select a Target Object.
Action button.
6. Specify the action to be performed.
3. Select a Trigger Object that will listen
Most actions have additional param-
for an event.
eters that you will need to set. For a
4. Select an Event. For a description of description of the available actions,
the available events, see “Selecting an see “Selecting an action” on
event” on page 122. page 125.
5. Select the Scene or a component as
the Target Object. If you are setting Loading components
up a Go to Label action for a compo- dynamically
nent, you must be inside the compo- Components that have been exported as
nent Timeline. Playback Modules can be dynamically
6. From the Actions pull-down menu, loaded using the Load action. This
select Go to Label. enables you to create small, modular
presentations that open quickly. You
7. Select a Time Label. You can option-
can then load only the objects that are
ally set the Scene or component to
needed for a particular slide.
pause.
Note: Loading Anark Playback Mod-
ules requires a valid license key.
Please contact your Anark sales rep-

132 Anark Studio User Guide


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

Understanding slides

resentative for licensing informa- and addresses that refer to objects on


tion. the World Wide Web. A URL is one
kind of URI. Relative paths can be
The parent object to which the Playback
used.
Module is attached determines several
important features of the Playback
Module:
Understanding slides
Š 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. Slides are used to encapsulate segments
of a presentation. The Scene object and
To set up a Load action:
components have an associated list of
1. Select an object in the Object outline.
slides displayed in the Slide palette.
2. On the Actions tab, click on the New
Slides provide the clock that controls the
Action button.
timing of actions for the objects in the
3. Select a Trigger Object that will listen scene or component. This clock is repre-
for an event. sented by the Timeline. Each time a new
4. Select an Event. For a description of frame is generated, the objects in the
the available events, see “Selecting an scene or component ask the clock “what
event” on page 122. time is it?” and then determine what
state they need to be in based in part on
5. Select a Target Object. This is the that information.
object to which you want the loaded
component attached. Typically, com- When a new slide is loaded, it has a
ponents would be attached to either different Timeline. It may contain a
a layer or to other models, although completely different set of objects, or it
they can also be attached to cameras, may contain some or all of the same
lights and sounds. objects that were in the last slide. Even if
the objects are the same, they may have
6. From the Action pull-down menu, a completely different way of behaving
select Load. because they now have a different
7. Specify a URI (Uniform Resource Timeline.
Identifier) for the .am file. URI is the The Timeline and Project window only
generic term for all types of names display the content of the currently

User Reference 133


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

Chapter 6
Working with Actions, Slides and Components

active slide. When you add objects by Rearranging slides


dragging them onto either the Project The order of slides in the Slide list deter-
window or the Timeline, they are added mines which slide is displayed when the
to the currently active slide. If you are presentation begins playing and which
working on the Master slide, the object slide is displayed when using a Next
is added to all the slides in the project, as Slide or Previous Slide action.
well.
To rearrange slides:
To move from slide to slide during play- Click and drag a slide to the desired loca-
back, you must either set up an action tion on the Slide tab.
using one of the Slides actions (Activate,
Next, Previous or Preceding) or set the Duplicating slides
scene or component’s Play Mode to Play In order to copy a slide and all of its
Through. For information about setting contents, you simply duplicate it.
the Play Mode for the scene or compo- To duplicate a slide:
nent, see “Setting properties for the 1. Select a slide.
scene or slide” on page 83.
2. Right-click and choose Duplicate
The duration of each slide can be as long Slide from the Context menu.
or as short as you want it to be. Each
slide’s duration is determined based on The new slide will be placed immedi-
the length of the timebars of the objects ately after the original slide. You can
that are in it. then rearrange the slide wherever you
like using the instructions in “Rear-
Adding slides ranging slides” on page 134.
When a project is first created, only one
slide appears on the Slide tab. You can About Master slides
create an unlimited number of slides. The Master slide lets you share objects
When you create a new slide by adding and properties across all associated
one, it contains all of the objects, slides. It’s particularly useful for objects
properties, animation and actions that like streaming music or video that you
are on the Master slide. See “About want to continuously play between
Master slides” on page 134 for more slides, and for objects used to navigate
information. between slides.
To add a new slide: When an object is on the Master slide,
Right-click on any slide and select Add by default all of its properties and
Slide from the Context menu. animation keyframes are linked to the
instances of the object in the regular
Deleting slides slides. Object properties that are linked
Because only one slide can be selected at across slides appear in blue. You can
a time, you can delete only one slide at a unlink any properties that need to func-
time. tion independently.
To delete a slide: While you must edit the Master slide in
Right-click on a slide and select Delete order to add objects to it, once an object
Slide from the Context menu. is on the Master slide, you can edit it on

134 Anark Studio User Guide


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

Accessing and exiting the Master slide

any other slide and the changes are To exit the Master slide:
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 Click on the Leave Master button on the
slides as you want, but there can only be Slide tab. The most recently viewed slide
one Master slide for each component or will be active and its contents will be
for the Scene object. displayed in the Timeline and Project
window.
The Master slide starts off with a default
layer, camera and light. When you want
an object to appear on all or most slides, Linking and unlinking
or when you want to share an object’s properties
properties across slides, you should add By default, the properties of an object on
it to the Master slide. You can deactivate the Master Slide are linked to the
the object on any slide on which you instances of that object on all slides in
don’t want it to appear using the instruc- the project. Animation keyframes for
tions in “Using the Active toggle and objects on the Master Slide are also
button” on page 64. linked across all instances. Changes to
one instance of the same object are
Accessing and exiting the Master made simultaneously to the other
slide instances in other slides.
In order to add objects or otherwise edit If you want a property on an object on
the Master slide, you must open it for the Master Slide to function indepen-
editing. dently, you need to manually unlink it
To access the Master slide: using the Inspector. You can re-link it
later.
There are several properties of objects
that are never linked.

Click on the Edit Master button on the Š The length of an object’s timebar.
Slide tab. Only the contents of the Š The state of its Active toggle.
Master slide will appear in the Timeline
and Project window. Š 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.

User Reference 135


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

Chapter 6
Working with Actions, Slides and Components

For more information about working and actions are copied to the slide as
with objects and properties on the well. There is one exception to this rule,
Master Slide, see “Understanding slides” however. If an object that is on the
on page 133. 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 properties are linked, they appear in


blue. Unlinked properties are in black.
To unlink a property:
1. Select the object using the instruc- When copying an object to the Master slide,
tions in “Selecting objects” on only “master” objects are copied. For exam-
page 61. ple, the Cone object is not on the Master
slide and is therefore not copied on either
2. In the Inspector, right-click on the the Master slide or on a regular slide.
object property you want to unlink
See “About Master slides” on page 134
and select Unlink Property from Mas-
for more information.
ter Slide from the Context menu.
To link a property across slides: How objects are attached
1. Select the object using the instruc-
between slides
tions in “Selecting objects” on While objects that are not on the Master
page 61. slide can be attached to objects that are,
2. In the Inspector, right-click on the the reverse is not true. In order to main-
object property you want to link and tain the object hierarchy between slides,
select Link Property to Master Slide an object on the Master slide cannot be
from the Context menu. attached to an object that is not on the
Master slide.
How objects are copied between
slides Using components
Copying and duplicating objects only Components are encapsulated time-
affects the current slide. For example, if independent objects. They can be
an object that happens to be on the thought of as miniature scenes within a
Master slide is copied to a regular slide, it scene. Components simplify the process
will only be copied to the regular slide. of creating repetitive animation and
When an object is copied between slides, interactive objects, such as buttons and
all of its children, properties, animation

136 Anark Studio User Guide


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

Using components

menu systems, and make them easy to The Butterfly component contains the wings
reuse and share. and body. The flapping of the wings has
been animated in the component’s local
Components provide a group of one or time and can be looped continuously.
more objects with an independent clock
An example of using a component to
(or multiple clocks if new slides are
easily create repetitive animation is a
added), allowing them to operate in
butterfly fluttering around on the
more than one Timeline at the same
screen. You could create a group that
time. When an object is made into a
contained a model of a butterfly and set
component, the Component object still
a couple of keyframes for the wings to
has a timebar in the current Timeline.
animate them flapping. If you then
The objects that belong to the compo-
make the butterfly group into a compo-
nent have their own timebars that exist
nent and set the component’s Play Mode
in the component’s independent Time-
to Loop, the wings will continuously
line, which can be accessed by going
flap. In the Scene’s Timeline, you could
inside the component.
then animate the component group
Components can be nested inside other moving around in the scene. When the
components. Because components func- presentation is previewed, the butterfly
tion just like miniature scenes, they have will flap its wings as it flutters around
one or more associated slides. 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.

User Reference 137


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

Chapter 6
Working with Actions, Slides and Components

Anark Media Component (.amc) files How the Scene and


can be imported into a project using the component Timelines work
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 The Scene’s Timeline (top) and the compo-
Context menu. nent’s Timeline (bottom).

The object and any attached children are The Scene’s Timeline displays all the
now encapsulated within the compo- objects that are attached to the scene
nent group and are automatically placed and its children. While it shows the
on the Master slide inside the Compo- timebars of components, it does not
nent’s Timeline. display the timebars of the objects that
are inside a component. Each Compo-
Note: Only music and sound objects nent object’s Timeline displays the time-
that are not attached directly to the bars of the objects inside that
Scene object can be turned into component.
Components. The currently active Timeline deter-
To edit a component, do one of the mines what objects are visible, what new
following: objects will be added or attached to,
Š Double-click on the component in the what can be selected and what anima-
Object outline. tion will be viewable in the Project
window.
Š Right-click on the component in the
Object outline and select Edit Compo- Š Only the objects belonging to the
nent from the Context menu. active Timeline can be selected, even
though other objects in other Time-
To exit a component:
lines may be visible in the Project
Click on the icon of the Scene or desired
window.
Component or Scene in the Bread-
crumbs bar. Š In the Scene or parent Timeline, a
component object as a whole can be
selected, but not the individual objects
within it.

138 Anark Studio User Guide


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

Playback in different Timelines

Š When you go into a different Timeline, includes its duration, its property
the current location of the Playhead settings, and any associated actions and
determines what objects in other Time- animation. The butterfly component
lines will be visible in the Project might contain two slides: flapping and
window. For example, if the Playhead resting.
is currently at 4 seconds, but several Components can be nested inside other
objects in the Scene Timeline don’t components, making Timelines hierar-
begin their duration until 5 seconds, chical. In addition, multiple slides mean
those objects will not be visible in the that Timelines can also operate in
Project window when you go into the parallel, making them branched. As you
Component Timeline. create components and slides in Anark
Studio, the Breadcrumbs bar indicates
Playback in different Timelines your current location among the
Š When you play a project using the Play different Timelines and helps you navi-
button ( ), the animation from the gate through them. The current slide is
active slide will be executed, but not shown in parentheses.
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.
The Breadcrumbs bar lets you navigate out
Š When you preview using the F12 key, of components. The Table of Contents com-
all the animation from the active slide ponent contains two slides, Active and Inac-
will be executed, including any tive, and the Open-Close Button component
components. contains two slides, Over and Idle.

Understanding the duration of


Working with slides,
components
components and breadcrumbs Because components are encapsulated
Both slides and components provide “mini-scenes,” their duration is deter-
Timelines for objects, but it’s important mined a little differently than that of the
to understand the distinctions between other objects in the scene.
them.
A component has a timebar in the
Components allow objects to exist in Scene’s Timeline (or its parent’s Timeline
more than one Timeline at the same if it’s a nested component). This timebar
time. Using the example of a butterfly, determines when the component is
the wings can continuously flap in the active within its parent’s Timeline, just
component time context while the as it does for any other object.
butterfly as a whole moves around the
screen in the parent time context. However, the component object does
not have a timebar in the Component
Inside each component, there is at least Timeline. The timebars of the objects
one slide. Slides encapsulate a set of inside the component determine how
states for the objects in either the Scene long the component actually lasts.
or a component. The state of an object

User Reference 139


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

Chapter 6
Working with Actions, Slides and Components

Specifically, the component begins at 0 them so that they are inside the compo-
seconds and lasts until the end of the nent. This means that you cannot move
timebar at the latest point on the time an object that is already in the Object
measure. 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.
The Butterfly component is active in the 2. Select an item in the Library or Stor-
scene for 4 seconds (top) while the content age palette or in a Windows Explorer
of the component lasts for one second (bot- window.
tom).
3. Do one of the following:
This seems fairly simple until you
consider that components are often used • Drag it onto the bar of the Compo-
to create interactive elements like menu nent or an object inside the Compo-
systems and could conceivably have a nent.
longer duration than the presentation • Drag it onto the Project window. It
itself. A component that is longer than will be attached to the Component
the main presentation’s duration will be object.
cut off at the end of the main presenta-
tion, unless the Scene’s Timeline has Copying objects in components
been paused or it has been looped. Copying objects inside a component
works much like copying other objects
Adding and attaching objects to in the project. You can duplicate them
components using key commands and menu options,
There is a difference between attaching and by holding down the Ctrl or
an object to a component and adding an Command key and dragging them, as
object so that it will share the compo- explained in “Copying and duplicating
nent’s unique Timeline. The Timeline objects in the project” on page 58.
you are currently in controls which of Objects can also be copied from the
these operations is done. Scene’s Timeline or the parent Timeline
into a component and vice versa.
When working in the Scene’s Timeline,
you can only attach objects to the
component object; you cannot add

140 Anark Studio User Guide


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

Copying objects in components

User Reference 141


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

Chapter 6
Working with Actions, Slides and Components

142 Anark Studio User Guide


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

Copying objects in components

User Reference 143


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

Chapter 6
Working with Actions, Slides and Components

144 Anark Studio User Guide


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

Chapter 7: Animating Objects 7

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.

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

Chapter 7
Animating Objects

Animation is created by setting different tion of the Playhead and the property is
values for a property at different points added to the Object outline.
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- Turning on the Animation toggle for a prop-
tion effects. erty adds the property to the Object outline
and sets a keyframe.
Note: Behavior scripts that operate You can turn on the toggle for a single
on a property that has been ani- property at a time or for all of an object’s
mated using keyframes may override properties at once by turning on the
those animation settings. See “How Master Animation toggle.
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-

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

146 Anark Studio User Guide


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

Overview of the Time pane

changes made to its value affect only the the amount of the Time measure visible
default (i.e., static) settings of the object. in the palette.
Because you can change the scale of the
Tip: The Master Animation toggle for Timeline to display just a short section
an object can be used together with of a presentation, the entire presenta-
the autokeyframing features to tion, or anything in between, the tick
quickly enable animation and then marks on the Time measure can repre-
set keyframes for all of an object’s sent less than a hundredth of a second
properties as you make changes. For up to a whole minute or more.
information about autokeyframing,
To expand or contract the Time measure:
see “Autokeyframing” on page 154.
Do one of the following:
Overview of the Time pane Š 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.

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
The scalable scroll bar on the Timeline
also controls where keyframes are allows you to zoom in or out to control how
inserted. much of the presentation is currently in
view.
Scaling the Timeline To return to the default display of the
The Timeline features a scalable scroll Time measure:
bar that allows you to expand or shrink Double-click on the scalable scroll bar.

User Reference 147


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

Chapter 7
Animating Objects

Using the timebar To change the color of a timebar:


1. Do one of the following:
All objects and behaviors (with the
exception of the scene and materials) • Right-click on the timebar and select
have a timebar that controls their start Change Timebar Color from the
time and end time in the project. The Context menu.
timebar can be moved and resized to • Select Timeline > Change Timebar
change the duration, start time and end Color.
time of the object or behavior. 2. Select the desired color from the
To help you sort and keep track of Color window or press the Define
different objects, the color of each Custom Colors button to create your
timebar can be changed and comment own colors.
text can be added. You can also display 3. Click OK.
or hide start and end handles for
timebars. To insert or edit comment text:
1. Right-click on the timebar and select
To select a timebar: Edit Comment Text from the Con-
Click on the timebar. Selecting a timebar text menu. The cursor will move to
selects the object as well. the comment area of the timebar.
To move a timebar:
2. Enter the desired text.
Click on the timebar to select it and drag
the bar to the desired location in the 3. Press Enter or click outside the time-
Time pane. Holding down the Shift key bar.
as you drag enables snapping. The edges
of the timebar will snap to the edges of Resizing timebars
other timebars and to the Playhead, but When you resize a timebar, you are
not to keyframes. changing the duration of the object or
behavior in the scene.
To display or hide timebar handles:
1. Select any timebar. The end of the timebar of the last layer
in the scene will set the duration of the
2. Right-click and select either Show
final project. See “Duration of the
Timebar Handles or Hide Timebar
project” on page 59 for more
Handles from the context menu.
information.
Parent objects control several aspects of
the duration of their children.

Timebars with start and end handles dis- Š With the exception of layers, sounds
played (top) and hidden (bottom). 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

148 Anark Studio User Guide


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

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 A parent object with the same end time as
grayed out where the parent object’s its child objects (top); a parent object with a
shortened end time that affects its child
timebar ends. The child’s duration in objects (bottom).
the scene will be shortened according
to its parent object. 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.

User Reference 149


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

Chapter 7
Animating Objects

To resize a timebar using the keyboard: Working with cameras and the
Press [ to move the start of a selected timebar
object’s timebar to the current location Only one camera can be active for a
of the Playhead. All of the object’s chil- layer at a given time. This means that if
dren will move along with it, with two there is more than one camera for a
exceptions: layer, their timebars should not overlap.
Š The timebars of locked objects are not If there is some overlap between time-
moved. bars, Anark Studio arbitrarily decides
which one is active.
Š The timebars of objects inside compo-
nents are not moved.
Pressing Ctrl + [ will move the timebar of
the selected object without affecting its Only one camera can be active for a layer at
children. a given time, so the timebars for cameras
should not overlap.
Press ] to move the end of a selected
object’s timebar (and all of its children’s) In this example, the order for the active
to the current location of the Playhead. cameras is:
The same two exceptions noted above
1. Zoom
still apply.
2. Fog
Pressing Ctrl + ] will move the end of the
selected object’s timebar alone., 3. Normal

Note: When working on large Using the Playhead


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- A. Playhead handle
tious when changing the duration B. Playhead line
of behaviors. Because the instruc- The Playhead marks the current time in
tions contained within a behavior the Project window, acts as the starting
are only executed during the behav- point for playback mode and controls
ior’s duration, shortening a behav- the placement of keyframes.
ior’s duration could create
unexpected results. For example, if a Dragging the Playhead is one way of
behavior that makes a model glow previewing the animation, as explained
during mouseovers is attached to a in “Scrubbing with the Playhead” on
model, and you shorten the behav- page 160. It also may affect the duration
ior’s timebar but not the model’s, of objects that are added to the project.
then the model will stop glowing See “How the Ctrl key affects adding
during mouseovers as soon as the objects” on page 54 for more
behavior’s duration is over. information.

150 Anark Studio User Guide


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

Using the Playhead

To move the Playhead, do one of the to snap to every tick mark.


following:
Š Click and drag the Playhead handle to Š Hold down the Shift key (Shift + < and
the desired location on the time Shift + >) to snap the Playhead to the
measure. nearest tall tick mark.
To move the Playhead without updating
Š Click on the location on the time the scene:
measure where you want the Playhead Hold down the Ctrl key while dragging
to reside. The Playhead will jump to the Playhead to the desired location on
that location. the time measure. The scene is not
To move the Playhead using snapping: updated when the Playhead is moved
Hold down the Shift key while dragging this way, meaning no keyframes are
the Playhead to the desired location on evaluated and objects are neither
the time measure. The Playhead will attached nor detached from the scene.
snap to either the keyframe or the
handle of a timebar that is closest to it in Tip: This feature is particularly useful
the Time pane. If the Timeline Snapping when you are animating a scene. If
Grid is enabled in the Application Prefer- you made changes to an object but
ences, the Playhead will also snap to the forgot to move the Playhead to a
tick marks on the time measure. new location on the time measure,
You can also snap the Playhead to the just hold down Ctrl and drag the
tick marks without dragging with the Playhead to the location you want.
You can then set keyframes at the
mouse.
new location by pressing F6.
Š Use the period (.) and comma (,) keys

User Reference 151


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

Chapter 7
Animating Objects

Using keyframes Property keyframes control the actual


There are two types of keyframes in data of an object property such as
Anark Studio: property keyframes and opacity or position.
master keyframes. 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.
Master keyframes are just handles that
give you easy access to the property Anark Studio uses time-based animation
keyframes that have been set for an rather than frame-based animation to
object. Unlike property keyframes, they ensure accurate timing of time-sensitive
don’t control any actual values. Master content such as video and music.
keyframes appear on the timebars of all
animated objects except for the Scene Setting keyframes
and materials, which don’t have time- The value of the first property keyframe
bars; for these objects, master keyframes set for an object will override any
appear on their Object bars instead. previous settings. Keyframes can be set
for an object both before and after its
Master keyframes have the following
duration (i.e., outside the bounds of its
features: timebar). Anark Studio will interpolate
Š When you select a master keyframe, all between the keyframe before the object’s
the keyframes for the object that reside start handle and the first keyframe on or
at that moment in time will be after it, so that the object begins its dura-
selected. tion in the middle of the interpolation.
Likewise, it will interpolate between the
Š When you drag a master keyframe, all last keyframe on the timebar and the
the keyframes for the object that reside first keyframe after it. The only excep-
at that moment in time will move tion is for components.
along with it.
If there are no keyframes set outside an
Š Deleting a master keyframe on the object’s timebar, then the object will
timebar or Object bar deletes all the begin its duration at the value of the first
keyframes for the object at that keyframe and will end its duration at the
moment in time. value of the last keyframe.
Š When you drag a standard keyframe to For information about setting default
a new location in time, a new master values for objects, see “Chapter 5:
keyframe will be created for it on the Setting Object Properties” on page 81.
timebar. For information about components, see
“Using components” on page 136. For
Š You can set the interpolation for all information about interpolation, see
the keyframes represented by a master
“Controlling keyframe interpolation” on
keyframe using the Set Keyframe Inter-
page 157.
polation dialog.

152 Anark Studio User Guide


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

Setting keyframes

To insert the first keyframe for an object: To insert subsequent keyframes:


1. Move the Playhead to the desired 1. Move the Playhead to the desired
location on the time measure. location in the time measure.
2. Select an object in the Timeline tab. 2. Select an object in the Timeline tab.
3. Edit the desired property using the 3. Edit the desired property using the
Inspector palette. If editing position, Inspector palette. If editing position,
rotation or scale, you can also drag rotation or scale, you can also drag
the object to the desired setting in the object to the desired setting in
the Project window. the Project window.
4. Do one of the following: 4. Do one of the following:
• Turn on the Master Animation • To insert keyframes for a single
toggle for the instance of the object, property, right-click on the Prop-
which will automatically turn on erty bar in the Time pane and select
the toggle for all the object’s Insert Keyframe from the Context
properties. menu.
• If you only want to animate a • To insert keyframes for all of an
couple of properties, select the prop- object’s properties that have the
erties in the Timeline tab and turn Animation toggle turned on, right-
on their Animation toggles. click on the object’s timebar in the
A keyframe will automatically be added Time pane and select Insert
at the location of the Playhead. Keyframe from the Context menu.

User Reference 153


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

Chapter 7
Animating Objects

Autokeyframing cisely on top of an existing keyframe


There are two ways to automatically set and setting a new value for a prop-
keyframes for more than one property at erty. Hold down the Shift key while
a time. One way is to deliberately set dragging the Playhead to snap it to
keyframes for all properties that have the keyframe.
been changed using a key command or
If you don’t move the Playhead but you
menu option. The other way is to turn
do change object properties and set new
on autokeyframing so that every time
keyframes, the new keyframes will be
the Playhead is moved and an object
written over any existing keyframes.
property is subsequently changed,
keyframes are set. Keyframes are auto- To manually set keyframes for changed
properties:
matically set for every property that had
1. Move the Playhead to the desired
changes made to it. Only the currently
location in the time measure.
selected object will have keyframes set
for it (i.e., its children will not). 2. Select an object in the Timeline tab.
To automatically set keyframes for 3. Make sure the Animation toggle has
changed properties: been turned on for any property you
1. Enable autosetting keyframes by want to set keyframes for.
doing one of the following:
4. Edit the desired properties using the
• Click on the Autoset Keyframes Inspector palette. If editing position,
button ( ) on the toolbar. rotation or scale, you can also drag
the object to the desired setting in
• Choose Timeline > Autoset
the Project window.
Keyframes.
• Press K. 5. Do one of the following:

2. Make sure the Animation toggle has • Press F6.


been turned on for all properties you • Select Timeline > Set Changed
want to set keyframes for. Keyframes.
3. Move the Playhead to the desired If you don’t move the Playhead but you
location in the time measure. do change object properties and set new
keyframes, the new keyframes will be
4. Edit the desired properties using the
written over any existing keyframes.
Inspector palette. If editing position,
rotation or scale, you can also drag To override an existing keyframe:
the object to the desired setting in You can easily override an existing
the Project window. When the keyframe with a new one. Move the
mouse button is released or Enter is Playhead to the location of the
pressed, the change is committed keyframe(s) you want to override, edit
and the keyframe is added. the properties you want to change in the
Inspector (or in the Project window
Tip: If Autoset Keyframes is on, you using a Transform tool) and set a new
can quickly override existing key- keyframe using any method described
frames by moving the Playhead pre- above.

154 Anark Studio User Guide


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

Selecting keyframes

Selecting keyframes Š Press Delete or Backspace.


To select a keyframe:
Š Choose Timeline > Delete Selected
Click on the keyframe icon in the Time
Keyframes.
pane. Selected keyframes are darkened.
Deleting a master keyframe on the
To select multiple keyframes:
timebar or Object bar deletes all the
Do one of the following:
keyframes for the object at that moment
Š Click and drag a selection box around in time.
the keyframes you want to select. To delete all of a property’s keyframes,
whether they are selected or not:
Š Press Ctrl as you click on the
Right-click on the Property bar in the
keyframes.
Time pane and select Delete All Channel
To select all keyframes for an object or Keyframe(s) from the Context menu.
property:
Press Shift and click on the Property or
Turning keyframes on and off
Object bar in the Object outline.
To deactivate a property’s keyframes:
Deleting keyframes Turn the Animation toggle off for a
property that has keyframes set. The
To delete a keyframe:
keyframes will no longer be visible or
Select a keyframe (or keyframes) and do
active, but the keyframe information is
one of the following:
saved until you close Anark Studio.
Š Right-click on the keyframe or on the To reactivate a property’s keyframes:
Object or Property bar in the Time Turn the Animation toggle on for a
pane and select Delete Selected property that has inactive keyframes.
Keyframe(s) from the Context menu. The keyframes will be visible and active
again.

User Reference 155


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

Chapter 7
Animating Objects

Moving keyframes Copying and pasting keyframes


Keyframes can be dragged along the Keyframes contain information about
Timeline in order to change the timing both the property they control (e.g.,
of their animated properties. Keyframes Diffuse Color, Pivot Point, U Position,
can only be dragged within their current etc.). This “self knowledge” provides you
row. with a couple of options for copying and
For very precise control of keyframe pasting keyframes.
times, a dialog is also available to edit Š Keyframes can be copied and pasted
the time for individual keyframes down into different places within the same
to the millisecond. property.
To move a keyframe:
Š Keyframes can be copied from one
1. Select the keyframe(s).
object’s property to another object’s
2. Click and drag the selected key- corresponding property. For example,
frame(s) to the desired position. a keyframe for a material’s Diffuse
To move keyframes using snapping: Color could be pasted into the Diffuse
Hold down the Shift key while dragging Color for a light.
the keyframe(s) to the desired location This flexibility allows you to set
on the time measure. If you are moving keyframe data for a single object and
multiple keyframes, then the keyframe then use it for several other objects.
that you clicked on for dragging will be However, keyframes from more than one
the “snap to” keyframe. The keyframe(s) object cannot be copied at one time.
will snap to the nearest element from
To copy and paste keyframes:
among the following:
1. Select the desired keyframe(s). A sin-
Š A keyframe not in the same row as the gle keyframe or multiple keyframes
“snap to” keyframe. from multiple properties can be
selected, but only one object’s key-
Š The handles of a timebar. frames can be copied at a time. If key-
Š The Playhead. frames from more than one object
are selected, the copy operation will
Š The ticks on the Time measure (if fail.
Timeline Snapping Grid is enabled in
2. Do one of the following:
the Application Preferences.
To edit a keyframe’s time: • Choose Edit > Copy.
1. Double-click on a keyframe. Even if • Press Ctrl + C.
more than one keyframe is selected, • Right-click on the Object or Prop-
only the keyframe that is double- erty bar and select Copy Selected
clicked on will be edited. Keyframe(s) from the Context
2. In the Set Keyframe Time dialog, menu.
enter the desired time and click OK. This copies the selected keyframe(s)
to the clipboard.
3. Position the Playhead in the desired
location.

156 Anark Studio User Guide


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

Controlling keyframe interpolation

4. Select the desired object. The copy different keyframes for a property, and
operation will be successful only if you can even mix linear interpolation
the object has a corresponding with smooth interpolation on a single
property. keyframe.
5. Do one of the following: Each time a keyframe is added, Anark
• Choose Edit > Paste. Studio creates it with a default interpola-
tion of either linear or smooth. You can
• Press Ctrl + V. then adjust the Ease In and Ease Out
• Right-click and select Paste values for individual keyframes if you
Keyframe(s) from the Context need to.
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
interpolation
There 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 Animation using Smooth interpolation (top)
eases into and out of the keyframes, while
because it uses two additional control animation using Linear interpolation (bot-
values (Ease In and Ease Out) to create a tom) changes uniformly between keyframes.
nonlinear curve that produces a nonuni-
To specify whether the default setting for
form rate of change between the keyframes will be linear or smooth:
keyframes. This can be used to create 1. Choose Edit > Application Prefer-
smoother animation effects for spatial ences (Ctrl + P).The Preferences dia-
properties, and gradual starts and stops log will open.
for any property.
2. Set the desired Default Interpolation
You can mix linear interpolation with value and click OK.
smooth interpolation among the

User Reference 157


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

Chapter 7
Animating Objects

The interpolation of any existing Ease In – Controls how slowly the object
keyframes will not be changed; however, decelerates from the value of the
the interpolation of any new keyframes previous keyframe toward the value of
will be set to this value. this keyframe. If Ease In is set to a high
To set the interpolation for a keyframe value, the change will be more gradual
(or multiple keyframes): (hence the term “Ease In”). If Ease In is
1. Select the keyframe(s). set to a low value, the change will be
fairly rapid. A value of 0 makes this
2. Do one of the following:
portion of the keyframe linear, meaning
• Right-click on a selected keyframe there will be a completely uniform rate
and select Set Interpolation from the of change.
Context menu.
Any Ease In setting for the first keyframe
• Select Timeline > Set Interpolation. for a property is ignored because there is
The Keyframe Interpolator dialog no previous keyframe value to work
box will open. 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
3. Set the desired values and click OK.
Out is set to a high value, the change
Properly controlling keyframe interpola- will be more gradual. If Ease Out is set to
tion requires an understanding of how a low value, the change will be fairly
the different values affect the “change rapid. A value of 0 makes this portion of
curve.” the keyframe linear, meaning there will
be a completely uniform rate of change.
Tip: One of the best ways to gain an Any Ease Out setting for the final
understanding of the range of inter- keyframe for a property is ignored, since
polation settings is to try different the value of the next keyframe must be
combinations of them for both a known in order to create the change. An
spatial property (such as position) object property remains at the value of
and a nonspatial property (such as the final keyframe for the rest of the
opacity) on an object in Anark Stu- duration of the object.
dio.

158 Anark Studio User Guide


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

Playing back a presentation

Playing back a presentation when the object exited the previous


There are several ways to play back a slide.
presentation. Dynamic keyframes are useful for
Š To see just the animation of a scene smoothly animating an unlinked prop-
erty between slides because no matter
(without executing behaviors), you use
what the property value is for the object
the Playback controls or scrub with the
when it leaves one slide, a dynamic
Playhead. This displays animation for
keyframe at the beginning of the next
the current slide, but not for any
slide ensures that the object’s animation
components, because they have a sepa-
will pick up exactly where it left off. For
rate Timeline.
the same reason, dynamic keyframes are
Š To see the execution of all the also useful for slide-to-slide animation of
elements in a presentation, including unlinked properties for objects that have
behaviors, actions and animation of behaviors applied to them that allow for
components, you have to preview the user interaction, such as Draggable.
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
Dynamic keyframes appear in green.
set up some actions to navigate
through the slides. To set a dynamic keyframe:
1. Select one or more static keyframes
For more information about setting up
using the instructions in “Selecting
actions, see “Creating and deleting
actions” on page 120. For more informa- keyframes” on page 155.
tion about previewing a project, see 2. Right-click and select Make Key-
“Previewing a presentation” on frames Dynamic from the Context
page 174. menu.
To make a dynamic keyframe static:
Using dynamic keyframes 1. Select one or more dynamic key-
Dynamic keyframes enable you to create frames using the instructions in
dynamic animation effects. Regular, “Selecting keyframes” on page 155.
static keyframes have a set value, but 2. Right-click and select Make Key-
dynamic keyframes have a dynamically frames Dynamic from the Context
calculated value. Specifically, they are menu.
always set to the value of the property

User Reference 159


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

Chapter 7
Animating Objects

How dynamic keyframes are Playback controls


executed Rewind – Rewinds the Playhead to the
When dynamic keyframes are played beginning of the project and, if currently
back inside Anark Studio, their dynamic set to Play, continues playing.
property isn’t evident. They are executed
Stop – Stops playback at the current loca-
with the value of the original static
tion of the Playhead.
keyframe. In order to see the dynamic
execution of a keyframe you must Play – Begins playback at the current
preview it. In addition, the presentation location of the Playhead. Holding down
must meet the following criteria: the Space bar also begins playback at the
current location. Releasing the Space bar
Š Because only objects on the Master stops playback and returns the Playhead
slide are persistent between slides, the to the previous location. Pressing the
animated object must be on the Master Enter key also begins playback from the
slide and the keyframed property must current location; pressing it again stops
be unlinked (otherwise the keyframes playback and leaves the Playhead at the
in each slide would be identical). For new location.
information about unlinking proper-
ties, see “Linking and unlinking prop- Loop – Enables looping mode for play-
erties” on page 135. back so that at the end of the presenta-
tion, the Playhead will jump back to the
Š There must be more than one slide. For beginning and continue playback mode.
more information about setting up
slides, see “Understanding slides” on Scrubbing with the Playhead
page 133. Dragging the Playhead along the time
Š There must be a way to jump from one measure is called scrubbing. Scrubbing
slide to another. This is done by allows you to preview any keyframed
creating an action that uses Go to animation in the current Slide, but it
Slide, Next Slide or Previous Slide. does not execute behaviors. In order to
view the full content of the project,
you’ll need to press F12 to preview it.
Playback controls
The Playback controls in the application For more information about previewing
toolbar allow you to preview the a project, see “Previewing a presenta-
presentation. tion” on page 174.

160 Anark Studio User Guide


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

Scrubbing with the Playhead

User Reference 161


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

Chapter 7
Animating Objects

162 Anark Studio User Guide


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

Scrubbing with the Playhead

User Reference 163


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

Chapter 7
Animating Objects

164 Anark Studio User Guide


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

Chapter 8: Working with


Streaming Media and Dynamic
Images
8

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.

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

Chapter 8
Working with Streaming Media and Dynamic Images

Working with proxy video The Remote Source may be specified as


While you are working on a project in either the URL of the media or image file
Anark Studio, it’s recommended that or the fully qualified absolute or relative
you work with a proxy video with low path to it. The following table shows
compression and high quality so that sample paths to a video file from an
you can preview, or “scrub,” the video Anark project file located one directory
using the Playhead, as explained in up.
“Scrubbing with the Playhead” on
Working C:\Projects\Web\Anark.com\
page 160. MPEG-4 and other high-com- Directory
pression codecs aren’t meant to be for Project
scrubbed so they don’t offer this ability. File
Instructions for working with a proxy Relative ./Demo/myFile.avi
video are included in “Adding streaming Path to
media files to a project” on page 167. video
URL to http://www.anark.com/Demo/
Understanding paths for video myFile.avi

streaming media and dynamic Absolute C:\Projects\Web\Anark.com\Demo


Path to \myFile.avi
images video
Because the data of music and video files
is not embedded in the project file, Use the following guidelines for deciding
Anark Studio must access the media file which type of path to use:
each time the project is loaded, pre- Š In general, you should use the relative
viewed or played in order to display the path. Relative paths point to the loca-
video or play the music. It uses the tion of the files in relation to the
Remote Source property of the Library current file. While you are working on
resource to access the file. Similarly, your project, it will be the location of
when you dynamically load an image, the media or image file in relation to
Anark Client must access the image the .amw file. When you are ready to
using the Remote Source property. 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.).

166 Anark Studio User Guide


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

Adding streaming media files to a project

Š If the file will be streamed or loaded in high and low compression versions,
a Web-based application and the you should set this to the low
streaming media or image file is compression version while you are
located on a different server than the working on the project and the
.am file, use the URL. higher compression version when
you are ready to publish it.
Š If the file will be streamed or loaded in
2. Attach the video to either a material
a non-Web-based application and the
on a model or to a layer or group by
streaming media or image file is
dragging it onto one of these items in
located on a different server than the
the Object outline. If the video is
Anark Media, projector or screen saver
attached to a layer or a group, a
file, use the absolute path, which
model (a rectangle primitive) will
describes the full navigation path to a
automatically be created for it both
file.
in the Object outline and in the
Library. Attach the music object to
Note: Universal Naming Convention
the Scene. If you are going to stream
(UNC) paths, which are often used
the media over the Web, you should
to navigate to files on a network,
make sure the start time of the music
cannot be used as the Remote
or video object begins at least a few
Source.
seconds into the presentation.
Adding streaming media files
Setting up streaming files
to a project
If you imported the video or music,
To add video or music to a project: Anark Studio used the absolute path to
1. Do one of the following: its current location as the Remote Source
• Import the video or music file as a property. When you’re ready to publish
resource in the Library using the the presentation, you need to make sure
instructions in “Importing objects” the Remote Source property is set to the
on page 51. If you are working with media file’s final location. In most cases,
a proxy video file (i.e., one that can this will be the relative path. However,
be scrubbed with the Playhead), you if the media file will be located on a
will need to import the low different server than the .am file, you
compression version while you are must specify the absolute path or the
working on the project, and later URL. Even if you are streaming the file in
reference the higher compression a non-Web-based application, latency
version when you are ready to issues may arise if the media file and the
publish it. .am file are not on the same server or
• Create a video or music resource by computer. If that’s the case, you may
need to use the instructions for
dragging on the Video ( ) or
streaming in a Web-based application.
Music ( ) button on the Basic Lastly, it’s always a good idea to clean
Objects tab. You can drag it onto the out the Library before you publish a
Object outline or onto the Project presentation.
window. Set the Remote Source for
the music or video. If you have both

User Reference 167


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

Chapter 8
Working with Streaming Media and Dynamic Images

While Anark Studio allows you to stream project so it can begin prebuffering
up to five media files in a project, keep immediately.
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 PreBufferAsset behavior
application:
5. In order to avoid a noticeable pause
1. Select the video or music resource in
during playback, a section of the pre-
the Library.
sentation would need to be looped
2. On the Inspector palette, set the while the system is prebuffering the
Remote Source property to the media streaming file(s). If you don’t mind
file’s final file location. This should the pause, you can skip ahead to step
be the relative path unless the media 6. Otherwise, you can use the follow-
file and the .am file are not on the ing optional steps to loop a section of
same server, in which case this the animation while the media is
should be the URL. You must do this being buffered.
for each file that will be streamed. If
a. Turn on Use Buffer Loop? by
HTTPS is used, port 443 is used by
checking it.
default. To specify a different port,
the URL must be followed by a colon b. Set Buffer Loop Beg. and Buffer
and a port number (e.g., https:// Loop End to any period of time in
www.anark.com:444). the presentation that doesn’t
intersect the timebar for any
3. On the Storage palette, select the
media file to be streamed. This
PreBufferAsset behavior from the
would typically be a small section
Miscellaneous folder on the Behavior
of animation at either the very
Library tab and drag it onto the
beginning or very end of the scene
Library palette.
that could function as a “loading”
4. Attach the PreBufferAsset behavior to screen.
either the scene or the layer that con- c. If the looping animation is at the
tains the video or music object. It’s a beginning of the scene, then when
good idea to place the start handle of the streaming media is ready to
the behavior at the beginning of the begin playing, the system will

168 Anark Studio User Guide


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

Distributing streaming media files

automatically stop looping and To distribute streaming media with


will continue playing the rest of Macintosh projector files:
the presentation from that point. Mac OS X packages multiple directories
However, if the looping animation into one .app file so that they look like a
is at the end of the scene, you will single application to the user. When you
need to specify that the presenta- create an Anark Studio projector file for
tion should jump back so it can the Macintosh, unless you are going to
finish playing the rest of the scene. stream music or video over the Web, any
To tell the system where to jump media files in the project need to go
back to, turn on Use Continue inside the contents of one of the
Jump? by checking it and set a “hidden” directories inside the exported
value for Continue Time. .app projector file.
d. If the looping animation is at the 1. Because you will be placing the
end of the scene, you must drag media file in the same directory with
the end handle of the PreBufferAs- the .am file, be sure to set the Remote
set behavior object past the last Source property of the video or music
keyframe for the animation. object in the Library accordingly
before saving and exporting (e.g.,
6. Set the Lib. Asset Name parameters to
.\myVideo.avi).
the names of up to five resources in
the Library. The resources can 2. Locate the exported .app projector
include any combination of video, file in a Macintosh Finder window.
music and images. 3. Control-click on the application icon
7. Clean out the Library by right-click- and select “Show Package Contents”
ing in the Library and selecting from the context menu. This will
“Delete Unused Resources” from the open the Contents directory in a new
Context menu. Finder window.
4. Open Contents/Resources.
Distributing streaming media
5. Copy the streaming media file to the
files Resources directory.
As a general rule, you can decide where
The .app file can now be distributed as a
to locate your streaming files based on
single stand-alone application.
whatever directory structure works best
for your implementation. The only Even though Anark Studio only runs on
exception is for Macintosh projector the PC, you can create and distribute
files. If you want to distribute music or Macintosh projector files. A tutorial
video files used in a Mac projector file on explaining how to do this is available on
a CD-ROM rather than streaming them the Anark Web site (www.anark.com).
across the Web, they must be placed in a
special directory. Setting up dynamic images
In all cases, be sure you have set an The PreBufferAsset behavior can be used
appropriate relative path to the media to load a remote image so that the
file using the Remote Source property default image that is embedded in the
before exporting the project. project won’t be displayed. Up to five
assets can be prebuffered with a single

User Reference 169


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

Chapter 8
Working with Streaming Media and Dynamic Images

PreBuffer Asset behavior. The assets can 6. Set Buffer Loop Beg. and Buffer Loop
include any combination of video, End to any period of time in the pre-
music and images. sentation that doesn’t intersect the
To prebuffer images: timebar for any object you want to
1. Select the image resource in the prebuffer. This would typically be a
Library. small section of animation at either
the very beginning or very end of the
2. On the Inspector palette, set the
scene that could function as a “load-
Remote Source property to the ing” screen.
image’s final location. This should be
the relative path unless the image file 7. If the looping animation is at the
and the .am file are not on the same beginning of the scene, then when
server, in which case this should be all the assets are loaded and are ready
the URL. If HTTPS is used, port 443 is to begin playing, the system will
used by default. To specify a different automatically stop looping and will
port, the URL must be followed by a continue playing the rest of the pre-
colon and a port number (e.g., sentation from that point. However,
https://www.anark.com:444). if the looping animation is at the end
of the scene, you will need to specify
3. On the Storage palette, select the
that the presentation should jump
PreBufferAsset behavior from the back so it can finish playing the rest
Miscellaneous folder on the Behavior of the scene. To tell the system where
Library tab and drag it onto the to jump back to, turn on Use Con-
Library palette. tinue Jump? by checking it and set a
4. Attach the PreBufferAsset behavior to value for Continue Time.
either the scene or the layer that con- 8. If the looping animation is at the end
tains the image object (or any other of the scene, you must drag the end
asset you want to load). It’s a good handle of the PreBufferAsset behav-
idea to place the start handle of the ior object past the last keyframe for
behavior at the beginning of the the animation.
project so it can begin prebuffering
immediately. 9. Set the Lib. Asset Name parameters to
the names of up to five resources in
5. In order to be sure that the default the Library.
image will not be displayed, a section
of the presentation will need to be 10. Clean out the Library by right-click-
looped while the system is prebuffer- ing in the Library and selecting
ing the assets. Turn on Use Buffer “Delete Unused Resources” from the
Loop? by checking it. Context menu.

170 Anark Studio User Guide


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

Setting up dynamic images

User Reference 171


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

Chapter 8
Working with Streaming Media and Dynamic Images

172 Anark Studio User Guide


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

Chapter 9: Viewing and


Distributing Anark Media Files
9
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.

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

Chapter 9
Viewing and Distributing Anark Media Files

Previewing a presentation tion, see “Distributing a presentation”


You can preview a project at any time on page 183.
while you are working on it. To preview a project you are working on:
When you preview a project, you can Do one of the following:
see the execution of all its elements, Š Press the F12 key.
including behaviors, actions and anima-
tion. The content of the first slide is Š Choose File > Preview.
displayed initially. In order to view the The presentation will open in the
content of other slides, you must set up preview application specified in the
some actions to navigate through the Project Settings. The default setting is
slides. Anark Player, but you can also select
In order to preview a project, Anark Internet Explorer instead. For more
Studio must create appropriate files for information, see “Editing project
each application. These are automati- settings” on page 19.
cally saved in the same directory as the
.amw file that is created when a project Setting rendering options
is saved. The following files are created: In order for Anark Media presentations
to be played on the largest possible
Š If you select Internet Explorer as your
number of computers, Anark provides
preview application, both an HTML
three rendering options:
and an Anark Media file are created.
Š DirectX
Š If you select either Anark Player or
Anark Player - Software as your preview Š OpenGL
application, then only an Anark Media
Š Software
file is created.
As you are developing a presentation in
Š If you select Custom, you can select a Anark Studio, you can view it in the
presentation exporter that you prefer. Project window using any of the avail-
Output files will be created accord- able rendering engines. You can set
ingly, depending on your selection. which rendering engine to use in the
Anark Studio Preferences dialog (under
Note: If you select Anark Player - Soft-
Edit > Application Preferences).
ware as your preview application for
a project that has Force Hardware set When you are ready to publish your
as the Playback Preferred Renderer, presentation, you can set the Playback
you will receive an error message Preferred Renderer property in the
when you attempt to preview. For Project Settings dialog. This property sets
more information about setting the a flag in the exported presentation that
Playback Preferred Renderer, see can be read by the playback application
“Export Options” on page 22. to determine how it will handle the
presentation.
For more information about setting up
actions, see “Creating and deleting Š Content set to “Auto” will use the
actions” on page 120. For information renderer selected in the Anark Client
about viewing an exported presenta- Control Panel on the viewer’s
machine. However, the viewer can

174 Anark Studio User Guide


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

Software renderer limitations

change the renderer for that presenta- ing or to unexpected results in


tion using the context menu in the behaviors. In DirectX, if you set a
playback application. value for an object to an exact deci-
mal point (e.g., 123.456) the value
Š Content set to “Force Hardware” will
returned may not be that exact deci-
use whichever hardware renderer is
mal value (123.45600123173828
selected in the Anark Client Control
would be returned instead).
Panel. However, if Software is selected
in the control panel, it will automati-
Software renderer limitations
cally choose either OpenGL or DirectX.
While the Software renderer has a wider
Users will not be allowed to choose the
playback audience than hardware
Software renderer from the context
rendering options, there are some limita-
menu for that presentation.
tions to the renderer that need to be
Š Content set to “Force Software” will considered when targeting a presenta-
ignore the Anark Client Control Panel tion for Software rendering:
setting and will always play back in the Š Software rendering is considerably
Software renderer mode. Users will not
slower than hardware acceleration.
be allowed to choose OpenGL or
Frame rates will be much lower than
DirectX from the context menu for
with OpenGL and DirectX on large
that presentation. See “Software
presentations.
renderer limitations” below when
considering forcing presentations to Š Image mirroring is not available.
play in Software. Images that are set to Mirror will
In cases where the Anark Client Control default to Tiled.
Panel is not present on a viewer’s Š Individual U and V Tiling options are
machine, such as projectors and screen not available. If either the U or V coor-
savers or when Anark Player is distrib- dinate is set to Tiled, the entire image
uted on CD ROM, the playback applica- will tile. Both U and V need to be set to
tion will find an available renderer on No Tiling for no tiling to occur on the
the viewer’s machine in this order: image.
a. OpenGL Š Spot lights are not available. Any Spot
b. DirectX lights in a presentation will default to
c. Software Point lights.
When exporting to AVI video, the Play- Š Specular Material settings are not avail-
back Preferred Renderer setting (Edit > able. They will be ignored.
Project Settings) will be used to render to
Š Point Material rendering is not
video. There is no way to manually
available. Any objects set to Point
switch renderers while the project is
rendering will not be rendered in
rendering to video.
Software.
Note: OpenGL is able to evaluate Š Wireframe rendering is not shaded in
floating-point numbers more pre- Software. This is different from
cisely than DirectX does, which can OpenGL and DirectX, which draw
lead to slight differences in render- shaded wirefame lines.

User Reference 175


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

Chapter 9
Viewing and Distributing Anark Media Files

Š The accuracy of U and V Position and Exporting a presentation


Repeat values is limited based on the In order to distribute a finished presenta-
texture map size. Accuracy is only tion, you must first export it.
guaranteed within a range of +/-32 for To export a project:
images that are sized at 256 (e.g., a U 1. Do one of the following:
and V Position value of 8 and a U and
V Repeat value of 8). Any decrease in • Choose File > Export Presentation.
the texture map size will increase the • Press Ctrl + Shift + S.
accuracy range, while an increase in 2. Create a name for your file and select
texture size will decrease the accuracy a location.
range.
3. Select the types of files to create from
Š Materials are limited to a maximum of among the following:
2 textures, regardless of the hardware
• Anark Media – Creates an Anark
maximum number of allowable
Media file that uses .am as its file
textures.
extension. Unlike the .amw file that
is created when you save a project,
Choosing a distribution the .am file cannot be edited
format because it has been compressed and
There are several things to consider has data embedded in it. It can only
when deciding on a format (or formats) be opened in Anark Client. You can
for distribution of your presentation. use this option if you will be embed-
ding the .am file in an existing
Š If you have designed an interactive HTML page. For more information,
presentation, you should select one of see “Embedding Anark Media in an
the interactive formats: HTML, Anark existing HTML file” on page 186.
Media, projector or Windows screen • HTML page – Creates both an Anark
saver. Media file and an HTML file, which
Š If your presentation doesn’t contain has the Anark Client ActiveX
any interactive elements, then you can Control already embedded in it.
export it to video. Exported video files Keep the HTML file in the same
do not contain any audio, however. directory as the .am file when you
distribute the presentation or else
Š To distribute your project via the Web, you will have to edit the SRC param-
export it to HTML. eter in the HTML file with the Anark
Š For CD-ROM, kiosk or standalone Media file’s new location using the
program applications, you can export guidelines in “Editing the HTML
it as a Windows projector file. document” on page 184.
• AVI Video – Creates an Audio Video
Š To distribute your project as a Interleave (.avi) file that can be
Windows screen saver, export it as a viewed in an appropriate media
screen saver (.scr). player. This option should only be
used with non-interactive
presentations. No audio is included
in the exported video file. The

176 Anark Studio User Guide


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

Exporting to Anark Player

available compression settings will


Note: If you are exporting your
depend on the codecs you have
installed on your computer. See project to any format other than
“Exporting to video” on page 178 video, you will need to distribute
for more information. any streaming music or video files
that were used in your presentation
• Windows Screen Saver – Creates a along with the exported Anark
.scr file that can be used as a screen Media file. See “Setting up streaming
saver on a user’s computer. It files” on page 167 for more
includes both the Anark Media data information.
and the application required to view
it. If you select this option, an
Exporting to Anark Player
export dialog will open that allows
you to enter information about the Exporting a project for Anark Player
presentation and the author. For creates a single .am file. There are no
more information about these additional settings to configure.
options, see “Exporting to screen The file can be distributed along with
saver” on page 180. the Anark Player application that can
• Projector – Windows only. Creates a play it back, or it could be embedded in
.exe file that can be run as a standa- an existing HTML page.
lone application. It includes both
the Anark Media data and the Anark Exporting to Internet Explorer
Media projector application When you export a project to HTML,
required to view it, bundled into a both an HTML and an Anark Media
single file. If you select this option, (.am) file are created. While there are no
an export dialog will open that additional settings to configure during
allows you to enter information export, you can customize or change
about the executable file that will be several settings in the exported HTML
viewable by the end user. For more document. See “Editing the HTML
information about these options, document” on page 184 for more
see “Exporting to projector” on information.
page 182.

User Reference 177


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

Chapter 9
Viewing and Distributing Anark Media Files

Exporting to video Height – Specifies the height in pixels of


When exporting a project to video, there the exported video.
are several things to configure, including
its dimensions and timing and the Note: Because some video codecs will
compression, if any, to apply to it. only work with dimensions that are
a multiple of four, you can only set
Note: When exporting to video, you the video’s Width and Height to val-
will need to make sure that the ues that are a multiple of four.
project is rendering in OpenGL. See The Width and Height default to the
“Editing project settings” on current size of the Project window
page 19 for more information. (rounded down to the nearest multiple
of four.) The Project window size is set
Video Export Settings
using the Scale Mode property on the
The Video Export Settings dialog will
Anark Studio Preferences dialog, as
appear after you have selected a name
explained in “Editing project settings”
and location for the video file.
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,
Width – Specifies the width in pixels of the content will be cropped or blank
the exported video. space will be added to accommodate
the Width and Height you specify in

178 Anark Studio User Guide


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

Exporting to video

Š If the Scale Mode is set to Scale to fit, Video Compression


then the models in the scene may be The Video Compression Settings dialog
scaled up or down to so that they will appear after you have clicked Next
appear to take up the same amount of on the Video Export Settings dialog.
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. This dialog allows you to select and/or
Stop Time – Sets the point in the presen- configure the video codec application to
tation for video capture to stop. Speci- be used on your video file. The list of
fied in seconds. Defaults to the current available codecs depends on the codecs
presentation length. For information you have installed on your computer.
about how the presentation length is The two Codec Options, Quality and
determined, see “Duration of the KeyFramesPerSec, are available for some
project” on page 59. but not all codecs. Additionally, some
Continuous Capture – When checked, codecs have a Configure button that
this specifies that the Stop Time will not links to a dialog with further compres-
be used; instead, video capture will sion options. Refer to the compression
continue until the Stop Rendering application’s product documentation for
button is pressed on the Video Export more information about configuring it.
screen. 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/

User Reference 179


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

Chapter 9
Viewing and Distributing Anark Media Files

Video Export screen Preferences dialog, as explained in


This screen appears after you have “Editing project settings” on page 19) to
clicked Finish on the Video Compres- determine the dimensions of the
sion Settings dialog. exported screen saver.
The Video Export screen displays the Š If the Scale Mode is set to Scale to fit,
presentation as it is being captured the screen saver will cover the viewer’s
to video. 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 Saver


The Export to Anark Media Screen Saver
dialog will appear after you have selected
a name and location for the screen saver
file.
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.
Screen Saver Name – Sets a name for the
Exporting to screen saver screen saver that will appear in the
When exporting a project as a screen Display Properties dialog on the Screen
saver, you can specify the information Saver tab and in the Configuration
you want to appear in the Configuration Setting dialog. However, due to the way
Setting dialog for the screen saver. Windows looks for the file name to use,
the File name of the screen saver may be
The screen saver will use the Scale Mode used instead. In order for the Screen
property (from the Anark Studio Saver Name to be used instead of the file

180 Anark Studio User Guide


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

Exporting to screen saver

name, the file name must meet the Configure Settings


following criteria: The Configure Settings dialog is avail-
able to the end user from the Display
Š The number of characters for the file
Properties dialog’s Screen Saver tab. It
name can only be a maximum of eight
allows the user to specify a hot spot (or
characters long, plus the .scr file
exit) area and set whether key presses
extension.
will exit the screen saver.
Š 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.

User Reference 181


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

Chapter 9
Viewing and Distributing Anark Media Files

Exporting to projector Windows 2000 and Windows XP.


When exporting a presentation to the Defaults to the Anark Media icon. You
projector format, you can set several can browse to any single icon file that
properties for the Windows executable contains a single image (i.e., icon files
file, including the application name and with multiple images cannot be used).
author, a brief description and a custom
icon. Viewing a presentation
You can view an exported project in
Export to Anark Media Projector whatever export format you choose.
The Export to Anark Media Projector
During playback, the content will be
dialog will appear after you have selected
played from 0 seconds to the final end
a name and location for the .exe or
handle of the last layer. Even if the first
application file.
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.
Application Name – Sets a name for the
Note: Anark Player 2 cannot play
application that will appear in the title
bar and in the About box. Anark Media files created in older
versions of Anark Studio (i.e., earlier
Author – Sets the author name that will than Anark Studio 2).
appear in the About box of the
application. Š You can preview a screen saver in
Description – Allows you to write a brief
Windows by selecting it on the Screen
description of the application that will Saver tab on the Display Properties
control panel and pressing the Preview
appear in the About box.
button.
Application Icon – Allows you to specify a
custom icon for the application which Š For video files, double-click on the
will appear in the title bar. This option is video file or open it from the desired
only available on computers running media player.

182 Anark Studio User Guide


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

System requirements for viewing a presentation

Š For projector files, double-click on the Note: Anark Player must be included
executable or application file.
with the Anark Media file, but does
For information about the file types that not have to be installed on the
are created with each of the export viewer’s computer. See “Preparing
formats, see “Exporting a presentation” Anark Media for a CD-ROM” on
on page 176. page 190 for more information.

System requirements for Windows screen saver


viewing a presentation Š Microsoft Windows 98 SE, Windows
Anark Media can be viewed in several 2000, Windows Me or Windows XP
distribution formats, each of which has Š PentiumII processor @ 300 MHz (or
its own system requirements. better)

Anark Client for PC browsers Š 128 MB of RAM or more


Š Anark Client installed Š DirectX 7.0 or later installed
Š Microsoft Windows 98 SE, Windows Š Windows Media Player 7 or later
2000, Windows Me or Windows XP installed
Š PentiumII processor @ 300 MHz (or Š Microsoft Internet Explorer 5.0 or later
better) installed
Š 128 MB of RAM or more Š Minimum of 4 MB of free disk space
Š DirectX 7.0 or later installed
Video
Š Windows Media Player 7 or later The video format you choose for export
installed determines the viewer’s system
requirements.
Š Microsoft Internet Explorer 5.0 or later
installed
Distributing a presentation
Š Minimum of 4 MB of free disk space As part of your project planning, decide
on an export format. Later, export the
Anark Player and projector (.exe) for the project and then deploy the exported
PC files. See “Exporting a presentation” on
Š Microsoft Windows 98 SE, Windows page 176 for more information.
2000, Windows Me or Windows XP
Š To distribute an Anark Player project,
Š PentiumII processor @ 300 MHz (or you need to include both the .am file
better) and the AMPlayer.exe (Windows
Š 128 MB of RAM or more0 executable) file. Additionally, you
can set up a command line or
Š DirectX 7.0 or later installed configuration file to control some
settings for the presentation. See
Š Windows Media Player 7 or later
“Command line and configuration file
installed
options (Windows)” on page 192 for
Š Minimum of 4 MB of free disk space more information. If any video, music

User Reference 183


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

Chapter 9
Viewing and Distributing Anark Media Files

or remotely sourced images are ration file to control some settings for
included in the presentation, you will the presentation. See “Command line
need to make those files available as and configuration file options
well. See “Chapter 8: Working with (Windows)” on page 192 for more
Streaming Media and Dynamic information. If any video, music or
Images” on page 165 for more remotely sourced images are included
information. in the presentation, you will need to
make those files available as well. See
Š For Web distribution, you will need to
“Distributing streaming media files”
place both the .am file and the .html
on page 169 for more information.
file on your Web server. If for some
reason you need to put the HTML and
.am files in different directories, you
Editing the HTML document
will have to edit the SRC parameter in When an Anark Studio presentation is
the HTML file with the Anark Media exported to HTML, the correct HTML
file’s new location using the guidelines tags are inserted into the HTML docu-
in “Editing the HTML document” on ment. These tags tell the viewer’s
page 184. If any video, music or browser what plug-in to use to run the
remotely sourced images are included specified presentation. Optional settings
in the presentation, you will need to are available to control some display
make those files available as well. See properties for the browser.
“Chapter 8: Working with Streaming Unless you need to store the .am file in a
Media and Dynamic Images” on different directory or on a different
page 165 for more information. server than the HTML file that is created
Š For Windows screen savers, you only during export, you don’t need to edit
any of the properties for the HTML tags,
need to provide the exported .scr file.
although you may want to change some
Including streaming files in screen
of the optional settings such as back-
savers is not recommended because of
ground color.
the very slow playback.
The HTML document must contain the
Š To distribute a video presentation, you <OBJECT> tags, including various param-
only need to provide the exported eters, that are required by Internet
video file. Explorer on Windows.
Š To distribute a projector file, just Refer to the following example to see
include the .exe file. Additionally, you which parameters must be included.
can set up a command line or configu-

184 Anark Studio User Guide


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

Editing the HTML document

<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>

Sample HTML object tags and parameters. tifier for Anark Client that the browser
uses to determine what application to
Required OBJECT attributes use to display the content. If you want
Š OBJECT NAME and ID are the name to distribute presentations that were
and ID of the Anark Client object. created in Anark Studio 3.5 or earlier in
They can be set to anything you want, Anark Client 4.0, you will need to
but when Anark Studio exports a change the CLASSID. See “Running
presentation it defaults to player. older presentations in Anark Client
Keep in mind that if you want to use 4.0” on page 186 for more informa-
the ActiveX control properties, you tion.
will need to refer back to whatever
OBJECT NAME you specified here. See Š WIDTH and HEIGHT can be set as
“Working with ActiveX control either a percentage of the browser
methods and properties” on page 189 window, frame or table cell (e.g.,
for more information. width = "100%" height = "100%")
or a specific pixel width (as shown).
Š CODEBASE will be set to the following This controls the width and height of
http://install.anark.com/client/ the Anark Client container window.
version4/windows-ie/en/
AMClient.cab#version=4,0,0,35607. Š SRC must be set to either the relative
It specifies the location of Anark Client path (if on the same server) or the URL
so that it can be downloaded if it is not (if on a different server) of the Anark
already available on the user’s Media file, which uses the .am exten-
computer. The version number (in this sion. Anark Media files that will be
case, 4,0,0,35607, although it will viewed exclusively on Windows
change with subsequent versions) can machines can also be loaded into the
be changed to a different version of HTML page using the load ActiveX
Anark Client. control function. See “Working with
ActiveX control methods and proper-
Š CLASSID must be set to ties” on page 189 for more informa-
CLSID:051D0E35-F4E3-4c8d-B411- tion.
AB0875F4C683. This is a unique iden-

User Reference 185


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

Chapter 9
Viewing and Distributing Anark Media Files

Optional attributes for OBJECT tags and paste the content of the <OBJECT>
Š ScaleMode can be set to Free, Exact tag from the previous section into your
or Aspect. This controls the type of HTML file. You can edit or add any
window scaling that can be used. Free optional attributes you want. Make sure
allows scaling in any direction. Exact that the SRC parameter is set to either
disables scaling so that the presenta- the relative path or the URL of the Anark
tion only displays at an exact pixel size Media file.
and with the application border.
Tip: An easy way to copy the proper
Aspect allows scaling and always
maintains the aspect ratio. If you tags is to export the presentation to
change these values in the HTML HTML, open the generated HTML
document, they will override the Scale file with a text editor and copy the
Mode settings in Anark Studio. complete text of the <OBJECT> tag
from the generated file into your
Š PresWidth and PresHeight must be set existing HTML file. For more infor-
as a specific pixel width. These settings mation about exporting to HTML,
are only used if the ScaleMode has see “Exporting a presentation” on
been set to Fixed or Aspect. If you page 176.
change these values in the HTML
document, they will override the Running older presentations in
Presentation Size settings in Anark Anark Client 4.0
Studio. If you have existing presentations that
Š Splash specifies that a splash screen were created in Anark Studio 3.5 or
and progress bar will be displayed earlier and you want to distribute them
while the presentation loads. Defaults for playback in Anark Client 4.0, it’s a
to true. Set to false if you don’t want good idea to bring them into Anark
them to be displayed. Studio 4.0 first. Once they have been
saved and exported in Anark Studio 4.0,
Š BackgroundColor can be set to any they will automatically be ready for
standard HTML color string or to a distribution in Anark Client 4.0.
hexadecimal value (0xRRGGBB). This
However, if you don’t want to bring
setting only controls the color of the
them into Anark Studio 4.0 first, you can
splash screen that is displayed during
edit the CLASSID tag in the existing
loading.
exported HTML file. Simply change the
Š BorderColor can be set to any stan- old CLASSID (CLSID:131EB16C-BD58-
dard HTML color string or to a hexa- 443f-8151-6DFBB0DA1778) to the current
decimal value (0xRRGGBB). This setting CLASSID:
controls the color of the border 051D0E35-F4E3-4c8d-B411-
between the Anark Client container AB0875F4C683
and the presentation window.
Working with HTML events
Embedding Anark Media in an The Windows version of Anark Client
existing HTML file supports three HTML events:
If you want to embed the Anark Media onExternalCommand, onProgress and
file in an existing HTML file, just copy onStateChange.

186 Anark Studio User Guide


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

Working with HTML events

HTML Events
Command Values Description
onExternal- ( commandString, Provides a connection point in the browser to which an Anark
Command parameterString ) Media file can send commands.
Example
The 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, Provides a connection point for an Anark Media file to send
percentageCom- loading status information to the browser that can be used to
plete ) display a loading page or a loading status indicator.
The readyState value returns the current status of the loading
process:

0 = unknown state
1 = starting to load
2 = in progress
3 = complete
4 = loading error

The percentageComplete value returns a number between 0


and 100, indicating the current percentage of the presentation
that has been prebuffered.
Example
The 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>

User Reference 187


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

Chapter 9
Viewing and Distributing Anark Media Files

HTML Events
Command Values Description
onState- ( newState ) Provides a connection point for Anark Client to send informa-
Change 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 state
1 = Anark Player is starting up
2 = Anark Player is playing
3 = Anark Player is paused
4 = fatal error
Example
The following would be entered in the HTML script:
<SCRIPT FOR="player"
EVENT="onStateChange( state )" LANGUAGE="JavaS-
cript">
if (state == 3)
{
alert( "Paused" );
}
</SCRIPT>

188 Anark Studio User Guide


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

Working with ActiveX control methods and properties

Working with ActiveX control presentation from an HTML page or


methods and properties other applications that support ActiveX
Several Windows ActiveX control containers. In addition, there are several
methods are available that allow you to properties for the ActiveX control object.
communicate with an Anark Media

ActiveX Control Methods


Function 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.
Example
The 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.
Example
player.load( "./Demos/anarkDemo1.am" )
play Plays the currently loaded Anark Media file.
Example
player.play( )
stop Stops the currently loaded Anark Media file and rewinds it to
the beginning.
Example
player.stop( )
restart Restarts the currently loaded Anark Media file from the
beginning.
Example
player.restart( )

User Reference 189


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

Chapter 9
Viewing and Distributing Anark Media Files

ActiveX Control Properties


Property 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 state
1 = Anark Player is starting up
2 = Anark Player is playing
3 = Anark Player is paused
4 = fatal error
loop Specifies whether the presentation should loop. It also returns its current value.
0 = false
1 = 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 = Auto
2 = OpenGL
3 = DirectX
4 = 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 fit
16 = Fixed size
32 = 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.

Preparing Anark Media for a For the majority of situations, you will
CD-ROM probably want to use projector files to

190 Anark Studio User Guide


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

Running a presentation on a CD-ROM by double-clicking

play Anark Media as a standalone appli- burning software with that particular
cation, on a CD-ROM or in a kiosk. You capability. A tutorial explaining how to
need to include both the Anark Media do this is available in the Knowledge
data and the Anark Player application Base on the Anark website.
that can display it in a single executable
file. Running a presentation on a CD-
When preparing an Anark presentation ROM automatically (Windows)
file for playback on a CD-ROM, consider 1. You’ll need to create an AutoRun file.
implementing Auto Run. AutoRun is a feature of the Microsoft
Windows operating system that
To do this, you set up an AutoRun file automatically runs an application on
using the instructions in “Running a the CD-ROM when it is inserted into
presentation on a CD-ROM automati- the drive. To create an AutoRun file,
cally (Windows)” on page 191. create a new document in any text
editing program (e.g., Wordpad,
Running a presentation on a Notepad, etc.) and name it
CD-ROM by double-clicking Autorun.inf. Add the following text
Do one of the following: to the file:
Š If you’re distributing your project as a [autorun]
projector file, simply place the OPEN=filename.exe
exported projector file (.exe) in the
desired directory on your CD-ROM. It [autorun.x86]
can be in the root directory or any OPEN=filename.exe
other directory.
Š If you’re distributing your project as an Replace filename.exe with the name
of the projector file you want to
Anark Player file, place the .am file
launch.
(which must be named index.am) and
the AMPlayer.exe in the desired direc- 2. Save the Autorun.inf file and place it
tory on your CD-ROM. It can be in the in the root directory of the CD-ROM,
root directory or any other directory. along with the .exe projector file.
If you want to customize Anark Player
Note: You can find more infor-
settings, you can create a configuration
mation about creating an AutoRun-
file (.cfg) in any text editing program
enabled CD-ROM on Microsoft’s
(e.g., Wordpad, Notepad, etc.) and name
developer Web site: http://
it Startup.cfg. Just include it in the direc-
msdn.microsoft.com/.
tory with the other files. Configuration
file settings are only used by the To customize the AutoRun file
Windows version of Anark Player. See (Windows):
“Setting up a configuration file for a You can add other command line
projector file” on page 195 for more options to the Autorun.inf file. For
information. example, the following commands
would run AMPlayer.exe in full screen
Creating hybrid CD-ROMs that will run mode and would not display a splash
on both Windows and Macintosh is a screen while loading:
specialized application that requires CD

User Reference 191


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

Chapter 9
Viewing and Distributing Anark Media Files

[autorun] Command line and


OPEN=AMPlayer.exe
-view Full -disable Splash
configuration file options
(Windows)
[autorun.x86] Several settings for the Windows version
OPEN=AMPlayer.exe of Anark Player and projector files can be
-view Full -disable Splash
controlled using either a configuration
file (.cfg) or command line settings in
either an AutoRun file or a batch file
See “Command Line Options” on (.bat). Configuration file and command
page 193 for a complete listing of line settings are only used by the
commands. Windows version of Anark Player. Both
command line settings and configura-
Note: Publishing content in kiosk
tion file settings will override project
applications is a specialized proce- settings that were made in Anark Studio
dure that is not covered here, (e.g., the presentation size and border
although the process for running a color). Command line settings will also
projector file would be the same as override any configuration file settings.
for a CD-ROM.

192 Anark Studio User Guide


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

Command line and configuration file options (Windows)

Command Line Options


Command 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, Sets the width of the presentation in pixels.
-presentationwidth
-ph, -pheight, Sets the height of the presentation in pixels.
-presentationheight
-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| Sets the view properties of the window.
Compact 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, Disables certain features for an entire session, even if
Splash 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, 0, 1 Specifies whether Anark Client will pause playback when
-cooperativeMode 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.

User Reference 193


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

Chapter 9
Viewing and Distributing Anark Media Files

Configuration File Options


Section 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.

194 Anark Studio User Guide


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

Setting up a configuration file for a projector file

Setting up a configuration file the root directory, so you either need to


for a projector file name your file one of those names or
To create a configuration file for a you need to specify a file name.
projector file, open a new document in For example, the following configura-
any text editing program (e.g., Wordpad, tion file would run Test.am located
Notepad, etc.) and name it Startup.cfg. within the Content folder. It would also
A configuration file can have three allow scaling in any direction.
sections: [Version], [Presentation] and [Version]
[Options]. FileVersion = 1
Except for the FileVersion, which must [Presentation]
be specified in every configuration file, File = ./Content/Test.am
you only need to specify the settings you Scale = Free
want to change from the defaults. For
example, the following configuration Anark Player features
file allows scaling that maintains the Anark Player includes several menus and
current aspect ratio, displays the presen- keyboard shortcuts. A Context menu is
tation without window borders and will available on Windows machines when
not ask the user to register the .am file the viewer right-clicks in the Anark
extension. Player window.
[Version] Menu Options Shortcut
FileVersion = 1 Open Ctrl + O
[Presentation] File Recent
Scale = Aspect Exit
[Options] Normal Esc
View = Compact F9
View
Quiet = 1 Compact F10
Full Screen F11
Note: The disable settings (Disable- Play/Pause Ctrl + P
Exit, DisableSwitching and Disable- Control
Restart Ctrl + R
Splash) are persistent for an entire
Help About
session, so even if the viewer opens
another presentation without any A Rendering Engine option is also avail-
disable settings, the previous file’s able from the Context menu. It controls
settings will apply. how the currently loaded Anark Media
presentation will be rendered. The
Setting up a configuration file options are the same as for the “Anark
for Anark Player (Windows) Client Context menu” on page 197.
If you are distributing your project for
Anark Player, there are a couple of differ- Note: Anark Player 2 cannot play
ences in how you would set up a config- Anark Media files created in older
uration file. versions of Anark Studio (i.e., earlier
than Anark Studio 2).
Unless a File is specified, Anark Player
will look for default.am or index.am in

User Reference 195


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

Chapter 9
Viewing and Distributing Anark Media Files

About the Anark Client DirectX – Uses DirectX for rendering


controls the scene.
Anark Client provides both a control OpenGL – Uses OpenGL for rendering
panel and a context menu that allow the scene.
users to control some settings for Software – Uses software rendering.
presentations.
For a description of OpenGL, DirectX
Anark Client Control Panel 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
The Anark Client Control Panel provides
install the update.
controls for presentation playback, script
debugging and automatic updating, and Enable Script Errors – Sets whether or not
information that can be used for trouble- script errors will be reported to the user
shooting. when playing a presentation. This
To access the Anark Client Control Panel:
setting is useful for debugging custom
From a browser window running an behavior scripts.
Anark Media application, right-click and
Components
select Preferences from the Context
This tab contains information about the
menu.
currently installed version of Anark
Preferences Client.
Client Version – Allows users to select
System
which version of Anark Client to view or
This tab displays relevant system
set preferences for. Users who have an
information such as video card data,
older version of Anark Client on their
driver versions and available OpenGL
computers in addition to Anark Client
extensions.
4.0 will have a pulldown menu available.
Preferred Renderer – Controls how About
Anark Media presentations will be This tab contains a description of the
rendered on this computer. Anark Client application.

196 Anark Studio User Guide


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

Anark Client Context menu

Anark Client Context menu text and may contain graphics. All SCOs
The Anark Client Context menu is avail- must be able to communicate with an
able by right-clicking anywhere in an LMS.
Anark Media presentation. An LMS is a system that keeps learner
Restart – Restarts the currently loaded information, can launch and communi-
Anark Media file from the beginning. cate with SCOs, and can interpret
instructions that tell it which SCO
Pause/Play – If currently playing, then
comes next. When set up for SCORM
pauses the currently loaded Anark Media
conformance, an Anark Media presenta-
file. If currently paused, plays the
tion and its accompanying HTML page
currently loaded Anark Media file.
become a SCO. As such, they are able to
Rendering Engine – Controls how the communicate with the Application
currently loaded Anark Media presenta- Protocol Interface (API) provided by an
tion will be rendered. LMS, and issue two commands: LMSIni-
OpenGL – Uses OpenGL for rendering tialize and LMSFinish.
the scene. A JavaScript file, APIWrapper.js, which is
DirectX – Uses DirectX for rendering included with the Anark Studio down-
the scene. load, provides the link between the SCO
and the LMS.
Software – Uses software rendering.
The APIWrapper.js file is located in the
For a description of OpenGL, DirectX
Anark installation directory inside the
and Software, see “Setting application
Third-party/SCORM folder.
preferences” on page 17.
When you are ready to distribute your
Preferences – Opens the Anark Client
finished project, you must include three
Control Panel.
files: the Anark Media file, the HTML file
and APIWrapper.js.
Creating SCORM-conformant
To prepare a presentation for SCORM
presentations conformance:
SCORM (Sharable Content Object Refer- 1. Import the behavior SCORM.bvs into
ence Model) is a set of specifications and the project by dragging it from the
standards aimed at making learning Storage palette onto the Library pal-
content reusable, accessible and interop- ette. SCORM.bvs is located in the
erable. Anark Media presentations can Storage palette under Behavior Lib >
easily be made SCORM Version 1.2 Miscellaneous.
conformant (specifically, they are SCO-
2. Drag an instance of the SCORM
RTE1-conformant). Currently, SCORM-
behavior from the Library onto the
conformant Anark Media can only be
object that you want to have start the
viewed on Windows machines.
lesson. This could be either the Scene
SCORM has two essential parts: a or an object that will function as a
SCORM-conformant Learning Manage- start button.
ment System (LMS) and the learning
3. With SCORM selected in the
unit called a Sharable Content Object
Timeline, set the LMS Message
(SCO). A SCO is a standardized unit of
learning content that typically contains

User Reference 197


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

Chapter 9
Viewing and Distributing Anark Media Files

property in the Inspector palette to mended that you attach it to an


LMSInitialize. object that will function as a “fin-
4. Do one of the following: ished” or “done” button.
6. With SCORM selected in the Time-
• If you attached the behavior to the
Scene object, set the On Event prop- line, set the LMS Message property in
erty to onAttach. the Inspector palette to LMSFinish.

• If you attached the behavior to an 7. Set the On Event property to one of


object that will act as a start button, the mouse events: onMouseDown,
set the On Event property to one of onMouseUp, onMouseOver,
the mouse events: onMouseDown, onMouseClick or onMouseOut.
onMouseUp, onMouseOver, 8. Save the presentation by choosing
onMouseClick or onMouseOut. File > Save.
5. Drag a second instance of the 9. Choose File > Export and select Inter-
SCORM behavior from the Library net Explorer under Save as Type.
onto the object that you want to Enter a name and click Save.
have end the lesson. It’s recom-

198 Anark Studio User Guide


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

Creating SCORM-conformant presentations

10. Open the HTML that was created


Note: This code is also viewable from
along with the .am file and enter the
following script within the <BODY> within the comments of
tag: SCORM.bvs.
11. Ensure the JavaScript file APIWrap-
<SCRIPT FOR="player" EVENT="onExternalCom
mand( command, msg )" LANGUAGE="Javascript" per.js is located in the same directory
SRC=”APIWrapper.js”></SCRIPT> as the HTML file that will play the
Anark presentation.

User Reference 199


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

Chapter 9
Viewing and Distributing Anark Media Files

200 Anark Studio User Guide


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

Creating SCORM-conformant presentations

User Reference 201


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

Chapter 9
Viewing and Distributing Anark Media Files

202 Anark Studio User Guide


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

Chapter 10: Using Scripting 10


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.

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

Chapter 10
Using Scripting

Overview of scripting
Anark 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 resources
Before 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 syntax
A 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 braces
Curly 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;
}

204 Anark Studio User Guide


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

Scripting syntax

Equal sign
A 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();
}

Parentheses
Parentheses ( ) 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));

Semicolons
Semicolons (;) 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 letters


Anark scripts are case sensitive. For this reason, the following two examples are not
equivalent:
function Drag( inEvent )
function DRAG ( inEvent )

User Reference 205


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

Chapter 10
Using 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 );

Comments
Comments 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-line
comment.*/
/*Here's another comment. */ // So is this.

Data types
JavaScript 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.

Numbers
Numbers 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.

Strings
A 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.

Boolean
The 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.

206 Anark Studio User Guide


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

Global functions

Null
The 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.

Undefined
The 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.

Object
An 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.

Array
An 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 functions
The 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.
Example
if ( this.parent.type == "Group" )
{
theParticle = theParticleGroup.models[0];
}
else if ( this.parent.type == "Model" )
{
alert("Cannot add this Behavior to a
model.");
}

User Reference 207


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

Chapter 10
Using Scripting

Function Arguments Description


confirm ( messageString Displays a confirmation dialog box containing the mes-
) sageString text and OK and Cancel buttons.
Example
var 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, Displays a dialog box containing the messageString text
defaultText ) and an edit box with the defaultText text. It then returns
the text entered in the edit box.
Example
var 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).

208 Anark Studio User Guide


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

Global functions

Function Arguments Description


externalCommand ( command- This function is only available on Windows. It provides a
String, parame- way for an Anark Media presentation to communicate
terString ) 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.
Example
externalCommand( "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.

User Reference 209


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

Chapter 10
Using Scripting

Function Arguments Description


navigate ( URL, navFlags, Navigates to the specified URL.
targetFrame, Arguments
postData, URL
Required. Specifies the URL, fully qualified path or UNC
headers )
(Universal Naming Convention) location of the resource
to display.
navFlags
Optional. 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.
targetFrame
Optional. 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.
postData
Optional. 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.
headers
Optional. 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 (;).
Example
navigate ( "http://www.anark.com", 0,
"MyAnarkWindow");

210 Anark Studio User Guide


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

Keywords

Keywords

Assigned keywords
The following keywords have specific uses within the language, so they cannot be
used as variables, functions or labels (i.e., constants):
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

Reserved keywords
The following keywords are reserved for future uses:
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

Objects
Objects in JavaScript are collections of properties, attributes of properties and methods
(functions that are built into the object).

JavaScript intrinsic objects


Several 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:
Array Function Math Object
Boolean Global Number RegExp
Date Error String

User Reference 211


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

Chapter 10
Using Scripting

Anark Studio intrinsic objects


Anark 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:
Assets Nodes Utilities AKEvent Misc
Scene Layer Color LatestEvent Player
Behavior Camera Vector XMLNode
Material Light Rotation XML
Image Group Matrix Presentation
Video Model Mouse TimeContext
Music Sound Key Timer*
Window Container
Memory
* The Timer object is reserved but is not currently accessible.

Specifying paths in scripting


When 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 )

212 Anark Studio User Guide


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

Operators

Operators
Operators are terms and symbols that are used to calculate a new value from one or
more values.
Arithmetic Operators
Symbol 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 Operators
Symbol Operator Read from… Description
, Comma L to R Causes two expressions to be executed sequentially.
?: Conditional R to L Executes one of two statements depending on a
(ternary) 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 L to R Compares two expressions to determine if one is greater
equal to 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 L to R Compares two expressions to determine if one is less
equal to 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.

User Reference 213


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

Chapter 10
Using Scripting

Logical Operators
Symbol Operator Read from… Description
! 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 Operators
Symbol 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 R to L Adds the value of an expression to the value of a variable
Assignment and assigns the result to the variable.
/= Division R to L Divides the value of a variable by the value of an expres-
Assignment sion and assigns the result to the variable.
%= Modulus R to L Divides the value of an expression by the value of a vari-
Assignment able and assigns the remainder to the variable.
*= Multiplication R to L Multiplies the value of an expression by the value of a
Assignment variable and assigns the result to the variable.
-= Subtraction R to L Subtracts the value of an expression from the value of a
Assignment variable and assigns the result to the variable.

Keyword Operators
Operator 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.

Object model overview


Anark 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

214 Anark Studio User Guide


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

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 scripting


Any 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.

User Reference 215


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

Chapter 10
Using 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 variables
It’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.

216 Anark Studio User Guide


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

Addressing objects and properties using scripting

Addressing objects and properties using scripting


As 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

User Reference 217


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

Chapter 10
Using 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 variables


When 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 scope
If 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 scope
Creating 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 keyword


The 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( )

218 Anark Studio User Guide


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

Creating dynamic properties for objects

{
var theShells = global._collisionShells || ( global._collisionShells =
[]);

if ( this.parent.intersect )
{
theShells[ theShells.length ] = this;
}

Creating dynamic properties for objects


All 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 objects


Dynamic 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.

User Reference 219


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

Chapter 10
Using 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 components


A 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 objects


If 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 handled


If 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.

220 Anark Studio User Guide


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

Understanding functions

Understanding functions
Behavior 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 functions
All 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 ++)
{

User Reference 221


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

Chapter 10
Using 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;
}

222 Anark Studio User Guide


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

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;
}
}
}

User Reference 223


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

Chapter 10
Using 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 behavior


As 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 functions


Event 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.

224 Anark Studio User Guide


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

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 Description Event Object
Event Properties
onUpdate Update The event handler executed every time the deltaTime – Accesses
scene is refreshed. The scene is updated a the amount of time in
maximum of 30 times per second on fast seconds since the scene
machines; on slower machines the refresh was last refreshed.
rate may be lower. This function has no
affiliation with objects or children. It is
executed continuously during playback.
onAttach Attach The event handler executed when a behav- object – A reference to
ior is attached to an object. the object that was
attached.
onDetach Attach The event handler executed when a behav- object – A reference to
ior is detached from an object. the object that was
detached.
onBuffered Media The event handler executed when a music, object – A reference to
video or image file has loaded enough the music, video or
information to make it ready to play or dis- image file that is being
play, but is not yet completed. For music or buffered.
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.
onMediaError Media The event handler executed when a music object – A reference to
or video file cannot properly load. the music or video file
that failed to load.
onMediaCom- Media The event handler executed when a music object – A reference to
plete or video file has finished playing. the music or video file
that is finished play-
ing.
onLoadProgress Loading The event handler fired continuously as a object – A reference to
Playback Module is loading. 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.

User Reference 225


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

Chapter 10
Using Scripting

Function Type of Description Event Object


Event Properties
onLoadError Loading The event handler triggered when a Play- object – A reference to
back Module cannot properly load. 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- object – A reference to
back Module has finished loading. 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.

226 Anark Studio User Guide


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

Event handler functions

Function Type of Description Event Object


Event Properties
onMouseDblClick Mouse The event handler fired when the mouse is object – A reference to
double-clicked on the parent object. the object to which the
onMouseClick Mouse The event handler fired when the mouse mouse event
button is both pressed and released while happened.
over the parent object. positionX – The X-axis
position of the mouse
onMouseDown Mouse The event handler fired when the mouse when the event was
button is held down over the parent triggered.
object. positionY – The Y-axis
onMouseUp Mouse The event handler fired when the mouse position of the mouse
button is released over the parent object. when the event was
onMiddleMouse- Mouse The event handler fired when the middle triggered.
Click mouse button is both pressed and released
Note: The Mouse
while over the parent object.
object can also be used
onMiddleMouse- Mouse The event handler fired when the middle to access the mouse
Down mouse button is held down over the parent position. See the sec-
object. tion on the “Mouse”
onMiddleMou- Mouse The event handler fired when the middle on page 287.
seUp mouse button is released over the parent
object.
onRightMouse- Mouse The event handler fired when the right
Click mouse button is both pressed and released
while over the parent object.
onRightMouse- Mouse The event handler fired when the right
Down 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- Mouse The event handler fired when the mouse
seOut 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- Mouse The event handler fired when the mouse
seOver 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. User Reference 227
Anark_Studio_User_Guide.book Page 228 Monday, March 19, 2007 10:34 AM

Chapter 10
Using Scripting

Function Type of Description Event Object


Event Properties
onMouseWheel Mouse The event handler fired when the mouse object – A reference to
wheel has been turned (spun) while the the scene object.
mouse is over the presentation window. mouseScroll – The dis-
The behavior that uses this event handler tance that the wheel
can be attached to any object in the scene button has rotated,
(including the Scene object). 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 keyCode – The ID of
is pressed. The behavior that uses this the key that triggered
event handler can be attached to any the event.
object in the scene (including the Scene keyChar – The alpha-
object). 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.

228 Anark Studio User Guide


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

Accessing event information

Function Type of Description Event Object


Event Properties
onKeyUp Key The event handler triggered when any key keyCode – The ID of
is released. The behavior that uses this the key that triggered
event handler can be attached to any the event.
object in the scene (including the Scene keyChar – The alpha-
object). 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.

Accessing event information


When 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.

User Reference 229


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

Chapter 10
Using Scripting

Working with mouse events and event bubbling


The 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.

230 Anark Studio User Guide


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

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 bubbling
There 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

User Reference 231


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

Chapter 10
Using 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 functions


The 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

232 Anark Studio User Guide


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

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 function


The 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 objects


The 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.

User Reference 233


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

Chapter 10
Using 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 statements


Conditional 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.

if
An 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;

234 Anark Studio User Guide


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

Using conditional statements

}
}

if/else
An 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;
}
}

switch
A 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

User Reference 235


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

Chapter 10
Using 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 loops
Loops 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.

for
A 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;
}

236 Anark Studio User Guide


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

How behaviors affect animation

while
A 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…while
The 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 animation


Behaviors 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 ( )

User Reference 237


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

Chapter 10
Using 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.

238 Anark Studio User Guide


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

How behaviors affect animation

User Reference 239


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

Chapter 10
Using Scripting

240 Anark Studio User Guide


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

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.

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

Scripting

Object
Scripting Object Reference 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.

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

Chapter 12
Scripting Object Reference

Asset
The 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.

244 Anark Studio User Guide


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

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.
Syntax
asset.attach ( assetObject )
Arguments
assetObject
The Asset object that will be attached.
detach Removes a previously attached asset from the asset.
Syntax
asset.detach ( assetObject )
Arguments
assetObject
The Asset object that will be detached.
copy Creates a copy and returns a new asset.
Syntax
asset.copy ( )
Arguments
N/A
fireEvent Executes the specified event. The fireEvent method, together with the
AKEvent object, allows you to create and execute custom events in scripting.
Syntax
asset.fireEvent ( eventObject )
Arguments
eventObject
The 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.
Syntax
asset.load ( inURL, noBufferSharing )
Arguments
inURL
The 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.
noBufferSharing
Optional. When set to true, specifies that the heavy buffer data from the
Playback Module being loaded will not be shared. Defaults to false.

Object Reference 245


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

Chapter 12
Scripting Object Reference

Asset Methods
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- For assets that have been frozen, this method will unfreeze the asset for one
Once 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.
Syntax
asset.registerMeltOnce ( Event )
Arguments
Event
The event to be listened for. Any event can be specified, including custom
events. More than one event can be specified.
Example
theAsset.registerMeltOnce ( "onMouseDown", "onMouseOver" );
unregisterMelt- For assets that have been set up to melt once using the registerMeltOnce
Once method, this method allows the asset to stop listening for the event.
Syntax
asset.unregisterMeltOnce ( Event )
Arguments
Event
The 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 );
}

246 Anark Studio User Guide


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

Scene

Scene
The 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:
Scene Properties
layers Returns the collection of layers that are a part of this scene.
presentation Returns the currently active Presentation object.
(deprecated)
background- Sets the background color for the scene.
Color

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;

Behavior
A 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:

Object Reference 247


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

Chapter 12
Scripting 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.
Syntax
registerForEvent ( inAsset, "inEventName", function )
Arguments
inAsset
The asset that will be listened to.
inEventName
The event to be listened for.
function
The function to be executed.
unregisterFor- Allows the object to which this behavior is attached to stop listening for an
Event event it has previously registered for.
Syntax
unregisterForEvent ( inAsset, "inEventName", function )
Arguments
inAsset
The asset that was being listened to.
inEventName
The event that was previously registered for.
function
The 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 );
}

248 Anark Studio User Guide


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

Material

Material
The 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 syntax
var theMaterial = new Material ( "sceneGraphName", attachToObject )
Return value
Returns the new material.
Arguments
sceneGraphName
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.

Object Reference 249


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

Chapter 12
Scripting Object Reference

Material Properties
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 = Solid
1 = Wireframe
2 = 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 = Normal
1 = Screen
2 = Multiply
3 = Overlay
4 = Bleach
5 = Ghost
6 = Saturate

Material Examples
// Create a new material.
theMaterial = new Material( "greenSpots", theModel );
theMaterial.opacity = 0.5;

Image
The 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 syntax
var theImage = new Image ( "sceneGraphName", attachToObject )
Return value
Returns the new image.
Arguments
sceneGraphName
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.

250 Anark Studio User Guide


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

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- Sets the horizontal tile mode of this image when used as a texture map.
riz 0 = Repeat
1 = Repeat with mirror
2 = No tiling

Object Reference 251


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

Chapter 12
Scripting Object Reference

Image Properties
tilingModeVert Sets the vertical tile mode of this image when used as a texture map.
0 = Repeat
1 = Repeat with mirror
2 = 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 Map
2 = Specular Map
3 = Emissive Map
4 = Light Map
5 = SuperCharge Map
6 = 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 Mapping
1 = Camera Projection
2 = Object Projection
3 = Environmental Mapping
mipmapMode Sets the sampling level of mipmapping done on the image.
0 = None
1 = Bi-linear
2 = Tri-linear
3 = Tri-linear Anisotropic
mipmapLOD- Sets the LOD range of the mipmap sampling. Values can be between -3.00
Bias and 3.00.
anisotropyDe- Gets or sets the level of anisotropy to use on the image when in Tri-linear
gree Anisotropic mode.
0 = Off
1 = Low
2 = Medium
3 = 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;

252 Anark Studio User Guide


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

Video

Video
The 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 syntax
var theVideo = new Video ( "sceneGraphName", attachToObject )
Return value
Returns the new video.
Arguments
sceneGraphName
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.

Object Reference 253


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

Chapter 12
Scripting Object Reference

Video Properties
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- Sets the horizontal tile mode of this video when used as a texture map.
riz 0 = Repeat
1 = Repeat with mirror
2 = No tiling
tilingModeVert Sets the vertical tile mode of this video when used as a texture map.
0 = Repeat
1 = Repeat with mirror
2 = 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 Map
2 = Specular Map
3 = Emissive Map
4 = Luminosity Map

254 Anark Studio User Guide


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

Music

Video Properties
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 Mapping
1 = Camera Projection
2 = Object Projection
3 = 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.
Syntax
video.seek ( position )
Arguments
position
The 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;

Music
A 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 syntax
var theMusic = new Music ( "sceneGraphName", attachToObject )
Return value
Returns the new music object.

Object Reference 255


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

Chapter 12
Scripting Object Reference

Arguments
sceneGraphName
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.
Syntax
music.seek ( position )
Arguments
position
The time in seconds that specifies how far into the music to seek.

256 Anark Studio User Guide


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

Node

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
Nodes 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.
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- Returns a matrix object describing the object’s position, scale, pivot and rota-
form tion in global space the last time the scene was updated.
positionVeloc- The three-element vector describing the velocity of the movement of the
ity 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.

Object Reference 257


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

Chapter 12
Scripting Object Reference

Node Methods
removeChildren Removes all the children of this node.
Syntax
node.removeChildren ( )
Arguments
N/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;

Layer
The 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 syntax
var theLayer = new Layer ( "sceneGraphName", "addToScene" )
Return value
Returns the new layer.
Arguments
sceneGraphName

258 Anark Studio User Guide


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

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- Controls whether or not the layer will be transparent. When transparent-
Background 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 );

Object Reference 259


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

Chapter 12
Scripting Object Reference

Camera
The 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 syntax
var theCamera = new Camera ( "sceneGraphName", attachToObject )
Return value
Returns the new camera.
Arguments
sceneGraphName
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.

260 Anark Studio User Guide


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

Light

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;

Light
The 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 syntax
var theLight = new Light ( "sceneGraphName", attachToObject )
Return value
Returns the new light.
Arguments
sceneGraphName
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:

Object Reference 261


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

Chapter 12
Scripting 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;

262 Anark Studio User Guide


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

Group

Group
A 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 syntax
var theGroup = new Group ( "sceneGraphName", attachToObject )
Return value
Returns the new group.
Arguments
sceneGraphName
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.

Object Reference 263


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

Chapter 12
Scripting Object Reference

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
The 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 syntax
var theModel = new Model ( "sceneGraphName", attachToObject )
Return value
Returns the new model.
Arguments
sceneGraphName
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:
Model Properties
materials Returns the collection of material objects attached to this model. This is read-
only.

264 Anark Studio User Guide


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

Model

Model Properties
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.

Object Reference 265


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

Chapter 12
Scripting 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.
Syntax
model.createPrimitive ( primitiveType, subType, resolution, 0 )
Arguments
primitiveType
The type of primitive to be created.
1 = Rectangle
2 = Sphere
3 = Cone
4 = Cylinder
5 = Cube
subType
Specifies 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.
resolution
A 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.
0
This is a placeholder for a currently undefined parameter. This must always
be set to 0.

266 Anark Studio User Guide


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

Model

Model Methods
intersect Used for collision detection, this function determines whether or not a
model has been “hit” by a specified point.
Syntax
outDistanceSquared = model.intersect ( useCulledFaces, globalOrigin, glo-
balDirection, distance, intersection, normal )
Return value
outDistanceSquared
Either 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.
Arguments
useCulledFaces
A Boolean specifying whether you want the model’s culled polygons to be
checked for collision. Culling is controlled by the culling property of
materials.
globalOrigin
A positional vector in the global 3D space that will be checked for collision
with the specified model.
globalDirection
A vector specifying the ray direction from the globalOrigin.
distance
A floating point number that defines the maximum distance from the global-
Origin for an acceptable hit.
intersection
Returns the positional vector that specifies the location in global space where
the intersection with the model has occurred.
normal
Returns 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.
Syntax
numVertices = model.getNumVertices ( )
Return value
numVertices
Optional. A variable name for the returned number.
Arguments
N/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.
Syntax
model.getVertex ( inIndex, vertexObject )
Arguments
inIndex
The index location of the vertex on the model whose values you want to
access.
vertexObject
The vertex object that will hold the vertex values.

Object Reference 267


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

Chapter 12
Scripting Object Reference

Model Methods
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.
Syntax
model.setVertex ( outIndex, vertexObject )
Arguments
outIndex
The index location of the vertex on the model to which you want to assign
the values.
vertexObject
The vertex object whose values will be used.
getVertexPosi- Gets the X, Y and Z coordinate information for a specified vertex on a model
tion 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.
Syntax
model.getVertexPosition ( inIndex, vectorObject )
Arguments
inIndex
The index location of the vertex whose values you want to access.
vectorObject
The vector object that will hold the position values.
setVertexPosi- Takes a vector object containing the X, Y and Z coordinate information from
tion 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.
Syntax
model.setVertexPosition ( outIndex, vectorObject )
Arguments
inIndex
The index location of the vertex on the model to which you want to assign
the values.
vectorObject
The 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.
Syntax
model.morph ( modelObject, amount )
Arguments
modelObject
The model to be matched.
amount
A 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%.

268 Anark Studio User Guide


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

Text

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
The 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 syntax
var theText = new Text ( "sceneGraphName", attachToObject )
Return value
Returns the new text object.
Arguments
sceneGraphName
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:
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.

Object Reference 269


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

Chapter 12
Scripting Object Reference

Text Properties
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.

270 Anark Studio User Guide


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

Sound

Text Properties
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
A 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 syntax
var theSound = new Sound ( "sceneGraphName", attachToObject )
Return value
Returns the new sound.
Arguments
sceneGraphName
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:
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.

Object Reference 271


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

Chapter 12
Scripting Object Reference

Sound Properties
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.
Syntax
sound.seek ( position )
Arguments
position
The 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();

Utility
A 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.

Color
The Color object encapsulates a four-component true color.
Constructor syntax
var theColor = new Color ( r, g, b, a)
Return value
Returns the new color.
Arguments
r
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

272 Anark Studio User Guide


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

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.
Syntax
newColor = color.copy ( )
Return value
newColor
A variable name for the copy of the color.
Arguments
N/A
add Adds the given color to the current color.
Syntax
color.add ( colorObject )
Arguments
colorObject
The Color object to be added to the current color.
subtract Subtracts the RGBA components of the given color from the current color.
Syntax
color.subtract ( colorObject )
Arguments
colorObject
The 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.
Syntax
color.blend ( colorObject )
Arguments
colorObject
The color to blend into the current color.

Object Reference 273


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

Chapter 12
Scripting Object Reference

Color Methods
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.
Syntax
color.negative ( )
Arguments
N/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.
Syntax
color.scale ( scaleFactor )
Arguments
scaleFactor
The 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.
Syntax
color.contrast ( contrastValue )
Arguments
contrastValue
The 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.
Syntax
color.saturation ( saturationValue )
Arguments
saturationValue
The weighting factor for altering the color’s saturation.

274 Anark Studio User Guide


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

Vector

Color Methods
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.
Syntax
color.linear ( targetColor, weightValue )
Arguments
targetColor
The Color object that is the target color.
weightValue
The weighting factor for the interpolation.
equals Calculates and returns whether or not the current color is equal to the given
color.
Syntax
isEqual = color.equals ( compareColor )
Return value
isEqual
A variable name for the returned value.
Arguments
compareColor
The 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;

Vector
A vector is a Utility object encapsulating the three floating point components X, Y
and Z.
Constructor syntax
var theVector = new Vector ( x, y, z )
Return value
Returns the new vector.
Arguments
x
Optional. The floating point value representing the X position.
y
Optional. The floating point value representing the Y position.

Object Reference 275


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

Chapter 12
Scripting 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.
Syntax
newVector = vector.copy ( )
Return value
newVector
A variable name for the copy of the vector.
Arguments
N/A
setVector Sets the X, Y and Z values of the vector to the values of the vector supplied as
an argument.
Syntax
vector.setVector ( vectorObject )
Arguments
vectorObject
The Vector object whose values will be used.
add Adds the given vector to the current vector.
Syntax
vector.add ( vectorObject )
Arguments
vectorObject
The Vector object to be added to the current vector.
subtract Subtracts the given vector from the current vector.
Syntax
vector.subtract ( vectorObject )
Arguments
vectorObject
The vector to be subtracted from the current vector.
set Sets the X, Y and Z values of the vector to the given values.
Syntax
vector.set ( X, Y, Z )
Arguments
X
Required. The floating point value representing the X position.
Y
Required. The floating point value representing the Y position.
Z
Required. The floating point value representing the Z position.

276 Anark Studio User Guide


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

Vector

Vector Methods
dot Calculates and returns the dot product of the current vector and the vector
supplied as an argument.
Syntax
product = vector.dot ( vectorObject )
Return value
product
A variable name for the returned product.
Arguments
vectorObject
The vector that is used to calculate the dot product.
scale Multiplies each component of the current vector by the given factor.
Syntax
vector.scale ( scaleFactor )
Arguments
scaleFactor
The 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.
Syntax
vector.cross ( vectorObject )
Arguments
vectorObject
The 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.
Syntax
isEqual = vector.equals ( compareVector )
Return value
isEqual
A variable name for the returned value.
Arguments
compareVector
The Vector object to be compared to the current vector.
length Calculates and returns the length (magnitude) of the current vector.
Syntax
vectorLength = vector.length ( )
Return value
vectorLength
A variable name for the magnitude of the vector.
Arguments
N/A
lengthSquared Calculates and returns the squared length (squared magnitude) of the current
vector.
Syntax
squaredVectorLength = vector.length ( )
Return value
squaredVectorLength
A variable name for the squared magnitude of the vector.
Arguments
N/A

Object Reference 277


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

Chapter 12
Scripting Object Reference

Vector Methods
normalize Normalizes the current vector, making it a unit vector.
The normalized vector is defined to be:
NormVector = vector / Magnitude(V)
Syntax
vector.normalize ( )
Arguments
N/A
distance Calculates and returns the distance between the current vector and the given
vector.
Syntax
vectorDistance = vector.distance ( compareVector )
Return value
vectorDistance
A variable name for the distance between the vectors.
Arguments
compareVector
The Vector object to be compared to the current vector.
distanceSquared Calculates and returns the squared distance between the current vector and
the given vector.
Syntax
squaredVectorDistance = vector.distanceSquared ( compareVector )
Return value
squaredVectorLength
A variable name for the squared distance between the vectors.
Arguments
compareVector
The 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.
Syntax
vector.maxVector ( compareVector )
Arguments
compareVector
The 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.
Syntax
vector.minVector ( compareVector )
Arguments
compareVector
The Vector object whose elements are tested against the current vector to
build the minimum.

278 Anark Studio User Guide


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

Vector2

Vector Methods
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 )
Syntax
vector.linear ( compareVector, interpParam )
Arguments
compareVector
The Vector object that acts as the second vector for the interpolation.
interpParam
A 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.
Syntax
vector.transform ( matrixObject )
Arguments
matrixObject
The 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;

Vector2
A 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 syntax
vector2 = new Vector2 ( x, y )
Return value
Returns 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.

Object Reference 279


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

Chapter 12
Scripting Object Reference

The Vector2 object has the following properties and methods:


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.
Syntax
newVector2 = vector2.copy ( )
Return value
newVector2
A variable name for the copy of the two-dimensional vector.
Arguments
N/A
set Sets the X and Y values of the two-dimensional vector to the given values.
Syntax
vector2.set ( X, Y )
Arguments
X
Required. The floating point value representing the X position.
Y
Required. 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.
Syntax
vector2.setVector ( vector2Object )
Arguments
vectorObject
The Vector object whose values will be used.

Vertex
Models 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 syntax
var theVertex = new Vertex ( )

280 Anark Studio User Guide


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

Rotation

Return value
The variable name of the vertex.
The Vertex object has the following properties:
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 ( );

Rotation
A rotation is a special kind of vector encapsulating the data and operations of three
angular components, X, Y and Z.
Constructor syntax
var theRotation = new Rotation ( x, y, z )
Return value
Returns the new rotation.
Arguments
x
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.

Object Reference 281


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

Chapter 12
Scripting 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.
Syntax
rotation.lookAt ( vector )
Arguments
vector
The vector the rotation object will look at.
Example
function 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.
Syntax
newRotation = rotation.copy ( )
Return value
newRotation
A variable name for the copy of the rotation vector.
Arguments
N/A
scale Multiplies each component of the current rotation vector by the given factor.
Syntax
rotation.scale ( scaleFactor )
Arguments
scaleFactor
The scale factor applied to each component of the rotation vector.
subtract Subtracts the given rotation vector from the current rotation vector.
Syntax
rotation.subtract ( compareRotation )
Arguments
compareRotation
The rotation vector to be subtracted from the current rotation vector.
add Adds the given rotation vector to the current rotation vector.
Syntax
rotation.add ( compareRotation )
Arguments
compareRotation
The rotation vector to be added to the current rotation vector.

282 Anark Studio User Guide


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

Rotation

Rotation Methods
maxVector Modifies the current rotation vector to contain elements that are the maxi-
mum between the given rotation vector and the current rotation vector.
Syntax
rotation.maxVector ( compareRotation )
Arguments
compareRotation
The 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.
Syntax
rotation.minVector ( compareRotation )
Arguments
compareRotation
The 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.
Syntax
isEqual = rotation.equals ( compareRotation )
Return value
isEqual
A variable name for the returned value.
Arguments
compareRotation
The 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 )
Syntax
rotation.linear ( compareRotation, interpParam )
Arguments
compareRotation
The rotation vector that acts as the second rotation vector for the interpola-
tion.
interpParam
A 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.
Syntax
rotation.transform ( matrixObject )
Arguments
matrixObject
The transformation matrix.

Object Reference 283


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

Chapter 12
Scripting Object Reference

Matrix
A 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 syntax
var theMatrix = new Matrix ( )
Return value
Returns 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.

284 Anark Studio User Guide


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

Matrix

Matrix Methods
copy Creates an exact copy of the Matrix object.
Syntax
newMatrix = matrix.copy ( )
Return value
newMatrix
A variable name for the copy of the matrix.
Arguments
N/A
set Sets the values of the matrix to the values of the matrix supplied as an
argument.
Syntax
matrix.set ( matrixObject )
Arguments
matrixObject
The 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.
Syntax
matrix.scale ( x, y, z )
Arguments
x
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.
Syntax
matrix.translate ( x, y, z )
Arguments
x
The floating point value representing the X component of the translation.
y
The floating point value representing the Y component of the translation.
z
The 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.
Syntax
matrix.rotate ( x, y, z )
Arguments
x
The X angle of rotation given in degrees.
y
The Y angle of rotation given in degrees.
z
The Z angle of rotation given in degrees.

Object Reference 285


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

Chapter 12
Scripting Object Reference

Matrix Methods
multiply Multiplies the current matrix by the given matrix. The given matrix is right-
multiplied into the current matrix.
Syntax
matrix.multiply ( matrixObject )
Arguments
matrixObject
The 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).
Syntax
matrix.transpose ( )
Arguments
N/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.
Syntax
matrix.invert ( )
Arguments
N/A
identity Resets the current matrix to an identity matrix.
Syntax
matrix.identity( )
Arguments
N/A

286 Anark Studio User Guide


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

Mouse

Mouse
The 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.

Object Reference 287


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

Chapter 12
Scripting Object Reference

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
The 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:

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.
Syntax
key.keyName.code
pressed Returns a Boolean indicating whether a key is pressed.
Example
if ( 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 );
}

288 Anark Studio User Guide


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

Window

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
The 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:

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
The 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:

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.

Object Reference 289


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

Chapter 12
Scripting Object Reference

Memory Methods
deleteUnuse- Deletes any dynamically created Library resources that are not currently
dResources 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.
Syntax
memory.sizeOf ( scriptObject, objectOnly )
Arguments
scriptObject
The script asset to be evaluated for memory usage.
objectOnly
Optional. 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] );

290 Anark Studio User Guide


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

AKEvent

AKEvent
The 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 syntax
var theEvent = new AKEvent ( "eventName" )
Arguments
eventName
The name of the event.
Return value
Returns 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.

Object Reference 291


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

Chapter 12
Scripting Object Reference

AKEvent Properties
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;
}

Miscellaneous
There 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.

292 Anark Studio User Guide


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

Presentation

Presentation
The 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.
Syntax
value = presentation.isBuffered ( "libraryResource" )
Return value
value
Optional. A variable name for the returned Boolean.
Arguments
libraryResource
The 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.
Syntax
presentation.fireEvent ( eventObject )
Arguments
eventObject
The 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;
}

Object Reference 293


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

Chapter 12
Scripting Object Reference

TimeContext
The 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.

294 Anark Studio User Guide


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

Player

TimeContext 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.
Syntax
timeContext.activateSlide ( slideName )
Arguments
slideName
The 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
The 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:

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.

Object Reference 295


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

Chapter 12
Scripting Object Reference

Player Properties
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- The version number of the Container, which is the application that is execut-
sion ing the presentation.
container Returns the Container object.
platform Returns the computer platform the player is on.
Win32 = Microsoft Windows
platformVer- Returns the version of the platform the player is on. For Windows, it will
sion return one of the following:
4.0 = Windows 95
4.10 = Windows 98
4.90 = Windows ME
5.0 = Windows 2000
5.1 = Windows XP
Additional 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.

Container
The 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:

296 Anark Studio User Guide


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

Container

Container Methods
launch Available only for the AnarkMediaPlayer container, this method will launch
a properly specified application and, optionally, a file.
Syntax
player.container.launch ( "command line", flags )
Arguments
command line
The 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 )
flags
Currently 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 )
}
}

Object Reference 297


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

Chapter 12
Scripting Object Reference

XMLNode
The 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 syntax
var XMLNode = new XMLNode ( )
Return value
Returns 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.
Syntax
XMLNode.addNode ( inNode )
Arguments
inNode
The 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.
Syntax
XMLNode.removeNode ( inNode )
Arguments
inNode
The XMLNode object to be removed from this XMLNode.

298 Anark Studio User Guide


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

XMLNode

XMLNode Methods
getNode Returns the specified node.
Syntax
node = XMLNode.getNode ( node )
Return value
nodeData
Optional. A variable name for the returned node object.
Arguments
node
A string or integer that specifies the node you want to get.
copyNode Copies this node and all of its children.
Syntax
node = XMLNode.copyNode ( )
Return value
node
Optional. A variable name for the copy.
getAttribute Returns the specified attribute’s data.
Syntax
attributeValue = XMLNode.getAttribute ( inAttribute )
Return value
attributeValue
Optional. A variable name for the attribute’s value.
Arguments
inAttribute
The attribute. The attribute can be specified by name or by index.
setAttribute Overwrites the specified attribute’s data with the given value.
Syntax
XMLNode.setAttribute ( inAttribute, inValue )
Arguments
inAttribute
The attribute to be overwritten. The attribute can be specified by name or by
index.
inValue
The new value specified as a string.
addAttribute Adds the specified attribute name and value to this XMLNode object.
Syntax
XMLNode.addAttribute ( name, value )
Arguments
name
The name for the new attribute.
value
The new value specified as a string.
removeAt- Removes the specified attribute from this XMLNode.
tribute Syntax
XMLNode.removeAttribute ( inAttribute )
Arguments
inAttribute
The attribute to be removed, specified by either name or index.

Object Reference 299


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

Chapter 12
Scripting Object Reference

XMLNode Methods
toString Converts the data contained within the XMLNode, including child nodes
and attributes, to an XML string.
Syntax
string = XMLNode.toString ( )
Return value
string
Optional. A variable name for the string.

XML
The 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 syntax
var XML = new XML ( inString )
Return value
Returns the new XML object.
Arguments
inString
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:
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.

300 Anark Studio User Guide


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

XML

XML Methods
load Loads the specified XML document.
Syntax
XML.load ( inURL )
Arguments
inURL
The 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.
Syntax
XML.post ( inURL )
Arguments
inURL
The 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.
Syntax
XML.parse ( inString )
Arguments
inString
The 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- This function is called when an XML document has finished loading. It can
plete 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.

Object Reference 301


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

Chapter 12
Scripting 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" );
}

302 Anark Studio User Guide


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

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

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

Appendix A: Supported Media


Formats
A
Anark Studio currently supports the following media
formats:
Media Formats File Extensions
3D objects .amx, .3ds, .dae
Sound files .ogg (Ogg Vorbis), .wav, .aiff/.aif
Video types Windows Media: .avi, .asf, .wmv
QuickTime: .qt, .mov
MPEG Audio: .mp2, .mp3
MPEG Audio/Video: .mpg, .mpeg, .m1v, .mpe
Image files .png, .tga, .tif, .psd, .bmp, .jpg
Behavior scripts .bvs
Anark component .amc

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
305
Anark_Studio_User_Guide.book Page 306 Monday, March 19, 2007 10:34 AM

Appendix A
Supported Media Formats

Windows.

306 Anark Studio User Guide


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

Appendix B: Shortcut Keys B


A number of keyboard shortcuts are available to make work-
ing in Anark Studio easier.

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

Appendix B
Shortcut Keys

File Menu
Command Keyboard Shortcut
New Ctrl + N
Open Ctrl + O
Save Ctrl + S
Import Resource Ctrl + R
Preview in browser or Anark Player F12
Shift + Enter
Export Ctrl + Shift + S

Edit Menu
Command Keyboard Shortcut
Undo Ctrl + Z
Redo Ctrl + Y
Ctrl + Shift + Z
Cut Ctrl + X
Copy Ctrl + C
Paste Ctrl + V
Duplicate object Ctrl + D
Edit Project Settings Ctrl + P

View Menu
Command 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

308 Anark Studio User Guide


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

Script Menu
Command 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 Menu
Command Keyboard Shortcut
Set keyframe(s) F6
Enable/Disable Autoset keyframes K

Help Menu
Command Keyboard Shortcut
Open the Assistant palette F1

Selection Keys
Command 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

Learning Anark Studio 309


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

Appendix B
Shortcut Keys

Playback Keys
Command Keyboard Shortcut
Play presentation Enter/Return
Space 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.
The following table lists the keyboard
shortcuts that you can use to quickly
switch the edit camera view.

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
When some Edit Camera tools are Project window will change to the
enabled, you can temporarily enable a currently enabled tool. The following
different tool by holding down modifier table lists how the keys affect the
keys. The Edit Camera tool icon in the currently selected tool.

Currently Selected Edit Camera Tool


Modifier Fit Selected Edit Camera Edit Camera Edit Camera Shading
Key * Pan Zoom Orbit 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.
These mouse button shortcuts are also
available for selecting the edit camera
tools:

310 Anark Studio User Guide


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

Desired Edit Camera Tool Mouse selection


Pan Middle mouse (click and drag)
Zoom Middle mouse scroll
Orbit Alt + middle mouse (click and drag)
These keyboard shortcuts are available drag and click affects the currently
for changing quickly how a left mouse selected object:

Transform Selected Object Keys


Command Keyboard Shortcut
Rotate tool R
Move tool W
Scale tool E
Constrain dragging to one axis Shift + drag

When any Transform tool is enabled, change to the currently enabled tool.
you can temporarily enable a different The following table lists how the keys
tool by holding down modifier keys. The affect the currently selected tool:
tool icon in the Project window will
Currently Selected Transform Tool
Modifier Key Rotate Position Scale
Alt Scale Scale Rotate
Ctrl Position Rotate Position

Learning Anark Studio 311


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

Appendix B
Shortcut Keys

Nudge Selected Object Keys


Command Keyboard Shortcut
Nudge Position
Left (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 Rotation
X+ 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 Scale
X+ 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 Keys
Command 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 Shift + drag
while dragging with the mouse

312 Anark Studio User Guide


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

Delete Selected Object Keys


Command Keyboard Shortcut
Delete object Delete
Backspace

Timeline Scaling Keys


Command Keyboard Shortcut
Zoom in +
Ctrl + scroll mouse wheel up
Zoom out -
Ctrl + scroll mouse wheel down

Timebar Resizing Keys


Command Keyboard Shortcut
Move start handle to current location of Ctrl + [
Playhead
Move start handle of this object and all of [
its children to current location of Playhead
Move end handle to current location of Ctrl + ]
Playhead
Move end handle of this object and all of ]
its children to current location of Playhead

Inspector Tab Shortcuts


Command 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 Shortcuts


Command Keyboard Shortcut
Expand or close up all items Shift + double-click on the object icon

Learning Anark Studio 313


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

Appendix B
Shortcut Keys

314 Anark Studio User Guide


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

Appendix C: Key Names C


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.

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

Appendix C
Key Names

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

316 Anark Studio User Guide


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

Property Name Return Value Keyboard Label


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

Learning Anark Studio 317


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

Appendix C
Key Names

Property Name Return Value Keyboard Label


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 “

318 Anark Studio User Guide


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

Scripting Glossary Glossary

This section defines some commonly used terms in scripting


as well as some terminology that is specific to Anark Studio.

Arguments
Arguments 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.

Array
An 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

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

Glossary
Scripting Glossary

sphereColor array is automatically set to Scripted behaviors are the only way to
4 because there are four entries, but if create interactive elements in a project.
you added two more values to the array, They can also be used to add procedural
it would update the length property to 6. animation (i.e., animation based on
You can optionally preset the length mathematical formulas) to your project.
property for the array by passing it as an Animation created in the Anark Studio
argument to the array constructor: interface uses static keyframes that
control a single parameter for a single
var sphereColor = new Array (4); moment in time. Procedural animation
This creates an array with four empty allows you to create dynamic keyframes
index entries, but again, the length that can change based on runtime
property will be incremented if more information.
than four entries are set for it later on.
Child
Note, however, that the length property
In the Anark Studio object model hier-
only goes up. It won’t be reduced if only
archy, a child is an object that is
two entries are set for it. In that case, it
attached directly to a parent object,
will have two empty entries in addition
which influences some of its properties.
to the ones that have been set. Short of
Child objects can have children attached
deleting the array or assigning it the
to them.
value null, the number of elements in an
array cannot be reduced, so be conserva- Clipping plane
tive when assigning a length to an array. A clipping plane is a plane that is vertical
You can call on the length property of to the line of sight beyond which objects
the array to control the behavior of all disappear. The near clipping plane
the members of the array. The following defines the point at which objects
line of code evaluates the length prop- moving towards camera will disappear.
erty of the sphereColor array and assigns The far clipping plane defines the point
the number 4 to the variable numColors: at which objects moving away from the
var numColors = sphereColor.length; camera will disappear.

Asset Conditional
An asset is any of the predefined objects, Conditional statements allow your
including Music, Material, Animation- scripts to make decisions about what
Track, Image, Node and Scene, that are code to execute based on current condi-
the fundamental building blocks of tions. Conditionals (if, if…else, ?:
Anark Media. Assets serve as resources and switch) contain one or more
for scripting content. expressions that evaluate to either true
or false. The decision about what code to
Behavior execute next is based on the outcome.
Behavior scripts are chunks of code (in function onAttach()
the form of a script) that tell the objects {
they are attached to what to do and var playedBefore = false;
when to do it. Some common interactive if ( (currentTime >= 5) &&
behaviors include buttons, linking, ( playedBefore == false ) )
menus, toolbars, key commands, etc. {

320 Anark Studio User Guide


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

this.LoopMusic.play(); Function
playedBefore = true; A function is a procedure that is defined
} once and can be executed multiple times
} by a program. Functions act on and
This if statement evaluates whether the return data. A function definition looks
current time (currentTime) is greater like this:
than or equal to 5 seconds. It then
checks to see if playedBefore is false. If function onMouseDown(inEvent)
{
both conditions match, it plays the
this.parent.rotation.x += .05;
music and sets playedBefore to true, }
which then invalidates the if A function is invoked and is passed
statement. information by enclosing it in paren-
For more information about condi- theses ( ). A function stored as the prop-
tionals, see “Using conditional state- erty of an object is called a method.
ments” on page 234. For more information about using and
creating functions, see “Creating func-
Culling
tions” on page 221.
Culling is the process of eliminating the
polygons that face away from the viewer Group
and therefore can’t be seen. Culling A group is an object that acts as a simple
speeds up the rendering of the scene, placeholder for other objects. Groups are
since all those unseen polygons use up used to organize complex data and move
valuable processing power. sets of nodes such as models as though
they are one.
Event Handler
Event handlers are predefined functions Components, which are created from
that provide cues for the action and groups, are slightly more complex in
interactivity of a scene. They include that they work together with the Time-
mouse events such as onMouseDblClick Context object to provide an indepen-
and onMouseDown, keypress events dent clock for an object or group of
such as onKeyDown, and system-wide objects.
functions such as onUpdate and
onAttach. Image
An Image object is the equivalent of an
For more information about event image or material map in 3D modeling
handlers, see “Event handler functions” programs. Image maps are used to create
on page 224. the look of a texture on objects (e.g.,
stone, clouds, checkered, etc.) or to map
Expression
a 2D graphic such as a still photo or even
An expression is a piece of the script that
a video clip to the object’s surface.
can be evaluated by the script interpreter
to generate a value. The value can be of Layer
any valid data type (number, string, A layer is an object that allows you to
Boolean, etc.). An expression can group the elements of the scene in a
perform a calculation, manipulate char- special way. Layers in Anark Studio are
acters, call a function or test a value. similar to the layers used in many 2D

Learning Anark Studio 321


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

Glossary
Scripting Glossary

graphic design programs. In 2D graphics, work much like behaviors. They can be
layers are rendered like stacked sheets of attached to objects, but other objects
acetate. The content of each layer cannot be attached to them. The data
remains distinct from the content of contained in Music objects is streamed
other layers, but the final image is a rather than embedded in the final
composite of all the layers. presentation like Sound objects are.
3D layers in Anark Studio are used in a
Node
similar way, but instead of being
A node is a particular type of asset that is
rendered like sheets of acetate, they are
physically present in a scene and can
rendered like a stack of glass blocks. Each
therefore be manipulated visually. A
block contains a 3D scene with elements
node can contain other nodes. Nodes
that interact with each other, but not
include models, cameras, lights, groups,
with the elements of the other layers.
sounds and layers.
Objects in one layer never penetrate into
another layer no matter how far you Object
move them backward or forward. An object is a compound data type that
contains any number of properties and
Material
methods. Dot syntax (.) is used to access
A material is an object that specifies the
a named property or method of an
surface appearance of a model. A mate-
object.
rial controls the color, shininess and
opacity of a model, among other things. Object Model
Material blending modes are used to The object model is a kind of hierar-
specify how the material will be mixed chical mapping of parent-child relation-
with the other elements of the scene. ships used in both the Anark Studio
Images can be attached to materials to interface and behavior scripts to address
create patterns or to map a 2D graphic to and operate parent and child objects in a
the object’s surface. scene. These parent-child relationships
allow you to set up animation parame-
Method
ters and interactive behaviors for groups
A method is a function that is a property
of objects with a single setting and to
of an object. Methods control the
animate objects in relation to other
behavior of objects.
objects. This object model is used to
Model represent the scene at a given point in
A model is a 3D mesh object. Models can time. For more information about the
be created in other applications such as object model hierarchy, see the “Object
3ds max, or simple primitives can be model overview” on page 214.
created using the buttons on the Basic
Operator
Objects tab.
Operators are terms and symbols that are
Music used to calculate a new value from one
A Music object is a type of asset that or more values. Examples include the
contains a song or music clip. In the addition operator (+), the division oper-
object model hierarchy, Music objects ator (/) and the equality operator (==).

322 Anark Studio User Guide


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

Parameter Scene Graph


A parameter is a value that is a variable A scene graph is the outline of a scene
of an object and that is available to the that represents the object-to-object
Anark Studio interface. Parameters are a parent-child relationships.
subtype of properties. Examples of
parameters include position, opacity and Scope
rotation. Objects have built-in parame- The scope of a variable is its accessibility
ters provided by Anark Studio, and you from other points in the behavior script
can create new parameters for objects or the presentation. Variables can have
using scripting. two levels of scope: local to a function
and local to a behavior. If a variable is
Parent created with function-level scope, it will
In the Anark Studio object model hier- be available only to the function that
archy, a parent is an object that influ- contains it. A variable created with
ences some of the properties (e.g., behavior-level scope can be accessed
position, rotation, duration) of one or anywhere within a behavior script, no
more children that are directly attached matter what function is being called.
to it.
Sound
Property A Sound object is a type of asset that
A property is a value that is a variable of contains an audio clip. Sounds can be
an object. It includes both parameters attached to objects, but other objects
and any variables that are not published cannot be attached to them. Unlike
to Anark Studio. In addition to the built- Music objects, sounds are embedded in
in properties provided through Anark the final presentation.
scripting, you can create new properties
for objects. For a complete list of the Statement
built-in properties for the different A statement is a combination of expres-
object types, see “ Scripting Object Refer- sions that carry out one complete task.
ence” on page 243. It includes one or more expressions,
keywords or operators. In general, each
Root new line begins a new statement. A
A root is an object at the top of the hier- semicolon (;) is used to explicitly termi-
archy. Root objects can have children, nate a statement.
but no parents. The scene is the root
object in Anark Studio. TimeContext
A TimeContext is an object that provides
Scene the clock for a component and its chil-
The scene is the root object in the Anark dren. Components are parent containers
Studio object model hierarchy. The for one or more objects that are assigned
scene encompasses the overall 3D space an independent time context. Each time
in which a project takes place. 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

Learning Anark Studio 323


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

Glossary
Scripting Glossary

TimeContexts simplify the process of that is calculated by a mathematical


creating intricate, repetitive animations formula. In the second line, the variable
and interactive behaviors. difx can be used as part of an expres-
sion that will generate a value for the
Utility variable stopx.
A utility is an object that either accesses
var difx = ( ( Mouse.x - 770 ) / 3
data about the project (mouse and ) - this.parent.rotation.y;
window) or manipulates objects in the var stopx = difx / 15;
project (vector, color and rotation). For more information about creating
variables, see “Using variables” on
Variable
page 216.
A variable is the name you give to a
concept to represent a piece of data. Video
When you use a variable, you are really A video is an object that contains a video
calling on the data that it contains. The clip that Anark Studio can stream. It
data assigned to a variable can – and works much like an Image object, in that
often does – change. You must declare a it must be attached to a material on a
variable before using it. In the first line model in order to be displayed.
of the following example, the variable
difx serves as a placeholder for the data

324 Anark Studio User Guide


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

Index Index

Symbols master slide 135


. (dot syntax) 204 object properties
; (semicolon) 205 using scripting 217
= (assignment operator) 205 using the Object outline 63
== (equality operator) 205 actions
() (parentheses) 205 copying 130
{}, curly braces 204 creating 120
keyboard shortcut for viewing 308
Numerics order of 130
3D files overview 120
guidelines for importing 37 selecting 125
See also models types of 125
3D objects 305 Actions tab 120
3D Orthographic View 12 active camera, setting 150
3D Perspective View 12 active light, setting 262
3D scene 258 Active toggle
.3ds file extension 39, 305 for actions 130
.3ds file format 36 for objects 64
3ds max ActiveX
guidelines to follow 37 Container object 296
troubleshooting 44 control methods and properties 189
adding
A actions 120
absolute path Anark Media to an existing HTML file 186
for objects behaviors to components 140
in an action 122 behaviors to the project 52
in scripting 217 folders to the Storage tab 25
for streaming media 166 keyframes 152
of remote source 109 objects to components 140
accessing objects to the project 52
Behavior Reference 27 using the Storage tab 25
edit cameras 12 palettes 11

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

Index

resources to the Library 25 AnarkMediaPlayer Container object 296


slides 134 Animatable property of custom
streaming media files 167 properties 77
addressing objects using scripting 217 animating objects 145
.aiff/.aif file extension 305 Animation toggle 29, 146
AKEvent object 291 anisotropic filtering 110
alert in scripting (as anisotropyDegree) 252
action 126 .app file extension 176
global function 207 application default settings, restoring 19
alignment of text 89 application preferences, setting 17
in scripting 270 application, launching another 297
alpha channel arguments for object constructors 319
definition of 43 arithmetic operators 213
included in .png files 43 array data type 207
used in rendering images 108 array object, definition of 319
.am file format 176 arrow keys 317
Ambient Color .asf file extension 305
of lights 95 aspect ratio 21
in scripting 262 controlling from command line 193
of materials 103 controlling from configuration file 194
in scripting 249 See also Fixed aspect ratio
.amc file extension 60, 305 Asset objects
.amc file format 56 definition of 320
.amw file extension 10 description of all 244
.amx file extension 305 assets
.amx file format 36 customizing properties 75
Anark Client melting 234, 246
control panel 196 See also objects
end user plug-in 5 assignment operators 214
opens .AM files 176 Assistant palette
Anark Media keyboard shortcut for viewing 308
.am file type 176 offline/online toggle 7
embedding in an existing HTML file 186 portal to useful resources 31
file type 176 attach events 123
licensing 23 attaching
overview of 5 assets in scripting 245
playing/pausing 197 behaviors to objects 53
saving a component as 60 layers to the scene 53
Anark Media Component (.amc file objects
type) 60 to layers 53
Anark Media Workspace (.amw file to objects 53
type) 10 attachments
Anark Player affect of pivot points on 50
command line options for 192 changing 64
configuration options for 192 creating 53
exiting 297 overview of 49
exporting a project to 177 audio
features of 195 streaming 165
preparing a project for 195 See also music
selecting as previewing application 23 author, acknowledging 23

326 Anark Studio User Guide


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

Auto Start behaviors


music 115 adding to components 140
presentations on a CD-ROM 191 adding to the Library 27
sound 115 adding to the project 52
video 114 attaching to an object 53
See also AutoRun compiling 74
autokeyframing 154 creating custom scripts 72
automapping custom parameters of, creating 75
image to a model 104 definition of 23
video to a model 113 duration of 148
AutoRun editing in Anark Studio 73
Autorun.inf file 191 effect on animation 237
include command line options 192 exporting to .bvs file 74
Autoset Keyframes 154 importing 51
.avi file extension 176, 305 overview 72
AVI files, troubleshooting 42, 44 parent property of 224
axes, three 50 recently created, now available 7
scrubbing won’t display 160
B selecting 61
Back View edit camera 12 setting properties for 116
Background Color sharing with others 74
of layers 85 updating after editing 74
in scripting 259 updating the Library resource 55
of Project window 19 See also scripts
of scene 84 Bezier keyframes. See smooth keyframes
in scripting 247 bi-linear filtering 110
of splash screen on Web 186 bit depth of videos 44
of text 89 Bleach blending mode 102
in scripting 271 in scripting 250
backspace key 316 Blending Mode, of materials 100
backward slash key 318 in scripting 250
Balance .bmp file extension 305
music 115 BODY tag in HTML 199
in scripting 256 Boolean
sound 115 behavior parameter 76
in scripting 272 data type 206
video 253 border color
basic objects in Anark Player
adding to the project 53 setting from command line 193
keyboard shortcut for viewing 308 setting in configuration file 194
Basic Objects tab 24 in HTML 186
beep setting in GUI 22
action 127 Bottom View edit camera 12
global function 208 bounding boxes
Behavior object 247 disabling 61
Behavior Reference Library, how to keyboard shortcut for viewing 308
access 7 breadcrumbs 32, 138
Behavior Reference, how to access 27 break keyword 235
Behavior scope 218 Brightness of lights 94
behavior script parameters, editing 75 in scripting 262

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

Index

bubbling choosing for video export 179


cancelling 231 guidelines for using 41
of mouse events 230, 292 collaboration 56
buffering Collada
data 125 Collada format 36
images 169 Collada FX 40
music 256 ColladaMax 36
streaming media 168 ColladaMaya 36, 39
.bvs file extension 72 collapsing
.bvs files, exporting scripts as 74 object contents 63
property groups 82
C color
Camera object 260 background color
Camera Projection mapping for images 105 of layers 85
cameras of layers in scripting 259
active, assigning 150 of scene 84
edit cameras 12 of splash screen on Web 186
properties of 90 of text 89
in scripting 260 of text in scripting 271
Caps Lock, event property 292 behavior parameter 77
case labels in switch statements 235 border in Anark Player
case sensitivity, in scripts 205 setting from command line 193
CD-ROM setting in configuration file 194
installing Anark Studio from 6 border in HTML 186
preparing Anark Media files for 190 choosing 116
changing HSL model 116
object attachments 64 materials, changing 103
order of objects 64 object, in scripting 272
Project window size 20 properties of objects, setting 116
See also editing RGB model 116
child object text 87
affected by its parent object, example 149 in scripting 270
attached to parent object 49 timebar, changing 148
definition of 320 Color object 272
Cinema 4D, guidelines to follow 39 command line for Anark Player 192
CLASSID attribute for HTML 185 comment text 148
cleaning up the Library 27 community forum 8
clipping company, acknowledging 23
comparison of near and far plane 320 Compile button 74
of text 86 components
plane, definition of 91 adding objects to 140
Clipping End 91 copying objects to 140
in scripting (as clipFar) 260 creating 138
Clipping Start 91 duration of 139
in scripting (as clipNear) 260 exporting 60
clockwise (culling) 103 importing 60
closing a behavior 74 keyframing 152
CODEBASE attribute for HTML 185 loading dynamically 132
codecs refreshing 56
affect behavior of AVI files 44 replacing 58

328 Anark Studio User Guide


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

in scripting 294 custom parameters for behaviors 75


setting properties for 117 functions 221
compression objects in scripting 215
setting for video export 42, 179 projects 47
still images 109 slides 134
video images 41 variables in scripting 216
Compression Type 42 Cue
conditional statements music 116
definition of 320 sound 115
if statements 234 video 114
if/else statements 235 culling
switch statements 235 clockwise versus counterclockwise 103
using in scripts 234 definition of 103, 321
Cone Angle 95 objects using Distance Fade 96
in scripting (as outerConeAngle) 262 in scripting 263
configuration file, for Anark Player 192 curly braces, using in scripts 204
confirm global function 208 Current Slide action
Connect to Source in scripting 295
property of images 109 current slide, shown in parentheses 139
property of video 114 current time display 32
Constrain proportions, of project cursor
window 21 icons available 287
Container object 296 property of Mouse 287
in scripting (as container) 296 custom parameters, creating in scripts 75
miscellaneous object type 292
contextTime property 294 D
contextType property 294 .dae file extension 39, 305
continue keyword 236 data types
Continuous Capture of video 179 array 207
control key 292, 317 Boolean 206
coordinate system 50 null 207
Copy Object Path 63 numbers 206
copying object 207
actions 130 strings 206
assets in scripting 245 undefined 207
keyframes 156 debugging
objects Anark Client 196
to a component 140 using output global function 208
in the Object outline 58 Default Interpolation 18
path to an object 63 default keyword in switch statements 235
project to a new location 10 default settings
slides 134 overriding with keyframes 152
counterclockwise (culling) 103 resetting for the program 19
createPrimitive 266 degree, of anisotropy 110
creating Delete Channel Keyframe(s) 155
actions 120 Delete Item 65
attachments between objects 53 delete key 317
colors 116 delete keyword 214
components 136 deleting
custom behavior scripts 72 actions 120

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

Index

folders from the Storage tab 25 objects behind a layer 85


keyframes 155 palettes 11
layers in scripting 247 pivot points 50
objects 65 prompts 208
resources 27 timebar handles 148
slides 134 tool tips 30
source files 55 See also previewing the project
Time Labels 132 Distance Fade 96
unused resources 27 in scripting 263
variables 207 distributing a presentation 183
deltaTime, event property 291 distribution formats, choosing 176
Depth text 86 do...while loop 237
Depth Write, on materials 103 Document Object Model (DOM) 214
deselecting objects 61 dot syntax 204
detaching assets from assets Double Sided property of materials 103
using actions 126 dragging an object 311
using scripting 245 in scripting 231
Diffuse Color duplicating
of lights (as Light Color) 94 objects 58
of lights in scripting 262 slides 134
of materials 100 See also copying
guidelines for importing 41 duration
in scripting 249 of music 256
Diffuse Map for images of objects and behaviors 148
guidelines for importing 41 of sound 272
shown in illustration 105 of video capture 179
Directional light of the project 59
compared to other types of light effect of timebars on 148
sources 93 dynamic
in scripting, as source 262 keyframes 159
DirectX loading 132
floating-point math 19
second choice for renderer 175 E
Display Name, for custom properties 76 Ease In 158
Display Properties for screen savers 180 Ease Out 158
displaying Edit Asset 72
alerts 207 Edit Camera tools 16
confirmations 208 edit cameras
current time 31 list of all 12
help strings mouse and keyboard shortcuts 16, 310
for custom events 79 editing
for custom function properties 78 behaviors 73
for custom parameters 77 comment text 148
highlights on materials 103 components 138
line numbers for scripts 74 folders on the Storage tab 25
object parameters 29 keyframes by overriding existing ones 154
objects as one- or two-sided 103 Master slide 135
in scripting (as culling) 249 source files 55
objects as wireframe or solid 103 Time Labels 132
in scripting (as fillMode) 250 See also setting properties of objects, un-

330 Anark Studio User Guide


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

locking object properties exposing parameters in scripts 75


Embed Fonts 22 expression, definition of 321
embedding Anark Media in HTML files 186 External Command
Emissive Map for images 106 action 127
Emissive Power of materials 100 global function (as
in scripting 249 externalCommand) 209
Enable Specularity property of
materials 103 F
in scripting 249 F12 key, for previewing 174
End of Fog 92 F6 key, for keyframing 154
Enter key 316 F7 key, for compiling behaviors 74
Environmental mapping for images 105 fading models
equality, testing for 213 in scripting 263
escape key 317 various options 96
escaping paths in scripts 212 Field of View 91
event handler in scripting (as fov) 260
built-in functions 221 file extensions
custom written 79 created during export 176
events created during preview 174
bubbling 230 See also media formats, supported
built-in filter buttons 32
key events, properties of 228-229 Find button 74
list of 224 finding instances and resources 62
mouse events, properties of 227 Fire Event action 126
system events, properties of 225 firing events 245
event information, accessing 229 Fixed aspect ratio. See Scale Mode
firing 245 Fixed size. See Scale Mode
HTML 186 Flat text
.exe file extension 176 how it is rendered 86
executable files how it is scaled 21
configuring and exporting to 182 Float behavior parameter 76
Execute Scriptlet action 129, 224 fog
Expand/Collapse arrow enabling for cameras 92
object outline 63 in scripting 260
property group 82 Fog Color 92
Exponential Fade 95 in scripting 260
in scripting 262 folders on the Storage tab 25
exporting fonts
to Anark Player (.am) 177 embedding 22
behaviors in Anark Studio 74 setting for text 87
components 60 in scripting 270
models from 3ds max 41 for loops 236
models to AMX format 41 force hardware/software option 22
objects formats. See media formats, supported
effect of Active button 64 Forum 8
effect of active flag 244 forward slash key 318
presentations 176 FPS (Frames Per Second) 179
to projector 182 frames rendered, total number 296
to screen saver 180 Front View edit camera 12
to video 178 frozen objects

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

Index

definition of 233 Help files, how to access 7


how they behave 244 help key 317
Full Perspective text 87 Help String
function scope of variables 218 for custom events 79
functions for custom function properties 78
definition of 321 for custom properties 77
event handlers 224 help tips, displaying in Inspector 30
accessing event information 229 hexadecimal numbers, as data types 206
global 207 hiding
overview 221 line numbers for scripts 74
syntax of 221 objects 64
funtion keys 317 behind layers 85
palettes 11
G pivot points 50
Ghost blending mode 102 timebar handles 148
in scripting 250 using the Shy button 64
.gif file extension 305 hierarchy
global functions 207 of object model in scripting 214
global keyword 218 of objects in Anark Studio 50
Go to Label action 130, 132 highlights. See Specular Enable
Go to Slide action 130 Horizontal Alignment of text 89
in scripting (as activateSlide) 295 in scripting 270
Go to Time action 129 Horizontal Scroll of text 89
graphics unique identifier (GUID) 57 in scripting 270
graphics. See images HTML
Group object 263 ActiveX methods and properties 189
Group select 309 events 186
groups exporting as
in scripting 263 using the interface 177
properties of 95 global functions for 207
GUIDs 57 parameters, editing 184
scripting in
H using externalCommand 209
handles for timebars 148 using navigate 210
Headers HTML parameter 128, 210 .html file extension 176
height HTTP headers 128
of Anark Player window hue, of colors 116
set from command line 193
set from configuration file 194 I
of exported video 178 ID attribute for HTML 185
of layers 85 identity matrix 284
in scripting 259 if statement 234
of presentation in Anark Player if/else statement 235
setting from command line 193 image map
setting from configuration file 194 definition of 37
of presentation in HTML document See images
using OBJECT tags 185 Image object 250
of presentation in HTML page 186 definition 321
of project window 21 Image Opacity 108
height-to-width ratio 21 Image Size Reduction 108

332 Anark Studio User Guide


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

images application default setting 18


applied to material, appears to have a setting 157
seam 43 intrinsic objects
automapping to a model 104 Anark Studio 212
compressing 109 JavaScript 211
dynamically loading 169 invisible video, troubleshooting 43
guidelines for applying to .3ds models 38 Item Selection tool 61
guidelines for applying to models 41
guidelines for creating 41 J
object properties 251 JavaScript 204
opening 104 intrinsic objects 211
properties of 104 naming conventions 216
in scripting 250 JPEG
troubleshooting 43 compression type 109
updating the Library resource for 55 no support for alpha channel 43
Import Resource 51 .jpg file extension 305
importing Jump To property 294
behaviors 51
components 60 K
images, guidelines for 41 key events 123
materials, guidelines for 38 Key object 288, 315
models and materials, troubleshooting 43 keyboard shortcuts
objects 51 for Anark Player 195
independent timelines. See components for Anark Studio 307
insert key 317 keyChar, event property 291
Insert Keyframe 153 keyCode, event property 291
inserting keyframe
comment text in timebars 148 master 152
keyframes 153 setting
Inspector tab first one 153
keyboard shortcuts 313 without updating the scene 151
tips for using 29 keyframes 152
installation 6 automatically setting 154
instance Autoset Keyframes 154
definition of 11 copying 156
testing for 214 deactivating for a property 155
instanceof keyword 214 definition of 18
instances deleting 155
locating 62 dynamic 159
of Anark Studio, copying objects Ease In 158
between 59 Ease Out 158
of objects 83 F6 key, using to set 154
internalCommand global function 189 interpolation, setting 157
international configuration 6 KeyFramesPerSec 179
Internet moving 156
distributing an Anark Media outside of timebar 152
presentation 184 overriding existing 154
See also HTML pasting 156
interpolation of keyframes reactivating 155
affect of deleting keyframes on 155 selecting 155

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

Index

shown in illustration 147 line numbers 74


snapping 156 show or hide 309
keypress events 292, 321 Linear Fade 95
keywords in scripting 262
assigned 211 linear keyframes 157
reserved 211 setting interpolation 158
knowledge base 8 linking properties 135
List behavior parameter 77
L LMSInitialize 197
launching an application 297 Load action 125
Layer Color 85 loading
Layer object 258 Anark Media files
attaching a camera 260 using ActiveX 189
layers using load method of assets 245
adding using the command line 192
objects to 53 components (as Playback Modules) 132
to the project 50 events 123
duration of 54 in scripting 225
overview 48, 321 images dynamically 169
properties of 84 music 168
in scripting 258 video 168
stacking order of 50 XML documents 301
leading of text 89 See also Prebuffering
Learning Management System (LMS) 197 loadSource, event property 291
Left View edit camera 12 locating resources and instances 62
left-handed coordinate system 50 Lock toggle 64
legacy projects 57, 186 LOD bias 110
length in scripting (as mipmapLODBias) 252
of the project 59 logical operators 213
of timebars 148 Long behavior parameter 76
Library tab 26 Loop button 160
adding new components 56 looping
adding objects to components 118
from the Storage tab 25 during playback 160
using Import Resource 51 in scripting 294
cleaning up 27 music 115
keyboard shortcut for viewing 308 in scripting 256
license code scene 84
entering 23 sound 115
required to distribute a presentation 183 in scripting 272
Light Map for images 106 video 113
creating 111 in scripting 253
Light object 261 loops
Light type 93 do...while loops 237
in scripting (as source property) 262 for loops 236
lights in scripting 236
controlling the brightness 94 while loops 237
properties of 93 Lossless compression 109
in scripting 261 luminosity, of colors 116

334 Anark Studio User Guide


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

M keyframes 156
.m1v file extension 305 objects in the Project window 98
Make Opacity Image 112 palettes 11
mapping Playhead 151
image to a model 104 projects 10
video to a model 113 slides 134
maps. See images, materials tabs on palettes 11
margins of layers 84 timebars 148
Master Animation toggle 146 See also Position property
master keyframe .mp2 and .mp3 files 255
characteristics of 152 .mp2 file extension 305
use caution when deleting 155 .mp3 file extension 305
master slides 134 .mpe file extension 305
Material Editor, guidelines to follow 38 .mpeg file extension 305
Material object 249 Multiply blending mode 102
definition of 322 in scripting 250
materials music
guidelines for creating and exporting 38 adjusting the volume 115
properties of 100 cueing to start 116
in scripting 249 prebuffering 168
troubleshooting 43 properties of 115
Matrix object 284 in scripting 255
Maya, guidelines to follow 37, 39 streaming 165
media events 124 Music object 255
media formats, supported 55 compared to Sound object 322
melting assets 234, 246
Memory object 289
N
Name
menu shortcuts 307
for custom events 79, 291
method (definition) 322
for custom functions 78
mipmapping 109
for custom properties 77
in scripting (as mipmapMode) 252
naming objects
Mirrored tiling for images 106
in Anark Studio 63
Model object 264
in scripting 215
models
navFlags HTML parameter 210
guidelines for creating 37
navigate
guidelines for exporting
action 128
to 3DS 41
global function 210
to AMX 40
Negative Map for images 106
obscured models, working with 100
nested components 137
properties of 97
new keyword 214
in scripting 264
new project, creating 10
troubleshooting 43
Next Slide action 130
updating the Library resource 55
in scripting 295
modulus 214
Node objects
mouse events 124, 230
definition of 322
Mouse object 287
description of all 257
mouseScroll, event property 291
nonidentity, testing for 214
.mov file extension 305
Normal blending mode 102
moving
in scripting 250
application window 11

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

Index

Normal sound 114 nudging 17, 312


nudging objects obscured objects, working with 100
keyboard shortcuts 312 properties and methods reference
setting an increment 17 guide 243
null data type 207 properties of, setting 81
numeric keypad keys 317 using the Inspector 29
numeric property renaming
setting values in Inspector 30 in the Library 27
NURBs (non-uniform rational B-splines) 39 in the Object outline 63
reordering 64
O in scripts
object creating 215
dragging 231, 311 defining the scope of 218
new (keyword) 214 intrinsic 211
object data type 207 selecting for actions 121
object model hierarchy 214 setting keyframes 153
OBJECT NAME attribute for HTML 185 unfreezing 233
Object outline octal numbers, as data types 206
keyboard shortcuts 313 .ogg file extension 305
objects created by scripts do not onAttach event 123
appear 216 onAttach function 225, 232
shown in illustration 32 onBuffered function 225
tips for using 62 onCommand function 233
object picker 77 onDetach event 123
Object Projection for images 105 onDetach function 225, 232
object property onExternalCommand HTML event 187
of events 225 onGroupedMouseOut event 124
See also accessing object properties onGroupedMouseOut function 227
Object Size property of assets 83 onGroupedMouseOver event 124
object tags onGroupedMouseOver function 227
editing 184 onKeyDown event 123
optional 186 onKeyDown function 228
required 185 onKeyUp event 123
objects onKeyUp function 229
adding onLoadComplete event 123
to components 140 onLoadComplete function 226
to the Library 27 onLoadError event 123
to the project 52 onLoadError function 226
attaching behaviors to 53 onLoadProgress event 123
copying onLoadProgress function 225
in components 140 onLoop event 124
in the Object outline 58 onMediaBuffered event 124
the path to 63 onMediaComplete event 125
customizing properties 75 onMediaComplete function 225
definition of 23 onMediaError event 125
deleting 65 onMediaError function 225
detached 232 onMiddleMouseClick event 124
duration of 54, 148 onMiddleMouseClick function 227
freezing 233 onMiddleMouseDown event 124
importing 51 onMiddleMouseDown function 227

336 Anark Studio User Guide


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

onMiddleMouseUp event 124 operators


onMiddleMouseUp function 227 arithmetic 213
onMouseClick event 124 assignment 214
onMouseClick function 227 definition of 322
onMouseDblClick event 124 logical 213
onMouseDblClick function 227 orbiting
onMouseDown event 124 edit camera 16
onMouseDown function 227 mouse button shortcut 311
onMouseOut function 227 order
onMouseOver function 227 render order of materials 103
onMouseUp event 124 stacking order of layers 50
onMouseUp function 227 origin
onMouseWheel event 124 of the ruler 19
onMouseWheel function 228 pivot point of the parent object 50
onPause event 124 Orthographic 90
onPlay event 124 3D View 12
onProgress HTML event 187 in scripting 260
onRightMouseClick event 124 Output action (for debugging) 127
onRightMouseClick function 227 Overlay blending mode 102
onRightMouseDown event 124 in scripting 250
onRightMouseDown function 227
onRightMouseUp event 124 P
onRightMouseUp function 227 palettes
onStateChange HTML event 188 Assistant 31
onUpdate event 124 working with 10
onUpdate function 225 See Also tabs
opacity panning
of groups 96 edit camera 16
in scripting 257 mouse button shortcut 311
of images 108 parameters
of layers 85 definition of 29, 323
in scripting 257 exposing in behaviors 75
of materials 103 See also properties
in scripting 249 parent object
of models 97 affects its child objects, example 149
in scripting 257 definition of 323
of nodes 257 properties of 49
of text 89 parent property of a behavior 224
in scripting 257 pasting keyframes 156
overview 111 paths
Opacity Map for images specifying in scripts 212
guidelines for importing 41 for streaming media 166
use to change transparency of material 105 Pause
using .png files as 43 action 129
OpenGL music 256
first choice for renderer 175 scene (using Initial Play State) 84
in Anark Client Context menu 197 sound 272
opening video 255
a project 10 pause key 317
object contents 63 percentDone, event property 291

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

Index

performance issues for components 118


conserve processor power and bandwidth for the scene 84
by choosing the right codec 42 in scripting (as rate) 295
streaming media 167 Player object 292, 295
Photoshop Playhead 150
compatibility with 43 keyboard shortcuts 312
tips for images 43 moving without updating the scene 151
Ping shown in illustration 32, 147
setting for components 118 .png file extension 305
setting for scene 84 .png files, using as Opacity Maps 43
Ping Pong point cloud rendering
in scripting 294 in scripting (as fillMode) 250
setting for components 118 specifying 103
setting for scene 84 Point light
pivot points compared to other types of light
definition of 50 sources 94
guidelines for setting on models 38 in scripting (as source) 262
keyboard shortcut for viewing 308 Polyphonic sound 115
Pivot property Position property
of cameras 91 of cameras 91
of groups 96 of groups 95
of layers 85 of layers 84
of lights 94 of lights 94
of models 97 of models 97
of nodes 257 of mouse events 227, 291
of text 87 of mouse object 287
pixels of nodes 257
measured by on-screen ruler 19 of text 87
texture pixels (texels) 109 U and V position of images 107
Play Position tool 16, 98
action 129 PostData HTML parameter 128, 210
button 160 PreBufferAsset behavior
Play Mode for images 169
in scripting (as contextType) 294 for streaming media 168
of components 118 prebuffering
of the scene 84 images 169
Play property streaming media 168
of music 256 Preceding Slide action 130
of sound 272 in scripting 295
of video 255 preferences, setting 17
playback Presentation object 292-293
controls 160 presentation size
in different Timelines 139 setting in Anark Studio 20
keyboard shortcuts 310 setting in the HTML document 186
total number of frames rendered 296 using OBJECT tags 185
Playback Module Preserve Texture Coordinates 41
dynamically loading 125, 132 previewing the project
exporting a component as 60 setting preferences 23
Playback Speed using scrubbing 160
for ActiveX (as rate) 190 using the F12 key 174

338 Anark Studio User Guide


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

Previous Slide action 130 R


in scripting 295 rate of playback. See Playback Speed
primitives ratio, aspect 21
adding rearranging. See moving
to the Library 27 redoing commands 66
to a project 53 reducing
creating 24 finished file size 27
in scripting 266 image size 108
printing behaviors 74 Refresh File 55
program preferences, setting 17 refreshing
project file shared components 56
adding objects to 52 source files 55
creating 10 See also updating
legacy 57 regional options, setting 6
opening 10 relative path
renaming 10 for objects
reverting to last saved version 10 in an action 122
saving 10 in scripting 224
project preferences, setting 19 for streaming media 166
Project window 11 specifying, overview of 109, 166
constrain proportions 21 Remote Source
drag objects onto 52 of images 109
shown in illustration 53 in scripting 251
projector of music 116
command line file for 193 in scripting 256
configuration file for 194 of video 114
exporting as 182 in scripting 253
prompt global function 208 removing
properties children from nodes 258
creating custom 76 See also deleting, detaching
of events 229 renaming
of objects behaviors
accessing in scripts 217 in the Library 27
creating dynamic properties in in the Object outline 63
scripts 219 objects
definition of 323 in the Library 27
linking 135 in the Object outline 63
on the Master Slide 135 projects 10
setting, overview of 81 Render Mode
setting, using the Inspector tab 29 setting for materials 103
unlinking 135 in scripting (as fillMode) 250
Property keyframes 152 Render Style, of text 86
proxy video 166 in scripting (as renderStyle) 270
.psd file extension 305 rendering
publishing a presentation 167 Anark Player menu option 195
choosing in Anark Client 196
Q from the Context menu 197
.qt file extension 305
handling in playback applications 174
QuickTime 305
in software, limitations 175
order of materials 103

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

Index

setting for a project 22 S


setting for ActiveX 190 samples, how to access 7
setting for Anark Studio 18 Saturate blending mode 102
total number of frames rendered 296 in scripting 250
video 180 saturation, of colors 116
replacing saving a project 10
behavior text 309 reverting to last saved version 10
shared components 58 Scale Mode, of presentation
resizing setting for Active X 190
layers 84 setting in Anark Studio 20
Object outline 63 setting in command line (as scale) 193
palettes 11 setting in configuration file (as Scale) 194
presentation during playback 20 setting in HTML 186
Project window 20 Scale property
property entries in Inspector 30 of cameras 91
timebars 148 of groups 95
See also scaling of lights 94
resources of models 97
adding to the Library 51 of text 87
definition of 23 Scale to fit. See Scale Mode
deleting 27 Scale tool 16, 98
locating 62 scaling
setting properties for 82 images, for compression 108
updating 55 nodes in scripting 257
Restore Defaults 19 objects in the Project window 99
Reverse Play action 130 timeline 147
reverting to last saved version 10 See also Scale Mode, Scale property
Rewind button 160 scene
Right View edit camera 12 properties of 83
root object 49, 323 root object 49, 323
Rotate tool 16, 98 scene camera 12
rotating objects 98 scene graph, definition of 323
Rotation Scene object 247
behavior parameter 77 SCO. See Sharable Content Object
object type 281 scope, of objects and variables 218
Rotation property SCORM. See Sharable Content Object Refer-
of cameras 91 ence Model
of groups 95 SCORM.bvs behavior 197
of images 251 .scr file extension 176
of lights 94 Screen blending mode 102
of models 97 in scripting 250
of nodes 257 screen saver
of text 87 configuring a file during export 180
of video 253 exporting as 176
rulers scriptlets 129, 224
inside the Project window 19 scripts
keyboard shortcut for viewing 308 assigned keywords 211
setting an increment 19 creating custom behaviors 72
data types 206
editing 73

340 Anark Studio User Guide


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

exporting 74 sharing .bvs files 74


global functions 207 shift key 291, 317
object model for 214 shortcut keys 195, 307
operators 213 showing
overview 204 objects
printing 74 using the Active button 64
representing paths in 212 using the Shy button 64
reserved keywords 211 See also displaying
resources for JavaScript 204 Shy toggle 64
syntax of 204 size, of project window 20
updating after editing 74 slides
scrolling text 89 keyboard shortcut for viewing 308
in scripting 270 Master slide 134
scrubbing overview 133
presentation 160 playing through to next
video 166 for components 118
seek property for scene 84
of music 256 in scripting 294
of sound 272 Slides tab 133
of video 255 smooth keyframes 157
seek time 130 snapping
selecting keyframes 156
actions 125 low, medium, and high resolution 19
keyframes 155 Playhead 151
objects 61 setting pixel range 18
in components 138 timebars 148
timebars 148 software rendering
selection modes and tools 61 choosing for Anark Media file 197
semicolon key 318 limitations 175
Set Changed Keyframes 154 solid rendering mode
Set Interpolation 158 in scripting (as fillMode) 250
Set Keyframe Time 156 specifying 103
Set Property action 125 sound
setting adjusting the volume 115
active camera 150 properties of 114
application preferences 17 Sound object 271
restoring defaults 19 compared to Music object 323
behavior properties 116 source files, working with 55
color properties 116 space bar 317
keyframe interpolation 158 Specular Color
keyframes 153 of lights 95
object properties 81 in scripting 262
using the Inspector tab 29 of materials 103
pivot points on models, guidelines for 38 in scripting 249
Presentation Size 20 Specular Map for images 105
project preferences 19 Specular Power of materials 103
Sharable Content Object 197 in scripting 249
Sharable Content Object Reference splash screen
Model 197 disabling for Anark Player
only view on Windows computers 173 from command line 193

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

Index

from configuration file 194 Slides 133


setting in ActiveX control 190 Storage 24
setting in HTML document 186 Timeline 31
Spot light Target Lock, for cameras 92
compared to other types of light in scripting (as lookAtLock) 260
sources 94 target object 121
in scripting (as source) 262 Target, for cameras 92
SRC in scripting (as lookAtPoint) 260
HTML parameter 184 TargetFrame HTML parameter 128, 210
parameter for Internet Explorer 185 technical support 8
stacking order, of layers 50 texels (texture pixels) 109
Start of Fog 92 text
Start Time of video capture 179 adding to the project 54
startup view editor, creating in a behavior 77
choosing one 19 in scripting 269
statements, definition of 323 properties of 85
Stop (playback) button 160 Text object 269
stop property Text type 86
of music 256 Texture Mapping, of images
of sound 272 comparison of choices 105
of video 255 important limitation 39
Stop Rendering button 180 in scripting (as mappingMode) 252
Stop Time of video capture 179 Texture Mapping, of video
stopping playback in scripting (as mappingMode) 255
for the scene or slide 84 texture pixels (texels) 109
stopping playback for the scene or slide 84 Texture Type, of images 105
Storage tab 24-25 in scripting (as materialMode) 252
streaming music and video 165 Texture Type, of video
String in scripting (as materialMode) 254
behavior parameter 77 textures. See images, materials
data type 206 .tga file extension 305
SuperCharge Map for images 106 this keyword 218
support, technical 8 thumbnails, for previewing 19
switch statement 235 .tif file extension 305
system requirements Tiling, for images 106
for Anark Client 183 in scripting 251
for Anark Player 183 Tiling, for video
for Anark Studio 6 in scripting 254
for projector files 183 time contexts
for Windows screen saver 183 creating 136
in scripting 294
T See also components, slides
tab key 316 time display 31
table fog 93 time events 124
tabs Time Labels
Actions 120 creating 131
Basic Objects 24 using as an event 132
Inspector 29 using in an action 132
Library 26 Time pane
moving 11 overview of contents 147

342 Anark Studio User Guide


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

shown in illustration 32 in scripting (as tilingModeHoriz) 254


timebar UNC (Universal Naming Convention) 128
keyboard shortcuts 313 UNC paths 167
tips for using 148 undefined data type 207
TimeContext object 292, 294, 323 undoing commands 66
Timeline Snapping Grid 18 unfrozen objects, how they behave 244
Timeline tab 31 units of measurement
drag objects onto 52 in Anark Studio 30
keyboard shortcut for viewing 308 for imported models 37
keyboard shortcuts for zooming in/ unlinking properties 135
out 313 unlocking object properties 64
moving between 138 unused resources, deleting 27
scaling 147 update events 124
selecting items in 61 updating
See also Object outline behaviors 74
tool tips source files 55
enabling and disabling 30 URI (Uniform Resource Identifier) 125
for properties 77 URL
Top View edit camera 12 for streaming media 116, 166
tracking of text 89 HTML parameter 128, 210
in scripting 271 of Anark Media file 186
Transform tools 98 of image file 109
keyboard shortcuts 311 of video file 114
transparency Use Layer Color 85
get from alpha channel data 108 in scripting (as
of background 259 transparentBackground) 259
See also opacity Utility objects
tri-linear filtering 110 definition of 324
trigger object 121 description of all 272
troubleshooting tips 43 UV coordinates
Type definition of 279
of variable for custom properties 76 required for texture map 37
typeof keyword 214 setting 107
troubleshooting 44
U UV mapping, of images 105
U Pivot, of images 107 in scripting (as mappingMode) 252
in scripting 251 UV mapping, of video
U Pivot, of video in scripting (as mappingMode) 255
in scripting 254 UV Rotation, of images 107
U Position, of images 107 in scripting (as rotation) 251
in scripting 251 UV Rotation, of video
U Position, of video in scripting (as rotation) 253
in scripting 254
U Repeat, of images 107 V
in scripting 251 V Pivot, of images 108
U Repeat, of video in scripting 251
in scripting 254 V Pivot, of video
U Tiling, of images 106 in scripting 254
in scripting (as tilingModeHoriz) 251 V Position, of images 107
U Tiling, of video in scripting 251

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

Index

V Position, of video a finished project 182


in scripting 254 object contents 63
V Repeat, of images 107 void keyword 214
in scripting 251 Volume
V Repeat, of video of music 115
in scripting 254 in scripting 256
V Tiling, of images 107 of sound 115
in scripting (as tilingModeVert) 252 in scripting 271
V Tiling, of video of video 113
in scripting (as tilingModeVert) 254 in scripting 253
var keyword 218
Variable Name, for custom properties 77 W
variables .wav file extension 305
definition of 324 Web browser
in scripting selecting as previewing application 23
creating 216 working with global functions 207
defining the scope 218 Web pages. See HTML file, exporting
incrementing by one 213 When 44
Vector When I apply an image to a material on an
behavior parameter 77 imported model, only a single color is
object type 275 applied. 44
Vector2 object 279 while loop 237
version width
of configuration file 194 of Anark Player window
of the player 295 setting from command line 193
vertex fog 93 setting from configuration file 194
Vertex object 280 of exported video 178
Vertical Alignment of text 89 of layers 85
in scripting 270 in scripting 259
Vertical Scroll of text 89 of presentation in Anark Player
in scripting 270 setting from command line 193
video setting from configuration file 194
automapping to a model 113 of presentation in HTML page 186
choosing the codec 179 using OBJECT tags 185
configuring a file during export 178 of project window 21
continuous capturing 179 width-to-height ratio 21
exporting as Window object 289
using the interface 176 wireframe rendering mode
may have an unsupported bit depth 44 in scripting (as fillMode) 250
prebuffering 168 specifying 103
properties of 113 .wmv file extension 305
in scripting 253 world space 20
streaming 165 world units 30
using with a material 113 wrapper file 197
video cards
choose fog style accordingly 93 X
important limitation 104 X axis 12
Video object 253, 324 left-handed coordinate system 50
video, troubleshooting if invisible 43 moving object along 98
viewing rotating object around 98

344 Anark Studio User Guide


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

in scripting 281 in scripting 259


scaling object in this direction 99
X Position of layers 84 Z
in scripting 259 Z axis 12
XML object 292, 300 left-handed coordinate system 50
XMLNode object 292, 298 moving object along 99
rotating object around 98
Y in scripting 281
Y axis 12 scaling object in this direction 99
left-handed coordinate system 50 zooming
moving object along 98 camera 90
rotating object around 98 edit camera 16
in scripting 281 mouse button shortcut 311
scaling object in this direction 99 timeline 147
Y Position of layers 84 See also scaling

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

Index

346 Anark Studio User Guide

Você também pode gostar