armory/blender/arm/logicnode/physics_set_activation_state.py

28 lines
975 B
Python
Raw Normal View History

2020-09-05 15:31:28 +02:00
import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
2020-09-06 20:10:51 +02:00
class SetActivationStateNode(Node, ArmLogicTreeNode):
2020-09-05 15:31:28 +02:00
'''Set Activation State Node'''
bl_idname = 'LNSetActivationStateNode'
bl_label = 'Set Activation State'
bl_icon = 'NONE'
2020-09-06 20:10:51 +02:00
property0: EnumProperty(
items = [('Inactive', 'Inactive', 'Inactive'),
('Active', 'Active', 'Active'),
('Always Active', 'Always Active', 'Always Active'),
('Always Inactive', 'Always Inactive', 'Always Inactive'),
],
name='', default='Inactive')
2020-09-05 15:31:28 +02:00
def init(self, context):
self.inputs.new('ArmNodeSocketAction', 'In')
self.inputs.new('ArmNodeSocketObject', 'Object')
self.outputs.new('ArmNodeSocketAction', 'Out')
2020-09-06 20:10:51 +02:00
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
2020-09-05 15:31:28 +02:00
add_node(SetActivationStateNode, category='Physics')