3dcheapskate opened this issue on Sep 22, 2021 ยท 13 posts
adp001 posted Thu, 23 September 2021 at 2:08 AM
I think that it makes no sense for Poser to write something in a CR2 file that is solved via a (separate) Python script. The content of the CR2 can't influence anything. The hint that it is a special attribute is enough. More data is not required at this point.
To your problem with the many calls of the callback: Throw out the print statement. Code in callbacks should be as short, efficient and fast as possible. The running program is interrupted by an event somewhere and the callback function is called (by the way, the interruption is done by wxPython and not the actual code of Poser). And Poser's code is not re-entrant. So it's possible that a print statement in a callback can lead to a crash. In your case the events might overtake each other.
If you follow the rules for callbacks, it works very reliably (which was not the case in older versions; and I'm talking about P11). I've had an MQTT connection running in Poser all the time for some time now, executing, deleting, and setting new callbacks (actor/prop syncronization via network). No problems so far, even after days of running. Sometimes I even forget that the connection is up :)