소스 검색

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")
         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 self.evaluate_input("Property") == 'location':
                 if   i == 0: dVarChannel = "LOC_X"