armory/blender/arm/logicnode/action_call_group.py

27 lines
838 B
Python
Raw Normal View History

2017-04-08 00:34:45 +02:00
import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
import arm.utils
class CallGroupNode(Node, ArmLogicTreeNode):
'''Call group node'''
bl_idname = 'LNCallGroupNode'
2017-11-27 00:13:37 +01:00
bl_label = 'Call Node Group'
2018-12-18 23:48:38 +01:00
bl_icon = 'QUESTION'
2017-04-08 00:34:45 +02:00
@property
def property0(self):
2017-11-09 19:47:10 +01:00
return arm.utils.safesrc(bpy.data.worlds['Arm'].arm_project_package) + '.node.' + arm.utils.safesrc(self.property0_)
2017-04-08 00:34:45 +02:00
2018-12-18 23:48:38 +01:00
property0_: StringProperty(name='Group', default='')
2017-04-08 00:34:45 +02:00
def init(self, context):
2017-04-08 20:05:35 +02:00
self.inputs.new('ArmNodeSocketAction', 'In')
self.outputs.new('ArmNodeSocketAction', 'Out')
2017-04-08 00:34:45 +02:00
def draw_buttons(self, context, layout):
layout.prop_search(self, 'property0_', bpy.data, 'node_groups', icon='NONE', text='')
2017-04-08 20:05:35 +02:00
add_node(CallGroupNode, category='Action')