Explorar o código

fix: selection wasn't cleared when executing tree

Joseph Brandenburg hai 8 meses
pai
achega
9f0b06cca7
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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)