Getting Information from this Guide

To find information about the elements of the Autodesk Softimage SDK, you should first understand the difference between the C# and Scripting Reference, and the Plug-in Development.

The C# and Scripting Reference contains individual entries that describe the elements, so if you want to know about a specific command or object, you can look it up by its name.

The Plug-in Development contains broad, conceptual information. That is, more task-based, step-by-step instructions or detailed explanations of the concepts that are central to understanding how to accomplish your goals.

Both of these guides provide several different ways to access the information you need.

 

For more information on the structure of the information in the C# and Scripting Reference, see How to Read the C# and Scripting Reference Entries. For specifics on using the tools (such as Index, Search, or Favorites) provided by this version of HTML Help, see Using HTML Help.

Wait! Read Me First!!

There are several concepts that are really crucial to understanding what you need to do when scripting or developing plug-ins with the object model. You can find a list of these at the end of this section, but the most important of these involves being able to predict what kind of a value or data type a function is returning.

What You Need To Know about Return Values

What kind of value or item a command or object model function returns varies depending on the function you are using and how you are using it. Since the return value can vary depending on the command or object model function you used to get it, you can learn a few tricks to help you figure out whether you are working with an object or a collection.

To start with, all objects are implemented with at least the Name and Type properties, and the default property of an object is its Name. All collections are implemented with at least the Count and Item properties, and the default property of a collection is Item.

When does this make a difference? If, for example, you are using a command or method that you believe returns an object, you can display the name of the object with the LogMessage method without any type problems because the object’s Name property is a string:

Set oObj = GetValue( "cube23" )
LogMessage "My new object's name is " & oObj

Now let’s say that you thought you were getting a single object, but instead you are getting a collection of objects. If you try using LogMessage with the return value again, it won’t work because the Item property needs an index in order to mean anything:

SelectObj "cube*"
Set oObj = Selection

LogMessage "My object's name is " & oObj

In that case, you would need to enumerate the collection and then you could treat each member as an object:

SelectObj "cube*"
Set oObj = Selection

For Each thing In oObj
   LogMessage "My object's name is " & thing
Next

Alternatively, you could specify the member of the collection that you want to work with:

SelectObj "cube*"
Set oObj = Selection(0) ' gets the 1st item
LogMessage "My object's name is " & oObj

 

LogMessage is looking for a string, which it takes from the default property of the object. But when the Selection object is properly indexed, it represents an object, and so LogMessage reverts back to taking the Name property as if you used the following:

Selection.Item(0).Name

 

In some cases, you may be returning an empty object or collection. Empty objects always throw an error that you can trap (see Checking Return Values for Type).

Empty collections are a little more tricky because sometimes an empty collection will still be a valid collection with 0 members (which you can test with the Count property) but sometimes they are not valid at all. For more information, see Empty Collections.

 

Answers to Basic Questions

Do you have lots of questions about scripting with the Autodesk Softimage SDK (COM API)? Here’s where you can find the answers:

For these questions...

Look here...

What’s the difference between argument validation on low-level commands, high-level commands, and the methods of the object model and how could those differences affect me?

What You Need To Know about Passing Empty Arguments

What is type and how do I check for it?

Checking Return Values for Type

What are families?

What is the difference between owners and parents?

Other Tests: BelongsTo, Owners, Parent, and Parent3DObject

How do I go back and forth between string expressions for commands and objects in the object model?

What does GetValue( “SelectionList” ) return exactly?

How do I get the current selection?

Selecting through Scripting Commands

How can I get the user to pick something in the scene?

Picking

How do I figure out whether I have an object or a collection?

What kind of values is Softimage returning in commands versus the object model?

Returning Values

What’s the difference between an Softimage “object” and a programming “object”?

How do I get an Softimage object through scripting?

How do I find an object in my scene?

How do I get an object’s subcomponents (surfaces, segments, and points)?

How do I work with clusters?

How do I access texture UV’s?

How do I access parameters?

What are shortcuts and how do they relate to parameter values?

Accessing Scene Elements

How do different scripting languages handle arrays?

What’s a safearray and how do I work with it?

Can I convert a JScript array into a VBScript safearray?

Using (Native) Arrays

What’s the difference between collections and arrays?

Collections vs. Arrays

What are custom parameters and what can I do with them?

Working with Parameters



Autodesk Softimage v7.5