DAZ Script IDE

What is the DAZ Script IDE?

The DAZ Script IDE gives the user an environment specially suited to the use of DAZ Script. It provides many of the standard features expected in a modern IDE, such as auto completion for class members and syntax highlighting. In addition to these key features, the DAZ Script IDE allows the user to run the script directly within DAZ Studio while writing it, making testing much simpler. It also provides the option to encrypt the script when saving it, protecting the user’s hard work while allowing the script to be shared with others for their use.

The DAZ Script IDE Tab

dazscriptide.png

Once the DAZ Script IDE has been installed, it is accessible via View > Tabs > DAZ Script IDE. This will enable the DAZ Script IDE tab, as seen to the right. The tab can be left floating or docked with other tabs, as desired. A brief overview of each tab section follows, with detailed usage covered in the next section.

A menu for the IDE is located at the top of the tab. This menu provides access to the file and edit actions available within the IDE. Most are basic functions, such as opening, closing, and saving scripts or copy, paste and find/replace.

The Script tabs allow the user to create or modify scripts for use in DAZ Studio. Multiple scripts can be open at once.

The Debug window at the bottom displays debug messages when there is an issue with a script that has been ran from within the IDE. These messages can be helpful for narrowing down the cause of a failure in the script.

Using the DAZ Script IDE

The DAZ Script IDE provides a simple, but useful, interface for the development of scripts for use in DAZ Studio. Familiarity with DAZ Script, or access to the DAZ Script documentation, is required to make the most of the IDE. However, the IDE itself is designed to make the experience of learning DAZ Script as easy as possible. Now the use of the most common or important features of the IDE will be explained.

Editing a Script

The primary use of the IDE is of course the development and modification of DAZ Script files. As such, the File menu can be used to create a new script or open an existing one. The IDE also begins with a new blank script by default. Once the desired script is open, the user can begin editing or adding to the script contents in the script document tab.

As detailed in the DAZ Script documentation the scripting syntax is similar to several other scripting languages. To assist with proper formatting of the script code, the IDE provides the following two features:

Auto Completion

autocompletion.png

When a DAZ Script class object is being referenced within the code, the IDE will pop up a menu containing the member functions and variables for that class, as shown to the right. This makes the process of selecting the desired member much simpler and can often help reduce the amount of time spent referencing the DAZ Script documentation. The options displayed in the dropdown will also be further refined as the user continues to type the name of the desired member. For example typing “Scene.is” will display only those members of the Scene object that begin with ‘is’.

Syntax Highlighting

syntaxhighlighting.png

Another very helpful feature of the DAZ Script IDE is the syntax highlighting functionality. The contents of the script text will be colorized based on the type of content the editor determines them to be. As shown in the example to the right, the IDE has turned the comment at the top to green, while the DAZ Script keywords var and new have been changed to blue, with the contents of the MyDialog string being shown in grey. There are several other categories of text that will be highlighted: Label, Number, Preprocessor, Standard, and Type. The colors used can be customized within the Preferences dialog which will be explained later in this document.

Testing a Script

After enough the script has been written that it is expected to run, the user can easily check its performance by clicking on the Run Script button in the upper right hand corner of the IDE interface, or by selecting Run Script from the File menu. As the script is ran output from its processing will be displayed in the debug window at the bottom of the IDE. If all goes well, only the fact that the script is being executed and how long the execution of the script took will be displayed. However, if there is a problem with the script, error messages will also be displayed in the debug window, with as much information about where and how the script failed as the IDE can determine on its own.

Saving a Script

Once the user has made the desired changes to the script in the IDE, it can be saved to file for reuse by selecting any of the Save options from the File menu. One option of note is “Save Encrypted Script”. This will save the script contents in an encrypted format that can be read by DAZ Studio when the script is executed, but cannot be opened for editing in the DAZ Script IDE or any other editor. This option is useful for providing a copy of a script for others to use when it is not desired that they be able to view, modify, or copy the contents of the script. As such, it is important for a developer to save an unencrypted version of the script so that modifications can be made as needed in the future.

Preferences

preferences.png

The DAZ Script IDE allows many aspects of the way it displays scripts to be customized. These preferences are set via the Edit > Preferences menu. As shown to the right, a Preferences dialog will appear with the various options listed. The options are many of those expected in an IDE: customization of syntax highlighting, control of word wrap, auto complete, parentheses matching, and tab and indent behavior.

The Syntax Highlighting section allows the customization of each content type defined by the IDE. For each of these types it is possible to change the font, size, color, and style of all words matching that content definition. The Options section allows for word wrap, auto complete, and parentheses matching to be enabled or disabled. The Indentation section allows the user to set the default tab size, indent size, specify whether tabs are kept when a script is loaded, and enable or disable auto indent.


Generated on Thu Sep 24 12:21:06 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.