On 03/05/2016 at 01:27, xxxxxxxx wrote:
The BaseThread comes from the "Cinema 4D Core". It's implementation of TestBreak() does something like
checking if the ESC key is pressed and returns True or False accordingly. Very likely, the event is saved somewhere
in a queue or synchronized data structure from the main thread (since the thread itself can't check if the
key is pressed, as we already figured).
You're bound to the Cinema 4D way of cancelling such actions (ie. the ESC key) as you can not tell the
BaseThread to check a different key in TestBreak() (that is hard coded somewhere in the C4D source
where TagData.Execute() is called, since the BaseThread is passed to that function and can not be changed).
It's the same mechanic to when you use the RenderDocument() function and pass it your own C4DThread,
only that the context is reversed. Here, you call TestBreak() to check if the processing should stop, but
the implementation of TestBreak() is not accessible to you. In RenderDocument(), it will call TestBreak()
to check if the rendering should be aborted, and you can specify at what event exactly the rendering
should stop by implemented C4DThread.TestDBreak().