Notifications
Clear all

[Closed] How to navigate through the variables of a script controller?

I have a script controller with lots of node variables assigned to it. What I would like to do is to navigate in a for loop through all these variables. Is it possible?

Regards,

Jr.

3 Replies
1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

theCtrl = $Box02.pos.controller[1].controller –some Script controller I tested with…

–loop through the variables and print some info about them:
for i in 1 to theCtrl.NumVariables() do
format “%: %: (%) %
” i (theCtrl.GetName i) (theCtrl.GetType i) (theCtrl.GetValue i)

another solution for this may be to store the nodes in a ca, because there you can use a #maxObjectTab parameter.

you can put the ca on the script controller and access it from within within the controller using ‘this.caName’

this will be convenient because you have an array holding your nodes.

Thanks a lot for the help! Bobo’s solution is exactly what I was looking for…but Aearon, your method seems interesting too, if you can tell a bit more how to do that, I will appreciate it. Because I like to have more than one solution to a problem…

Regards,

Jr.