armory/blender/arm/logicnode/logic/LN_loop.py

31 lines
1.1 KiB
Python
Raw Normal View History

2017-04-03 22:29:46 +02:00
from arm.logicnode.arm_nodes import *
class LoopNode(ArmLogicTreeNode):
2020-09-28 15:58:41 +02:00
"""Resembles a for-loop (`for (i in from...to)`) that is executed at
once when this node is activated.
@seeNode While
@seeNode Loop Break
@input From: The value to start the loop from (inclusive)
@input To: The value to end the loop at (exclusive)
@output Loop: Active at every iteration of the loop
@output Index: The index for the current iteration
@output Done: Activated once when the looping is done
"""
2017-04-04 23:11:31 +02:00
bl_idname = 'LNLoopNode'
2017-04-03 22:29:46 +02:00
bl_label = 'Loop'
2020-09-28 15:58:41 +02:00
bl_description = 'Resembles a for-loop that is executed at once when this node is activated'
2020-10-27 19:44:37 +01:00
arm_section = 'flow'
arm_version = 1
2017-04-03 22:29:46 +02:00
def init(self, context):
super(LoopNode, self).init(context)
2020-09-08 21:49:02 +02:00
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketInt', 'From')
self.add_input('NodeSocketInt', 'To')
self.add_output('ArmNodeSocketAction', 'Loop')
self.add_output('NodeSocketInt', 'Index')
self.add_output('ArmNodeSocketAction', 'Done')