2018-12-07 13:48:28 +01:00
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
2020-09-08 21:16:20 +02:00
|
|
|
class OnContactArrayNode(ArmLogicTreeNode):
|
2020-10-05 19:55:56 +02:00
|
|
|
"""Activates the output when the given rigid body make contact with other given rigid bodies."""
|
2018-12-07 13:48:28 +01:00
|
|
|
bl_idname = 'LNOnContactArrayNode'
|
2020-08-07 19:03:29 +02:00
|
|
|
bl_label = 'On Contact Array'
|
2020-10-27 19:44:37 +01:00
|
|
|
arm_section = 'contact'
|
2020-09-13 11:27:58 +02:00
|
|
|
arm_version = 1
|
2020-10-27 19:44:37 +01:00
|
|
|
|
2018-12-18 23:48:38 +01:00
|
|
|
property0: EnumProperty(
|
2020-11-18 17:50:24 +01:00
|
|
|
items = [('begin', 'Begin', 'The contact between the rigid bodies begins'),
|
2020-11-17 21:55:53 +01:00
|
|
|
('overlap', 'Overlap', 'The contact between the rigid bodies is happening'),
|
|
|
|
('end', 'End', 'The contact between the rigid bodies ends')],
|
|
|
|
name='', default='begin')
|
2018-12-07 13:48:28 +01:00
|
|
|
|
|
|
|
def init(self, context):
|
2020-09-13 11:27:58 +02:00
|
|
|
super(OnContactArrayNode, self).init(context)
|
2020-10-05 19:55:56 +02:00
|
|
|
self.add_input('ArmNodeSocketObject', 'RB')
|
|
|
|
self.add_input('ArmNodeSocketArray', 'RBs')
|
2020-11-17 16:01:15 +01:00
|
|
|
|
2020-09-08 21:49:02 +02:00
|
|
|
self.add_output('ArmNodeSocketAction', 'Out')
|
2018-12-07 13:48:28 +01:00
|
|
|
|
|
|
|
def draw_buttons(self, context, layout):
|
|
|
|
layout.prop(self, 'property0')
|