소스 검색

Fix Vector Division

Joseph Brandenburg 3 달 전
부모
커밋
d2a048a2b7
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      math_nodes.py

+ 3 - 1
math_nodes.py

@@ -137,7 +137,9 @@ class MathStaticVector(MantisNode):
         if self.evaluate_input("Operation") == "MULTIPLY":
             v_result = a*b
         if self.evaluate_input("Operation") == "DIVIDE":
-            v_result = a/b
+            v_result = Vector((0,0,0)) # channel-wise division
+            for i, (axis_a, axis_b) in enumerate(zip(a,b)):
+                v_result[i] = axis_a/axis_b
         if self.evaluate_input("Operation") == "POWER":
             v_result = a**b
         # since these are unary, we need to make a copy lest we create spooky effects elsewhere.