'This' Local Variable in Scripted Controllers

 

   

Animation Controllers - Quick Navigation

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.

EXAMPLE

refsArray = (refs.dependents this)
for i in refsArray where isvalidnode i do print i.name
0.0

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