new-nodes

This commit is contained in:
knowledgenude 2020-11-06 17:20:28 -03:00
parent 085146b245
commit 72186140a9
6 changed files with 62 additions and 2 deletions

View file

@ -0,0 +1,18 @@
package armory.logicnode;
class ClampNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Dynamic {
var value: kha.FastFloat = inputs[0].get();
var min: kha.FastFloat = inputs[1].get();
var max: kha.FastFloat = inputs[2].get();
if (value == null || min == null || max == null) return null;
value <= min ? return min : value >= max ? return max : return value;
}
}

View file

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

View file

@ -0,0 +1,14 @@
from arm.logicnode.arm_nodes import *
class ClampNode(ArmLogicTreeNode):
"""Keeps the value inside the given bound."""
bl_idname = 'LNClampNode'
bl_label = 'Clamp'
arm_version = 1
def init(self, context):
super(ClampNode, self).init(context)
self.add_input('NodeSocketFloat', 'Value')
self.add_input('NodeSocketFloat', 'Min')
self.add_input('NodeSocketFloat', 'Max')
self.add_output('NodeSocketFloat', 'Result')

View file

@ -1,7 +1,7 @@
from arm.logicnode.arm_nodes import *
class GetDebugConsoleSettings(ArmLogicTreeNode):
"""Get Debug Console Settings"""
"""Returns the debug console settings."""
bl_idname = 'LNGetDebugConsoleSettings'
bl_label = 'Get Debug Console Settings'
arm_version = 1

View file

@ -1,7 +1,7 @@
from arm.logicnode.arm_nodes import *
class SetDebugConsoleSettings(ArmLogicTreeNode):
"""Set Debug Console Settings"""
"""Sets the debug console settings."""
bl_idname = 'LNSetDebugConsoleSettings'
bl_label = 'Set Debug Console Settings'
arm_version = 1

View file

@ -0,0 +1,12 @@
from arm.logicnode.arm_nodes import *
class GetTraitPausedNode(ArmLogicTreeNode):
"""Returns whether the given trait is paused."""
bl_idname = 'LNGetTraitPausedNode'
bl_label = 'Get Trait Paused'
arm_version = 1
def init(self, context):
super(GetTraitPausedNode, self).init(context)
self.add_input('NodeSocketString', 'Trait')
self.add_output('NodeSocketBool', 'Paused')