Browse Source

UI: readtree has safer execution and selects error node

uses try/except  block to safely handle errors
in execute_tree() - it passes errors and presents a dialog for better UX
It also ensures that armatures are put back in object mode, so that the
file won't be prevented from autosaving, nor will it mess up the undo
stack.
Joseph Brandenburg 8 tháng trước cách đây
mục cha
commit
766f538692
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      readtree.py

+ 4 - 1
readtree.py

@@ -697,5 +697,8 @@ def execute_tree(nodes, base_tree, context):
     finally:
         context.view_layer.objects.active = active
         for ob in select_me:
-            ob.select_set(True)
+            try:
+                ob.select_set(True)
+            except RuntimeError: # it isn't in the view layer
+                pass