2020-09-05 15:31:28 +02:00
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
2020-09-09 21:11:49 +02:00
|
|
|
class SetActivationStateNode(ArmLogicTreeNode):
|
2020-11-17 18:46:14 +01:00
|
|
|
"""Sets the rigid body simulation state of the given object."""
|
2020-09-05 15:31:28 +02:00
|
|
|
bl_idname = 'LNSetActivationStateNode'
|
2020-09-29 18:38:17 +02:00
|
|
|
bl_label = 'Set RB Activation State'
|
2020-09-05 15:31:28 +02:00
|
|
|
bl_icon = 'NONE'
|
2020-09-13 11:27:58 +02:00
|
|
|
arm_version = 1
|
2020-11-17 18:46:14 +01:00
|
|
|
|
2020-09-06 20:10:51 +02:00
|
|
|
property0: EnumProperty(
|
2020-11-17 21:35:22 +01:00
|
|
|
items = [('inactive', 'Inactive', 'The rigid body simulation is deactivated'),
|
|
|
|
('active', 'Active', 'The rigid body simulation is activated'),
|
|
|
|
('always active', 'Always Active', 'The rigid body simulation is never deactivated'),
|
|
|
|
('always inactive', 'Always Inactive', 'The rigid body simulation is never activated'),
|
2020-09-06 20:10:51 +02:00
|
|
|
],
|
2020-11-17 21:35:22 +01:00
|
|
|
name='', default='inactive')
|
2020-09-05 15:31:28 +02:00
|
|
|
|
|
|
|
def init(self, context):
|
2020-09-13 11:27:58 +02:00
|
|
|
super(SetActivationStateNode, self).init(context)
|
2020-09-05 15:31:28 +02:00
|
|
|
self.inputs.new('ArmNodeSocketAction', 'In')
|
2020-10-05 19:55:56 +02:00
|
|
|
self.inputs.new('ArmNodeSocketObject', 'RB')
|
2020-11-17 16:01:15 +01:00
|
|
|
|
2020-09-05 15:31:28 +02:00
|
|
|
self.outputs.new('ArmNodeSocketAction', 'Out')
|
|
|
|
|
2020-09-06 20:10:51 +02:00
|
|
|
def draw_buttons(self, context, layout):
|
|
|
|
layout.prop(self, 'property0')
|