瀏覽代碼

UI: Warning for incorrect input in Driver Variable node

Joseph Brandenburg 5 月之前
父節點
當前提交
d86bfd7e08
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      misc_nodes.py

+ 2 - 0
misc_nodes.py

@@ -808,6 +808,8 @@ class UtilityDriverVariable(MantisNode):
 
 
         v_type = self.evaluate_input("Variable Type")
         v_type = self.evaluate_input("Variable Type")
         i = self.evaluate_input("Property Index"); dVarChannel = ""
         i = self.evaluate_input("Property Index"); dVarChannel = ""
+        if not isinstance(i, (int, float)):
+            raise RuntimeError(f" {self} has invalid input for \"Property Index\".")
         if (i >= 0): #negative values will use the vector property.
         if (i >= 0): #negative values will use the vector property.
             if self.evaluate_input("Property") == 'location':
             if self.evaluate_input("Property") == 'location':
                 if   i == 0: dVarChannel = "LOC_X"
                 if   i == 0: dVarChannel = "LOC_X"