Scripts provide a powerful way to automate many tasks and simplify your workflow in Softimage.
A script is simply a text file that contains instructions for performing a task. Unlike executable programs, scripts are not compiled. Instead, each line is parsed and interpreted at runtime, then translated into commands that the computer can perform.
Inside a Softimage script, there can be several different types of instructions. Some instructions tell Softimage to do something: these instructions can be either native Softimage commands or Softimage object model statements. Other instructions control the program flow (conditional execution, loops, and so on): these instructions can be commands from a supported scripting language such as VBScript, JScript, or others.
You create your own scripts using the Softimage script editor or any other text editor. You can begin by copying and modifying Softimage commands from the history, or you can write a script from scratch. You can also use an existing script as a starting point or simply as a reference.
Many sample scripts are installed with Softimage. These are available in
<install_dir>\Data\XSI_SAMPLES\Scripts. In addition, you can also obtain useful scripts from many Softimage user communities on the Internet.
The possible uses of scripts are endless. For example, you can:
• Write scripts to automate repetitive tasks.
• Create custom commands. Custom commands are scripts that have been added to a toolbar for quick access.
• Run scripts automatically on certain events, for example, whenever the current frame or selection changes.
• Modify the behavior of particles using a script that is executed inside the simulation loop.
• Create scripted operators that are called to update objects or parameters in a scene.
• Create scripts that can be accessed from a synoptic view to control specific objects in a scene.
• Combine scripts with dynamic HTML (DHTML) to create tools that run from within the Net View and interact with the scene data.
• Run scripts in batch mode, without starting the user interface.
Two APIs: Commands versus the Object Model
An application program interface (API) is a method that allows a program to receive instructions from another process. There are two different APIs that allow scripts to control Softimage: commands and the object model.
The two APIs are not mutually exclusive and can be mixed within the same script. Each API has different strengths, depending on your goals, preferences, and experience.
![]()
|
Softimage has a third API based on C++. It cannot be used for scripting, but it is available when creating compiled plug-ins for Softimage. It is useful for programmers who do not want to use the COM-based object model. For more information, see the SDK Guide. |
Commands are actions that have an immediate effect. Whenever you do something in the Softimage interface that changes the scene data — such as selecting a scene element, moving an element, changing a parameter value, or setting a key — a command is logged to the history. When this happens, the corresponding command appears in the Command Box in the bottom left corner of the main window. These native Softimage commands can be used in scripts, either as they are or modified.

Because commands correlate well with how you interact in the Softimage interface, it’s relatively easy to learn to script with commands. Commands are also useful for advanced users in some situations, because a single command can correspond to a great deal of data manipulation “behind the scenes.”
However, scripts that use native Softimage commands are generally slower than scripts that use the object model. In addition, a script that uses commands cannot be easily adapted and compiled into a plug-in. For these reasons, advanced scripters often prefer to use the object model except for short and simple scripts.
For more information about scripting using Softimage commands, see Working with Commands.
Like many modern software applications, Softimage is written using object-oriented programming. In addition, Softimage exposes its internal object model for use directly in scripts. This lets you write powerful scripts that manipulate scene data at a very deep level.
Object-oriented programming involves classes, properties, and methods. A class is a type of similar objects, and objects are members of a class. All members of a class share common properties and methods. Properties store information about individual objects, and methods define actions that can be performed on objects. You can get and set properties or invoke methods in exactly the same way on any member of a given class.
For example, Geometry, Point, and ShapeClip are three of the many classes in Softimage. Every Geometry object has a property called Points that stores the collection containing all of its Point objects. Similarly, the Geometry class defines a method called SaveShapeKey that can be used on any member to create a ShapeClip object.
Within a class, there may be subclasses (sometimes called derived classes). A subclass inherits the properties and methods defined for its base class (also called parent class or superclass). In addition, a subclass adds additional properties and methods that are available specifically for its members. For example, PolygonMesh, NurbsSurfaceMesh, and NurbsCurveList are subclasses of Geometry. In this way, the object model forms a hierarchy of classes and subclasses.
Advanced users who are acquainted with object-oriented programming will likely prefer using the object model to the native Softimage commands. For others, it may take some time to become familiar with object-oriented programming in general and the Softimage object model in particular. For more information about the Softimage object model, see the SDK Guide.
A scripting language is like a glue that binds a set of native Softimage commands or object statements together. The simplest scripts are sequences of Softimage commands that are carried out in order, line by line. Using key words from a scripting language allows you to do more than that, for example:
• Execute instructions only if certain conditions are true.
• Repeat instructions in programming loop.
• Declare variables and arrays.
• Organize scripts using functions and subroutines.
• Use other features of a specific scripting language, such as commands for mathematical operations, message and input boxes, and so on.
Softimage supports many popular scripting languages, including VBScript and JScript. If you already know a supported scripting language, you do not need to learn a new one to create advanced scripts in Softimage.
For more information about supported scripting languages and how to set your preferred language, see Scripting Languages.
This section provides a brief overview of some of the useful tools for scripting in Softimage. These tools are fully described in the chapters that follow as well as in the rest of the Softimage documentation.
The Command Line panel appears in the bottom left corner of the main Softimage window. It echoes the last command logged in Softimage, and also provides quick access to the script editor.
For information about using the command box to enter commands or modify recent ones, see Using the Command Box.
The script editor is a window where you can create, modify, run, and manage scripts. For more information about using the script editor to perform these and other tasks, see Editing Scripts.
SDK Explorer
The SDK Explorer displays information that is useful when using the Softimage SDK. To display it, choose View > Scripting > SDK Explorer or press Ctrl+Shift+4 (use the number keys at the top of the keyboard, not on the numeric keypad).
• On the selection info tab, the left pane is an explorer where you can select any element and the right pane is a dynamic HTML page that displays various information about it.
• The application info tab gives various information about Softimage, installed plug-ins, the current scene and project, and so on.
Explorer
The explorer can be configured to display the scripting names of objects and parameters in your scene. This makes it easier to know the correct string to use for identifying elements when writing scripts.
The Net View allows you to distribute and run scripts on an intranet or the Web. You can:
• Run scripts by clicking on a link.
• Open scripts in the script editor by dragging and dropping links into the editing pane.
• Create DHTML pages that interact with scene data.
For information about using Net View, see Net View [Interface and Tools].
For information about creating your own Net View pages on an intranet for use with Softimage, see Intranets for Net View.
RV - Script Editor Dual-Pane
The RV - Script Editor Dual-Pane is similar to the script editor, but contains two editing panes so that you can work on two separate files at the same time. It is available as a sample custom view in the SDK examples workgroup. To display it, connect to the workgroup (see SDK Example Workgroup) and then choose View > SDK Example > RV - Script Editor Dual-Pane.
Where to Find More Information
The sections that follow describe scripting in Softimage in more detail. This section describes where to find additional information about the native Softimage commands, the Softimage object model, and scripting in general.
Script Editor Help and Reference Information
You can access the SDK Guide by pressing F1 or clicking on the
on the command bar of the script editor.
• Script Developer’s Guide contains advanced information about scripting and the script editor, such as debugging and other topics.
• Scripting Reference contains syntax and descriptions for every command, object, method, property, and constant available in Softimage. If you place the cursor in or highlight part of an Softimage keyword, the appropriate topic opens automatically or you are prompted with a choice of topics. For example, you can type the beginning of a command, then press F1 to choose from a list of commands that begin with that string.
If the appropriate topic doesn’t appear, it may be because of one of the following reasons:
- The command is misspelled.
- The cursor is in a keyword of the scripting language and not in a command.
- The command is not licensed for this installation of Softimage.
- The command is a custom command and not a native Softimage command.
Scripting Language Information
For sources of more information about specific scripting languages (VBScript, JScript, and others), see More Information About Scripting Languages.
Autodesk Softimage v.7.5