|
SWC_elementFromCurrentScene
Library function which lets you select, allocate and load an element from the current
scene. The input data is a context array name and elements type (optional parameter). If
the procedure succeeds then the context is filled with information about the scene name,
scene ID, elements type, elements name and element ID. If the elements type is omitted at
command line and it is not specified in context an SWC widget is brought up so that the
user may select elements type and name, everything else starts from the elements name
selection.
package require SWC
SWC_elementFromCurrentScene context [object-type]
- context
Element-Specific Attributes
| AttributeName |
Get |
Set |
Fcrvs |
AttributeType |
Description |
| elementType |
Y |
Y |
N |
string |
Name of the scene. This is a pathless file-name. |
| elementName |
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. |
| elementID |
Y |
Y |
N |
string |
Name of the scene. This is a pathless file-name. |
| 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. |
- object-type
- 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. Valid values
are:
- Cameras
- Lights
- Materials
- Models
- Texture2D
- Texture3D
Return Value
The procedure returns elementID.
Example
This example brings up an SWC Widgets window to select, allocate and load an element
and corresponding information, such as the current scene name and ID. Then it calls the
SAA_elementDestroy function to destroy the element presented in MyContext.
- SWC_elementFromCurrentScene MyContext
- Elem4
- SAA_elementDestroy $MyContext(sceneID) $MyContext(elementID)
|