armory/blender/arm/logicnode/event_on_update.py

24 lines
744 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 OnUpdateNode(Node, ArmLogicTreeNode):
'''On update node'''
2017-04-04 23:11:31 +02:00
bl_idname = 'LNOnUpdateNode'
2017-04-03 22:29:46 +02:00
bl_label = 'On Update'
2020-08-07 19:00:46 +02:00
bl_icon = 'NONE'
property0: EnumProperty(
items = [('Update', 'Update', 'Update'),
('Late Update', 'Late Update', 'Late Update'),
('Physics Pre-Update', 'Physics Pre-Update', 'Physics Pre-Update')],
name='On', default='Update')
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-03 22:29:46 +02:00
add_node(OnUpdateNode, category='Event')