armory/blender/arm/logicnode/event_on_input.py

25 lines
742 B
Python
Raw Normal View History

2017-04-03 22:29:46 +02:00
import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class OnInputNode(Node, ArmLogicTreeNode):
'''On input node'''
2017-04-04 23:11:31 +02:00
bl_idname = 'LNOnInputNode'
2017-04-03 22:29:46 +02:00
bl_label = 'On Input'
bl_icon = 'CURVE_PATH'
property0 = EnumProperty(
items = [('Down', 'Down', 'Down'),
('Started', 'Started', 'Started'),
('Released', 'Released', 'Released'),
('Moved', 'Moved', 'Moved')],
name='', default='Down')
def init(self, context):
2017-04-08 00:34:45 +02:00
self.outputs.new('ArmNodeSocketOperator', 'Out')
2017-04-03 22:29:46 +02:00
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
add_node(OnInputNode, category='Event')