|
SW_elementAttachBehaviorScene
A library function which attaches a TCL script (behavior) to an element.
package require SW
SW_elementAttachBehaviorScene elementID execOrder execState behaviorScript
sceneID [ fcurves fcState ]
- elementID
- The element to which a script will be attached.
- execOrder
- A real number from 0 to 1 which defines the order of execution of the attached tcl
scripts. For example, 0.23 would execute before 0.37.
- execState
- Allows you to enable or disable the attached tcl script. If the execState is 0, then the
Behavior Evaluator will not execute the attached TCL script. If the execState is 1, then
the Behavior Evaluator will execute the attached TCL script.
- behaviorScript
- TCL script which will be attached to the element. This is ascii text.
- sceneID
- The scene in which the element occurs.
- fcurves (optional)
- The list of selected Fcurves which will be attached to the element. For example,
{scalx scaly scalz etrnx etrny etrnz}. If you specify this argument you MUST specify fcState
as well.
- fcState (optional)
- Allows you to enable or disable the attached selected Fcurves. If the fcState is 0, then
the Behavior Evaluator will not execute the attached Fcurves. If the fcState is 1, then
the Behavior Evaluator will execute the attached Fcurves. If you specify this argument you
MUST specify fcurves as well.
-
-
Return Value
There is no return value if function succeeds. If an error condition occurs, the return
value will be a descriptive string message giving information about the error.
Example
Attach simple TCL to model sphere1.
- set elementID [SW_name2Element sphere1 $curSceneID]
- Elem2
- set script {
- set name [SWB_getCurrentElementName]
- puts "Hello World! I am $name"
- }
- set name [SWB_getCurrentElementName]
- puts "Hello World! I am $name"
- SW_elementAttachBehavior $elementID 0.1 1 $script
|