diff --git a/Sources/armory/logicnode/ArraySpliceNode.hx b/Sources/armory/logicnode/ArraySpliceNode.hx index f1e12a1500..9963a9410b 100644 --- a/Sources/armory/logicnode/ArraySpliceNode.hx +++ b/Sources/armory/logicnode/ArraySpliceNode.hx @@ -2,6 +2,8 @@ package armory.logicnode; class ArraySpliceNode extends LogicNode { + var splice: Array; + public function new(tree: LogicTree) { super(tree); } @@ -13,8 +15,14 @@ class ArraySpliceNode extends LogicNode { var i = inputs[2].get(); var len = inputs[3].get(); - ar.splice(i, len); + splice = ar.splice(i, len); runOutput(0); } + + override function get(from: Int): Dynamic { + + return splice; + + } } diff --git a/blender/arm/logicnode/array/LN_array_display.py b/blender/arm/logicnode/array/LN_array_display.py index 6dd6cb31e4..d9484b4092 100644 --- a/blender/arm/logicnode/array/LN_array_display.py +++ b/blender/arm/logicnode/array/LN_array_display.py @@ -1,7 +1,7 @@ from arm.logicnode.arm_nodes import * class ArrayDisplayNode(ArmLogicTreeNode): - """Returns the length of the given array.""" + """Returns the display of the given array.""" bl_idname = 'LNArrayDisplayNode' bl_label = 'Array Display' arm_version = 1 diff --git a/blender/arm/logicnode/array/LN_array_filter.py b/blender/arm/logicnode/array/LN_array_filter.py index 5d4204e136..cd9840c962 100644 --- a/blender/arm/logicnode/array/LN_array_filter.py +++ b/blender/arm/logicnode/array/LN_array_filter.py @@ -1,7 +1,7 @@ from arm.logicnode.arm_nodes import * class ArrayFilterNode(ArmLogicTreeNode): - """Returns the length of the given array.""" + """Returns an array with the filtered items of the given array.""" bl_idname = 'LNArrayFilterNode' bl_label = 'Array Filter' arm_version = 1 diff --git a/blender/arm/logicnode/array/LN_array_splice.py b/blender/arm/logicnode/array/LN_array_splice.py index 1f367cc533..9659bed9c1 100644 --- a/blender/arm/logicnode/array/LN_array_splice.py +++ b/blender/arm/logicnode/array/LN_array_splice.py @@ -1,12 +1,12 @@ from arm.logicnode.arm_nodes import * class ArraySpliceNode(ArmLogicTreeNode): - """Removes the given amount of elements from the given array. + """Removes the given amount of elements from the given array and returns it. @see [Haxe API](https://api.haxe.org/Array.html#splice)""" bl_idname = 'LNArraySpliceNode' bl_label = 'Array Splice' - arm_version = 1 + arm_version = 2 def arm_init(self, context): self.add_input('ArmNodeSocketAction', 'In') @@ -15,3 +15,4 @@ def arm_init(self, context): self.add_input('ArmIntSocket', 'Length') self.add_output('ArmNodeSocketAction', 'Out') + self.add_output('ArmNodeSocketArray', 'Array')