armory/blender/arm/logicnode/miscellaneous/LN_call_group.py

28 lines
872 B
Python
Raw Normal View History

2017-04-08 00:34:45 +02:00
import bpy
2020-09-08 23:21:41 +02:00
2017-04-08 00:34:45 +02:00
import arm.utils
2020-09-08 23:21:41 +02:00
from arm.logicnode.arm_nodes import *
2017-04-08 00:34:45 +02:00
class CallGroupNode(ArmLogicTreeNode):
2020-10-05 19:55:56 +02:00
"""Calls the given group of nodes."""
2017-04-08 00:34:45 +02:00
bl_idname = 'LNCallGroupNode'
2017-11-27 00:13:37 +01:00
bl_label = 'Call Node Group'
arm_version = 1
2017-04-08 00:34:45 +02:00
@property
def property0(self):
return arm.utils.safesrc(bpy.data.worlds['Arm'].arm_project_package) + '.node.' + arm.utils.safesrc(self.property0_.name)
2017-04-08 00:34:45 +02:00
property0_: PointerProperty(name='Group', type=bpy.types.NodeTree)
2017-04-08 00:34:45 +02:00
def init(self, context):
super(CallGroupNode, self).init(context)
2020-09-08 21:49:02 +02:00
self.add_input('ArmNodeSocketAction', 'In')
self.add_output('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='')
add_node(CallGroupNode, category=PKG_AS_CATEGORY, section='group')