new-nodes
This commit is contained in:
parent
085146b245
commit
72186140a9
18
Sources/armory/logicnode/ClampNode.hx
Normal file
18
Sources/armory/logicnode/ClampNode.hx
Normal 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;
|
||||
}
|
||||
}
|
16
Sources/armory/logicnode/GetTraitPausedNode.hx
Normal file
16
Sources/armory/logicnode/GetTraitPausedNode.hx
Normal 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;
|
||||
}
|
||||
}
|
14
blender/arm/logicnode/math/LN_clamp.py
Normal file
14
blender/arm/logicnode/math/LN_clamp.py
Normal 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')
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
12
blender/arm/logicnode/trait/LN_get_trait_paused.py
Normal file
12
blender/arm/logicnode/trait/LN_get_trait_paused.py
Normal 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')
|
Loading…
Reference in a new issue