ソースを参照

Fix: Vectors were reused leading to calculation bugs in other nodes

Joseph Brandenburg 9 ヶ月 前
コミット
630809d0fd
2 ファイル変更4 行追加1 行削除
  1. 3 0
      math_containers.py
  2. 1 1
      misc_containers.py

+ 3 - 0
math_containers.py

@@ -194,6 +194,8 @@ class MathStaticVector:
             v_result = a/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.
+        a = a.copy()
         if self.evaluate_input("Operation") == "SCALE":
             v_result = a.normalized() * s
         if self.evaluate_input("Operation") == "LENGTH":
@@ -205,6 +207,7 @@ class MathStaticVector:
         if self.evaluate_input("Operation") == "NORMALIZE":
             v_result =  a.normalized()
         self.parameters["Result Float"] = f_result
+        # if v_result:
         self.parameters["Result Vector"] = v_result
         self.prepared = True
         self.executed = True

+ 1 - 1
misc_containers.py

@@ -1213,7 +1213,7 @@ class UtilityPointFromBoneMatrix:
         from mathutils import Vector
         matrix = self.evaluate_input("Bone Matrix")
         head, rotation, _scale = matrix.copy().decompose()
-        tail = head + (rotation @ Vector((0,1,0)))*matrix[3][3]
+        tail = head.copy() + (rotation @ Vector((0,1,0)))*matrix[3][3]
         self.parameters["Point"] = head.lerp(tail, self.evaluate_input("Head/Tail"))
         self.prepared = True
         self.executed = True