Fix USD I/O crashing on reports by using new wmJob report system.
Calling `WM_report` & co API from wmJob worker thread is utterly unsafe, and should never have been done. It 'worked' so far presumably because worker threads were barely (if ever) reporting anything that way, but now USD IO code is spamming reports in some cases, leading to fairly common crashes. Pull Request: https://projects.blender.org/blender/blender/pulls/113883
This commit is contained in:
@@ -46,8 +46,12 @@ class USDImportTest(AbstractUSDTest):
|
||||
self.assertEqual({'FINISHED'}, res, f"Unable to import USD file {infile}")
|
||||
|
||||
infile = str(self.testdir / "this_file_doesn't_exist.usda")
|
||||
res = bpy.ops.wm.usd_import(filepath=infile)
|
||||
self.assertEqual({'CANCELLED'}, res, "Was somehow able to import a non-existent USD file!")
|
||||
# RPT_ERROR Reports from operators generate `RuntimeError` python exceptions.
|
||||
try:
|
||||
res = bpy.ops.wm.usd_import(filepath=infile)
|
||||
self.assertEqual({'CANCELLED'}, res, "Was somehow able to import a non-existent USD file!")
|
||||
except RuntimeError as e:
|
||||
self.assertTrue(e.args[0].startswith("Error: USD Import: unable to open stage to read"))
|
||||
|
||||
def test_import_prim_hierarchy(self):
|
||||
"""Test importing a simple object hierarchy from a USDA file."""
|
||||
|
||||
Reference in New Issue
Block a user