Explorar o código

add atan2 to static float math node

Joseph Brandenburg hai 8 meses
pai
achega
3a674a5167
Modificáronse 2 ficheiros con 5 adicións e 8 borrados
  1. 3 1
      math_containers.py
  2. 2 7
      socket_definitions.py

+ 3 - 1
math_containers.py

@@ -65,7 +65,6 @@ class MathStaticInt:
         if self.evaluate_input("Operation") == "LESS THAN":
             result = int(a < b)
         self.parameters["Result Int"] = result
-
         self.prepared = True
         self.executed = True
 
@@ -125,6 +124,9 @@ class MathStaticFloat:
             result = float(a > b)
         if self.evaluate_input("Operation") == "LESS THAN":
             result = float(a < b)
+        if self.evaluate_input("Operation") == "ARCTAN2":
+            from math import atan2
+            result = atan2(a,b)
         self.parameters["Result Float"] = result
         self.prepared = True
         self.executed = True

+ 2 - 7
socket_definitions.py

@@ -2114,12 +2114,6 @@ class EnumKeyframeBezierHandleTypeSocket(NodeSocket):
 
 
 
-
-
-
-
-
-
 enumFloatOperations = (('ADD', 'Add', 'Add'),
                       ('SUBTRACT', "Subtract", "Subtract"),
                       ('MULTIPLY', "Multiply", "Multiply"),
@@ -2131,7 +2125,8 @@ enumFloatOperations = (('ADD', 'Add', 'Add'),
                       ('MAXIMUM', "Maximum", "Maximum"),
                       ('MINIMUM', "Minimum", "Minimum"),
                       ('GREATER THAN', "Greater Than", "Greater Than"),
-                      ('LESS THAN', "Less Than", "Less Than"),)
+                      ('LESS THAN', "Less Than", "Less Than"),
+                      ('ARCTAN2', "atan2", "2-argument arctan function"),)
 
 class MathFloatOperation(NodeSocket):
     """Float Math Operation"""