Message 1 of 2
Fusion 360 crashes when updating TextBoxCommandInput from another thread
Not applicable
01-07-2021
02:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am running into an issue where Fusion 360 crashes (Completely, with Autodesk crash report popping up) when trying to update text from another thread
I am doing something in the background that takes a bit, so I am executing the action from another thread. I want to show the progress of the execution, so I have a text box where I display the percentage.
t = Thread(target=self.progressBarCallback, args=(progress,))
t.start()
This crashes Fusion. The callback is just a function that updates the input's formattedText:
self._input.formattedText = "<b align='center'>{}</b>".format(percent)
Not sure what causes this. Maybe it takes a long time to render the formatted text, and I'm updating too quickly, although slowing it down to once every second doesn't fix the issue either.
When I update a different CommandInput, like a BoolCommandInput's text, it doesn't crash and it updates perfectly fine from another thread and with hundreds of updates a second.
Is there some other way? I wanted to use the formattedText's html features to render a progress bar, but it doesn't seem like I can do that if it can't even handle text. Is there another way to put HTML snippets in?
