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

 

 


SWC_set

Sets and gets attribute values

SWC_set is a library function which allows user to set and get attributes values. Input data are the context array's name, the attribute's name and the optional parameter: list of values user would like to set to the attribute, if this parameter is omitted then the function just returns the value of this parameter. If the function succeeds then it returns the value of the parameter, which name passed to the function or set this parameter to the value passed to the function (if this value presents) otherwise an error is returned.

package require SWC

SWC_set context attribute-name [attribute-value1  attribute-value2 ..... ] 
context
specifies database, scene and element.
attribute-name
valid attribute name
attribute-values
These are optional parameters. If it is present the specified attribute of the context is set using this value or these values. If no value or values are specified then the value or values of the attribute is returned (as a list if the attribute has multiple values).

Attributes Common to the Contexts of All Objects

AttributeName Get Set Fcrvs AttributeType Description
resource attributes
databaseRsrcPath Y Y N string Full name of the resource path.
database attributes
databasePath Y Y N string This is the full database path
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
scene attributes
sceneName Y Y N string Name of the scene. This is a pathless file-name.
scene ID 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
common element attributes
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.
Chapter Y N N SAA_ChapterType Chapter in the database where the element is saved:
SAA_CHP_SCENE
SAA_CHP_ANIMATION
SAA_CHP_CAMERA
SAA_CHP_CLUSTER
SAA_CHP_PICTURE
SAA_CHP_LATTICE
SAA_CHP_LIGHT
SAA_CHP_MATERIAL
SAA_CHP_MODEL
SAA_CHP_NAMED_SELECTION
SAA_CHP_PALETTE
SAA_CHP_RENDERED_PICTURE
SAA_CHP_SETUP_SOFT
SAA_CHP_SETUP_CHANNEL
SAA_CHP_SETUP_FLOCK
SAA_CHP_SETUP_SHAPE
SAA_CHP_STRUCT_KEY
SAA_CHP_TEXTURE_2D
SAA_CHP_TEXTURE_3D
SAA_CHP_WAVE
SAA_CHP_EXPRESSION
SAA_CHP_MATERIAL_SHADER
SAA_CHP_SHADER
SAA_CHP_VOLUME_SHADER
SAA_CHP_TEXT_2D_SHADER
SAA_CHP_TEXT_3D_SHADER
SAA_CHP_LIGHT_SHADER
SAA_CHP_CAMERA_SHADER
SAA_CHP_OUT_SHADER
SAA_CHP_ENVIRONMENT_SHADER
SAA_CHP_CHANNEL_SETUP
HierarchyLevel Y N N int Indicates the level of the element in a hierarchy. For example, the root element of a hierarchy is level 0
Prefix Y Y N string Prefix part of an element's file name.
Revision Y N N int Version number of the element.
SchematicPosition Y N N float x

float y

Position of the element in the Schematic view.

SW returns this as a list: (X Y)

SchematicCollapsed Y N N int Indicates whether the element is part of a collapsed hierarchy in the Schematic view.

0 Hierarchy is expanded (open).

1 Hierarchy is collapsed (closed).

SelectionType Y N N SAA_SelectionType Indicates if and how the element was selected.

SAA_SEL_UNSELECTED

SAA_SEL_NODE_SELECTED

SAA_SEL_INHERIT_SELECTED indicates that the element was selected indirectly as part of a branch or tree. For example, if you branch select an element, then all its descendants inherit the selection.

SAA_SEL_BRANCH_SELECTED indicates that the element is the top node of a selected branch. For example, if the user selects an element by right clicking it, then the root element is branch selected. All other elements inherit the selection.

WireColor Y Y N int Wireframe color assigned to an element.
WireType Y Y N SAA_WireType Indicates whether the element is visible, ghosted, or hidden.

SAA_WIR_HIDDEN indicates that the element was hidden (via Display -> Hide).

SAA_WIR_GHOSTED indicates that the element was ghosted (via Display -> Ghost). Note that when you ghost a hidden element, its WireType is set to SAA_WIR_GHOSTED.

SAA_WIR_FULL indicates that the element is visible.

There are many attributes which are specific to certain kinds of objects. For instance lights have attributes which cameras do not, and vice versa.

Return Value

If SWC_set succeeds the value or list of values of the specified attribute of the context is returned, otherwise an error is raised. If a new value or values were specified these are what are returned.

Side Effects

None

Examples

SWC_elementGet MyContext
Elem4
SWC_set MyContext elementType
Models
SWC_set MyContext Type
6
puts $SAA_unConstants(SAA_ModelType,6)
SAA_MSPLN
SWC_set MyContext spline_Type
2
puts $SAA_unConstants(SAA_SplineType,2)
SAA_SPL_BSPLINE
SWC_set MyContext NodeVisibility
1
SWC_set MyContext NodeVisibility 0
0
SWC_sceneSave MyContext

Gets the element; defines the element's type; since the element's type is Models, Type is a valid attribute, defines model's type; since the model's type is SAA_MSPLN ( spline ) spline_Type is a valid attribute, defines the spline's type; gets value for the attribute NodeVisibility ( since the element's type is Models, it is a valid attribute ); sets the attribute NodeVisibility to the value 0; saves the scene.

See Also

Attributes Index
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.