Hey guys, I’m trying to fix some problems with my scripted plugin, but this whole instance-vs-class thing going on with them is not exactly easy to work with.
The problem is, I want a general event callback to propagate something to all instances of the plugin. I used nodeEventCallBack first which does the callback on a per-instance level, but this is exactly what causes the problem I’m trying to fix (RTT dialog doesn’t like this method: my plugin clashes with it and causes errors).
So right now I have a general event callback that gets triggered (externally, not in the plugin), it comes up with some values, and needs to set these to every instance of the plugin. I’ve started a global struct that keeps track of every instance, by having them “report” to this object, passing their own reference by using “this”.
Now here’s my problem:
Help states
The this local variable always contains the MAXScript value corresponding to the current instance of the scripted plug-in. This variable provides a guaranteed way of accessing parameters on the new object within plug-in code (in case there are locals or globals with the same name), and it is a way of referencing the plug-in in case you want to store it to a variable.
This doesn’t really seem to work: when I try to access a property of the instance, it always errors and tells me it’s unknown. All I can access are the base class properties (like .name).
Am I doing something wrong? Is there a different way of doing this? It’s a bit difficult for me to figure out the best way to keep track of these instances, as they are created by user-input and there’s no decent callback event for their creation (it’s a material).
Hope to get some advice! Thanks!