Notifications
Clear all

[Closed] Callback on Variables?

Hey MaxScripters,

the headline of this thread articulates a question which has been pretty long on my mind. “Is it possible to track down the changement of a variable by a callback?”

The problem derives from the fact that I’d like to change an object in the scene programmatically. Unfortunately I have to calculate the changes within a second thread which is cool until I want to change the object directly from that thread -> Max crashes.
So the easiest way in my oppinion would be (since I can’t get rid of that 2nd thread) to create a variable X in the main thread an write the change (which is a new value) calculated in the second thread into that new variable.
If I could create a callback on this variable it would fire, when the value has changed and update the object in the main thread. Tada!
Can I do that with MXS or .Net?

Thanks in advance.