Alternatives to 'has changed'?
Posted: 04 Dec 2024, 18:48
I have a recurring type of small bug in my wkp. This happens when I set an object's value, and that value happens to be the same value it was before, so hasChanged doesn't see it... but the user has changed the next thing in line in the meantime, so now the two objects are out of sync. I'm contrasting this with the way max operates, where you have discreet events that can always trigger the next thing in line. Is there a way to model this with usine's signal paradigm?
I get around this most times by using a mousedown to actually trigger the next thing, so it happens regardless whether there has been a change in value. But when I set a value by object, that doesn't happen. This is especially an issue in scripts that need to do some kind of refresh.
I guess I can have my recall of the object fake a mouse click. But maybe there's a less awkward way to do it? Is there any way that a control can know that its value has been set via usine objects, if the value doesn't actually change?
Another option I guess is to adjust my recall script to also change whatever is downstream from the main object, so the object doesn't have to do it. That might be a better solution.... or maybe there is a better alternative to hasChanged, that I don't know about?
Thanks as always!
-eric
I get around this most times by using a mousedown to actually trigger the next thing, so it happens regardless whether there has been a change in value. But when I set a value by object, that doesn't happen. This is especially an issue in scripts that need to do some kind of refresh.
I guess I can have my recall of the object fake a mouse click. But maybe there's a less awkward way to do it? Is there any way that a control can know that its value has been set via usine objects, if the value doesn't actually change?
Another option I guess is to adjust my recall script to also change whatever is downstream from the main object, so the object doesn't have to do it. That might be a better solution.... or maybe there is a better alternative to hasChanged, that I don't know about?
Thanks as always!
-eric