2017-04-03 22:29:46 +02:00
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
2020-09-08 21:16:20 +02:00
|
|
|
class OnUpdateNode(ArmLogicTreeNode):
|
2020-09-28 15:58:41 +02:00
|
|
|
"""Activates the output on every frame.
|
|
|
|
|
|
|
|
@option Update: (default) activates the output every frame.
|
|
|
|
@option Late Update: activates the output after all non-late updates are calculated.
|
|
|
|
@option Physics Pre-Update: activates the output before calculating the physics.
|
|
|
|
Only available when using a physics engine."""
|
2017-04-04 23:11:31 +02:00
|
|
|
bl_idname = 'LNOnUpdateNode'
|
2017-04-03 22:29:46 +02:00
|
|
|
bl_label = 'On Update'
|
2020-09-13 11:27:58 +02:00
|
|
|
arm_version = 1
|
2019-01-23 04:21:46 +01:00
|
|
|
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')
|
2020-09-08 17:03:24 +02:00
|
|
|
|
2017-04-03 22:29:46 +02:00
|
|
|
def init(self, context):
|
2020-09-13 11:27:58 +02:00
|
|
|
super(OnUpdateNode, self).init(context)
|
2020-09-08 21:49:02 +02:00
|
|
|
self.add_output('ArmNodeSocketAction', 'Out')
|
2017-04-03 22:29:46 +02:00
|
|
|
|
2019-01-23 04:21:46 +01:00
|
|
|
def draw_buttons(self, context, layout):
|
|
|
|
layout.prop(self, 'property0')
|
|
|
|
|
2020-09-09 20:48:35 +02:00
|
|
|
add_node(OnUpdateNode, category=PKG_AS_CATEGORY)
|