[Closed] Adding Variables to Scripted Controllers. How?
Is it possible to assign user variables for Scripted Controllers through script? I don’t seem to be able to find anything in the manual regarding this.
Thanks guys.
Sorry, my bad, I forgot to add the interface doc to the Help, it is more or less the same as for Expression controllers… Expect a public update of the Reference soon!
Wahooney,
can you give an example of what you are trying to do?
You could fetch the script, add your variables and put it back?
This sounds very complicated, though.
Georg
The script controller in max 8 has those variables that allow you to directly access scene nodes, etc.
I want to assign those variables.
It was not added to the help but the same code works for script controllers. Or you can use.
scCon=float_Script()
showInterfaces scCon
--Will return
Interface: IScriptCtrl
Properties:
.ThrowOnError : bool : Read|Write
Methods:
<boolean>SetExpression <&TSTR>Expression
Expression is In parameter
<TSTR by value>GetExpression()
<TSTR by value>GetDescription()
<boolean>SetDescription <&TSTR>Description
Description is In parameter
<integer>NumVariables()
<boolean>AddConstant <&TSTR>Name <&fpvalue>Constant
Name is In parameter
Constant is In parameter
<boolean>AddTarget <&TSTR>Name <value>Target Offset:<time> Owner:<value>
Name is In parameter
Offset default value: 0f
Owner default value: undefined
<boolean>AddObject <&TSTR>Name <value>Object
Name is In parameter
<boolean>AddNode <&TSTR>Name <node>Node
Name is In parameter
<boolean>SetConstant <value>Which <&fpvalue>Constant
Constant is In parameter
<boolean>SetTarget <value>Which <value>Target Owner:<value>
Owner default value: undefined
<boolean>SetObject <value>Which <value>Object
<boolean>SetNode <value>Which <node>Node
<boolean>DeleteVariable <value>Which
<boolean>RenameVariable <value>Which <&TSTR>Name
Name is In parameter
<time>GetOffset <value>Which
<boolean>SetOffset <value>Which <time>Offset
<boolean>VariableExists <&TSTR>Name
Name is In parameter
<fpvalue by value>GetConstant <value>Which
<value>GetTarget <value>Which asObject:<boolean>
asObject default value: false
<maxObject>GetObject <value>Which
<node>GetNode <value>Which
<value>GetValue <value>Which asObject:<boolean>
asObject default value: false
<value>GetVarValue <value>Which
<enum>GetType <value>Which
GetType enums: {#unknown|#target|#constant|#object|#node
<TSTR by value>GetName <index>Index
<index>GetIndex <&TSTR>Name
Name is In parameter
<void>Update()
<TSTR by value>PrintDetails()
Actions:
Thanks Paul, you’re a life saver!
I didn’t know about showInterfaces().