armory/blender/arm/logicnode/input_on_surface.py

25 lines
762 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 *
2017-04-10 21:17:17 +02:00
class OnSurfaceNode(Node, ArmLogicTreeNode):
'''On surface node'''
bl_idname = 'LNOnSurfaceNode'
bl_label = 'On Surface'
2017-04-03 22:29:46 +02:00
bl_icon = 'CURVE_PATH'
property0 = EnumProperty(
2017-04-10 21:17:17 +02:00
items = [('Touched', 'Touched', 'Touched'),
2017-04-03 22:29:46 +02:00
('Started', 'Started', 'Started'),
('Released', 'Released', 'Released'),
('Moved', 'Moved', 'Moved')],
2017-04-10 21:17:17 +02:00
name='', default='Touched')
2017-04-03 22:29:46 +02:00
def init(self, context):
2017-04-08 20:05:35 +02:00
self.outputs.new('ArmNodeSocketAction', 'Out')
2017-04-03 22:29:46 +02:00
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
2017-04-10 21:17:17 +02:00
add_node(OnSurfaceNode, category='Input')