瀏覽代碼

fix selection sync error again lol

Joseph Brandenburg 4 周之前
父節點
當前提交
9950219dce
共有 1 個文件被更改,包括 9 次插入 和 4 次删除
  1. 9 4
      timers.py

+ 9 - 4
timers.py

@@ -97,7 +97,10 @@ def timer_update_selection_sync():
                 if len(tree_path[-1].nodes) == 0:
                     return SELECTION_POLL_RATE # empty graph
                 parsed_tree = root_tree.parsed_tree
-                active_ui_signature = (get_signature_from_space(tree_path[-1].nodes.active, space))
+                if tree_path[-1].nodes.active is not None:
+                    active_ui_signature = (get_signature_from_space(tree_path[-1].nodes.active, space))
+                else:
+                    active_ui_signature = None
                 for n in tree_path[-1].nodes:
                     if n.bl_idname not in WATCH_FOR_SELECTION: continue
                     selection_state[ui_signature := get_signature_from_space(n, space)] = n.select
@@ -119,9 +122,11 @@ def timer_update_selection_sync():
                 prRed (e)
                 return SELECTION_POLL_RATE
     except Exception as e:
-        print ("Error in Selection Sync")
-        print (e)
-        raise e
+        from .__init__ import DOERROR
+        if DOERROR:
+            print ("Error in Selection Sync")
+            print (e)
+            raise e
     return SELECTION_POLL_RATE
 
 def set_bone_selection(pose_bone, selection_state):