Merge pull request #1974 from knowledgenude/master

Replace None node
This commit is contained in:
Lubos Lenco 2020-10-31 17:00:06 +01:00 committed by GitHub
commit ab6934c5c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 5 deletions

View file

@ -0,0 +1,16 @@
package armory.logicnode;
class DefaultIfNullNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Dynamic {
var v1: Dynamic = inputs[0].get();
var v2: Dynamic = inputs[1].get();
v1 != null ? return v1 : return v2;
}
}

View file

@ -4,7 +4,7 @@ from arm.logicnode.arm_nodes import *
class AlternateNode(ArmLogicTreeNode):
"""Activates the outputs "0" and "1" alternating every time it is active."""
bl_idname = 'LNAlternateNode'
bl_label = 'Alternate'
bl_label = 'Alternate Output'
arm_section = 'flow'
arm_version = 1

View file

@ -6,7 +6,7 @@ class IsNotNoneNode(ArmLogicTreeNode):
@seeNode Is None"""
bl_idname = 'LNIsNotNoneNode'
bl_label = 'Is Not None'
bl_label = 'Is Not Null'
arm_version = 1
def init(self, context):

View file

@ -7,7 +7,7 @@ class IsNoneNode(ArmLogicTreeNode):
@seeNode Is Not None"""
bl_idname = 'LNIsNoneNode'
bl_label = 'Is None'
bl_label = 'Is Null'
arm_version = 1
def init(self, context):

View file

@ -3,9 +3,9 @@ from arm.logicnode.arm_nodes import *
class NoneNode(ArmLogicTreeNode):
"""A `null` value that can be used in comparisons and conditions."""
bl_idname = 'LNNoneNode'
bl_label = 'None'
bl_label = 'Null'
arm_version = 1
def init(self, context):
super(NoneNode, self).init(context)
self.add_output('NodeSocketShader', 'None')
self.add_output('NodeSocketShader', 'Null')

View file

@ -0,0 +1,13 @@
from arm.logicnode.arm_nodes import *
class DefaultIfNullNode(ArmLogicTreeNode):
"""Returns the value in `Value In` if it is not `null`, otherwise the value in `Default` will be returned."""
bl_idname = 'LNDefaultIfNullNode'
bl_label = 'Default If Null'
arm_version = 1
def init(self, context):
super(DefaultIfNullNode, self).init(context)
self.inputs.new('NodeSocketShader', 'Value In')
self.inputs.new('NodeSocketShader', 'Default')
self.outputs.new('NodeSocketShader', 'Value Out')