Notifications
Clear all

[Closed] Node that script controller belongs to?

Apologies for the cryptic title.
What I want to know is; Within a given script controller there any variable I can access that holds the node that the script controller in question is applied to?

Kind of like “This” for scripted modifiers.

I know I can hard code it with a loop, I just was hoping that there was some sort of variable existing already.

I don’t care if it breaks with instanced controllers because that isn’t going to happen

Rhys.

3 Replies

well I’m not quite ‘ZeBoxx’, but ‘this’ does actually exist inside script controllers. ‘refs.dependents this’ giving you everything you need, most likely.

Edit: Granted – a quick look at the help file doesn’t seem to point this out anywhere convenient. There is the entire “‘This’ Local Variable in Scripted Controllers” topic… but I’m not too sure that’s linked from anywhere other than the “What was new in 3ds Max R6” topic (it was added in R6, you see). That whole topic would make a fine addition to the existing “Using Script Controllers” topic – either integrated entirely or linked from it.

Right you are (as usual)

This is not well documented – the page: “‘this’ Local Variable in Scripted Controllers” explains it but is almost impossible to find especially if you’re not sure what you’re looking for in the first place.

Thanks a lot.

Rhys.

edit: grr too slow!

mwouahaha…

well, granted, it shows up if you do a search for e.g. ‘scripted controller this’ (13th result down in 2009) or better ‘scripted NEAR controller NEAR this’ (3rd result down in 2009)… but it did surprise me to not find it mentioned in one of the actual script controller main topics.

Anyway – problem solved, then?