Notifications
Clear all

[Closed] Scripted Controller: get corresponding node

Hi!

I’m using scripted controllers which depend on other properties of the object they are assigned to. So i need to reference to this object in the script.
I read in the maxscript that there is no way to get the node the controller is working on expect for this one:


  refsArray = (refs.dependents this)
  for i in refsArray where isvalidnode i do (mynode=i)
  

But this doesn’t really work since refsArray may contain more than only one node where isvalidnode i is true.
If there is another way to get the node the controller is working on, PLEASE tell it to me.

Now it thought ich could assign the controller script by another script. a little user interface, where you can pick an object and then assign the scripted controller and this interfaces script automatically adds a script controller, copies the script in the script controller and adds a variable with the reference to the object the controller just got added to.

Is this possible? and if yes – how do i add the script by script to the scripted controller?

Thanks!

2 Replies
 PEN

What track is this script controller on. You might be able to add the node to the script controller itself.

the controller is in the secound slot of a rotation list. But why is this important? does it matter where it is?

Ss there another way besides a scripted controller to create a script which gets executed every frame or everytime there is an interaction with a certain object?