vcanim.gif (8357 bytes)SWC_elementGet
Home ] Sales ] Products ] Services ] Support ] Downloads ]

 

 


SWC_elementGet

Get an element

SWC_elementGet is a library function which allows users to select, allocate and load an element. Input data is a context array name and element's type (optional parameter). If the procedure succeeds then the context is filled with information about the database resource file path, database's path, database ID, scene's name, scene ID, element's type, element's name and element ID.

Since an element is a sub-level of a scene, the procedure first checks the context for database and scene-related attributes. If they are not there, the procedure loads an SWC window that allows the user to select the correct values for the missing information. Once this information is supplied to the context, the procedure uses it to load the database and scene. The procedure then tries to assign the optional element type command line parameter to the context's elementType attribute. Then the context is checked for element-related information, and if any is missing, opens an SWC window that allows the user to select the element type and element.

When the selection is done the selected values are assigned to the context. The procedure then allocates and loads the chosen database, scene, and element. Then it returns sceneID.

package require SWC

SWC_elementGet  context [elementType]
context

Element-Specific Attributes

AttributeName Get Set Fcrvs AttributeType Description
elementType Y Y N string It specifies the type of the Softimage element. The possible values are Camera, Light, Material, Model, Texture2D, Texture3D, Wave
elementName Y Y N string This is the Softimage name of element without prefix.
elementID Y Y N string Name of the element structure. It can be passed to any SAA function which requires a pointer to SAA_Elem or an attribute of SAA_Elem type.
sceneName Y Y N string Name of the scene. This is a pathless file-name.
sceneID Y Y N string This is the name of the scene structure. This name may be passed to any SAA routine which requires a scene.
databaseRsrcFile Y Y N string Full name of the database resource file that the database is in.
databasePath Y Y N string This is the full name of the database directory. This name may be passed to any SAA routine which requires a database name.
databaseID Y Y N string This is the name of the database structure. This name may be passed to any SAA routine which requires a database.
elementType
This is an optional argument. if it is omitted the function will bring up an object type selector widget. Alternatively one may specify the type of element to get in the function call. Valid Choices are:
  • Cameras
  • Lights
  • Materials
  • Models
  • Texture2D
  • Texture3D
 

Return Value

If SWC_elementGet succeeds it returns an element pointer which can be passed to any SAA function which expects an element structure. If this procedure encounters an error it raises a TCL exception.

Side Effects

Updates the SWC allocations lists.

Examples

SWC_elementGet MyContext
Elem4
SAA_elementDestroy $MyContext(sceneID) $MyContext(elementID)

This example displays SWC windows to select, allocate and retrieve an element and corresponding database resource file, database and scene information. Call the SAA_elementDestroy function to destroy the element presenting in MyContext.

See Also

SWC_set
SWC_unset

Behaviors Overview ] Behavior Evaluate ] Behavior Edit ] Debugger ] Console ] Find ] SAA Library ] SW library ] SWC library ] SWN library index ] SWU library ] Attributes Index ] Scripting Examples ]

copyright Video-Collage Inc.