Skip to content

Commit

Permalink
Merge pull request #3061 from t3du/Main
Browse files Browse the repository at this point in the history
Splice Array: array output
  • Loading branch information
luboslenco authored Oct 16, 2024
2 parents 9321675 + 527485a commit b3f330c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
10 changes: 9 additions & 1 deletion Sources/armory/logicnode/ArraySpliceNode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package armory.logicnode;

class ArraySpliceNode extends LogicNode {

var splice: Array<Dynamic>;

public function new(tree: LogicTree) {
super(tree);
}
Expand All @@ -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;

}
}
2 changes: 1 addition & 1 deletion blender/arm/logicnode/array/LN_array_display.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion blender/arm/logicnode/array/LN_array_filter.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions blender/arm/logicnode/array/LN_array_splice.py
Original file line number Diff line number Diff line change
@@ -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')
Expand All @@ -15,3 +15,4 @@ def arm_init(self, context):
self.add_input('ArmIntSocket', 'Length')

self.add_output('ArmNodeSocketAction', 'Out')
self.add_output('ArmNodeSocketArray', 'Array')

0 comments on commit b3f330c

Please sign in to comment.