27 lines
1 KiB
Python
27 lines
1 KiB
Python
from arm.logicnode.arm_nodes import *
|
|
|
|
class OnVolumeTriggerNode(ArmLogicTreeNode):
|
|
"""Activates the output when the given rigid body enter, overlap or leave the given trigger.
|
|
|
|
@input RB: this object is taken as the entering object
|
|
@input Trigger: this object is used as the volume trigger
|
|
"""
|
|
bl_idname = 'LNOnVolumeTriggerNode'
|
|
bl_label = 'On Volume Trigger'
|
|
arm_version = 1
|
|
|
|
property0: EnumProperty(
|
|
items = [('begin', 'Begin', 'The contact between the rigid bodies starts'),
|
|
('overlap', 'Overlap', 'The contact between the rigid bodies is happening'),
|
|
('end', 'End', 'The contact between the rigid bodies ends')],
|
|
name='', default='begin')
|
|
|
|
def init(self, context):
|
|
super(OnVolumeTriggerNode, self).init(context)
|
|
self.add_input('ArmNodeSocketObject', 'RB')
|
|
self.add_input('ArmNodeSocketObject', 'Trigger')
|
|
|
|
self.add_output('ArmNodeSocketAction', 'Out')
|
|
|
|
def draw_buttons(self, context, layout):
|
|
layout.prop(self, 'property0')
|