2017-11-27 09:30:06 +01:00
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
2020-09-08 21:16:20 +02:00
|
|
|
class ArrayRemoveValueNode(ArmLogicTreeNode):
|
2020-10-05 19:55:56 +02:00
|
|
|
"""Removes the element from the given array by its value.
|
2020-09-28 15:58:41 +02:00
|
|
|
|
|
|
|
@seeNode Array Remove By Index"""
|
2017-11-27 09:30:06 +01:00
|
|
|
bl_idname = 'LNArrayRemoveValueNode'
|
2020-09-09 20:27:54 +02:00
|
|
|
bl_label = 'Array Remove By Value'
|
2020-09-13 11:27:58 +02:00
|
|
|
arm_version = 1
|
2017-11-27 09:30:06 +01:00
|
|
|
|
2018-06-12 23:48:01 +02:00
|
|
|
# def __init__(self):
|
|
|
|
# array_nodes[str(id(self))] = self
|
|
|
|
|
2017-11-27 09:30:06 +01:00
|
|
|
def init(self, context):
|
2020-09-13 11:27:58 +02:00
|
|
|
super(ArrayRemoveValueNode, self).init(context)
|
2020-09-08 21:49:02 +02:00
|
|
|
self.add_input('ArmNodeSocketAction', 'In')
|
|
|
|
self.add_input('ArmNodeSocketArray', 'Array')
|
|
|
|
self.add_input('NodeSocketShader', 'Value')
|
|
|
|
self.add_output('ArmNodeSocketAction', 'Out')
|
|
|
|
self.add_output('NodeSocketShader', 'Value')
|
2017-11-27 09:30:06 +01:00
|
|
|
|
2018-06-12 23:48:01 +02:00
|
|
|
# def draw_buttons(self, context, layout):
|
|
|
|
# row = layout.row(align=True)
|
|
|
|
|
|
|
|
# op = row.operator('arm.node_add_input_value', text='New', icon='PLUS', emboss=True)
|
|
|
|
# op.node_index = str(id(self))
|
|
|
|
# op.socket_type = 'NodeSocketShader'
|
|
|
|
# op2 = row.operator('arm.node_remove_input_value', text='', icon='X', emboss=True)
|
|
|
|
# op2.node_index = str(id(self))
|
|
|
|
|
2020-09-09 20:48:35 +02:00
|
|
|
add_node(ArrayRemoveValueNode, category=PKG_AS_CATEGORY)
|