Notifications
Clear all

[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.

14 Replies
1 Reply
(@bobo)
Joined: 1 year ago

Posts: 0

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!

 rdg

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.

 rdg

I see – but I can’t help.
Sorry.

Georg

Afaik, this can only be done with Expression controllers…

  • Martijn

That’s a bit of an embuggerance!

Yeah it is!

I suppose it’s one of those half finished additions.

1 Reply
 PEN
(@pen)
Joined: 1 year ago

Posts: 0

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().

DUH! Ofcourse!

Thanks for the heads up Paul

Page 1 / 2