commit
fabb4c0c3c
|
@ -19,6 +19,8 @@ class GateNode extends LogicNode {
|
|||
switch (property0) {
|
||||
case "Equal":
|
||||
cond = Std.isOfType(v1, Vec4) ? v1.equals(v2) : v1 == v2;
|
||||
case "Not Equal":
|
||||
cond = Std.isOfType(v1, Vec4) ? !v1.equals(v2) : v1 != v2;
|
||||
case "Almost Equal":
|
||||
cond = Std.isOfType(v1, Vec4) ? v1.almostEquals(v2, property1) : Math.abs(v1 - v2) < property1;
|
||||
case "Greater":
|
||||
|
|
|
@ -11,7 +11,7 @@ def remove_extra_inputs(self, context):
|
|||
class GateNode(ArmLogicTreeNode):
|
||||
"""Logic nodes way to do "if" statements. When activated, it
|
||||
compares if its two inputs are being Equal, Greater Equal,
|
||||
Less Equal, Not Equal or Between regardless of variable type, and passes
|
||||
Less Equal, Not Equal, or Between, regardless of variable type, and passes
|
||||
through its active input to the output that matches the result of
|
||||
the comparison.
|
||||
|
||||
|
@ -25,6 +25,7 @@ class GateNode(ArmLogicTreeNode):
|
|||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('Equal', 'Equal', 'Equal'),
|
||||
('Not Equal', 'Not Equal', 'Not Equal'),
|
||||
('Almost Equal', 'Almost Equal', 'Almost Equal'),
|
||||
('Greater', 'Greater', 'Greater'),
|
||||
('Greater Equal', 'Greater Equal', 'Greater Equal'),
|
||||
|
@ -62,7 +63,7 @@ class GateNode(ArmLogicTreeNode):
|
|||
op.socket_type = 'ArmDynamicSocket'
|
||||
op2 = row.operator('arm.node_remove_input', text='', icon='X', emboss=True)
|
||||
op2.node_index = str(id(self))
|
||||
|
||||
|
||||
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
|
||||
if self.arm_version not in (0, 1):
|
||||
raise LookupError()
|
||||
|
|
Loading…
Reference in a new issue