Selaa lähdekoodia

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 kuukautta sitten
vanhempi
commit
766f538692
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  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