'This' Local Variable in Scripted Controllers

The this local variable in scripted controllers will contain a MAXWrapper value wrapping the scripted controller. The this is a local variable that exists while evaluating the scripted controller's script, and is not a property of the scripted controller.

In order to access the actual object the controller is assigned to, you can use the refs.dependents method using the this variable, then filter the valid nodes.

For example:

refsArray = (refs.dependents this)

for i in refsArray where isvalidnode i do print i.name


The example returns the name of the object the scripted controller is assigned to. Obviously it is not possible to tell the actual node when the controller is instanced across multiple objects which is a known limitation.

See also

Script Controllers

dependsOn For Scripted Controllers