2017-11-02 23:32:36 +01:00
|
|
|
import bpy
|
|
|
|
from bpy.props import *
|
|
|
|
from bpy.types import Node, NodeSocket
|
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
2020-09-08 21:16:20 +02:00
|
|
|
class ArrayLengthNode(ArmLogicTreeNode):
|
2017-11-02 23:32:36 +01:00
|
|
|
'''Array length node'''
|
|
|
|
bl_idname = 'LNArrayLengthNode'
|
|
|
|
bl_label = 'Array Length'
|
2020-08-07 19:00:46 +02:00
|
|
|
bl_icon = 'NONE'
|
2017-11-02 23:32:36 +01:00
|
|
|
|
|
|
|
def init(self, context):
|
2018-06-12 23:16:28 +02:00
|
|
|
self.inputs.new('ArmNodeSocketArray', 'Array')
|
2017-11-02 23:32:36 +01:00
|
|
|
self.outputs.new('NodeSocketInt', 'Length')
|
|
|
|
|
2020-09-08 17:03:24 +02:00
|
|
|
add_node(ArrayLengthNode, category=MODULE_AS_CATEGORY)
|