Notifications
Clear all

[Closed] How can I acsess ALL controller in the

Hi

I need to turn on Keyable property in ALL controller in the scene.
What would be the way to make sure to get ALL controller in the scene?

Thanks

2 Replies

Have a look at GetClassInstances…

Controller_Array = GetClassInstances Controller

Should store every controller in the scene into the array.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

it doesn’t work…

Here is a solution:


fn getAllSceneControllers =
(
 ss = stringstream ""
 showClass "*:*controller*" to:ss
 allcontrollers = #()
 seek ss 0
 while not eof ss do
 (
  s = filterstring (readline ss) ":"
  cclass = execute s[1] 
  join allcontrollers (getclassinstances cclass)
 )
-- double check for controllers only
 allcontrollers = for c in allcontrollers where iscontroller c collect c
)