Kaynağa Gözat

fix: selection wasn't cleared when executing tree

Joseph Brandenburg 8 ay önce
ebeveyn
işleme
9f0b06cca7
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. 6 0
      readtree.py

+ 6 - 0
readtree.py

@@ -705,6 +705,12 @@ def execute_tree(nodes, base_tree, context, error_popups = False):
         # this will PASS the error! that's better for UI/UX
     finally:
         context.view_layer.objects.active = active
+        # clear the selection first.
+        for ob in context.selected_objects:
+            try:
+                ob.select_set(False)
+            except RuntimeError: # it isn't in the view layer
+                pass
         for ob in select_me:
             try:
                 ob.select_set(True)