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
|
|
|
|
2020-09-08 21:16:20 +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'
|
2020-10-27 19:44:37 +01:00
|
|
|
arm_section = 'group'
|
2020-09-13 11:27:58 +02:00
|
|
|
arm_version = 1
|
2017-04-08 00:34:45 +02:00
|
|
|
|
|
|
|
@property
|
|
|
|
def property0(self):
|
2020-04-10 14:22:04 +02:00
|
|
|
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
|
|
|
|
2019-02-08 12:50:12 +01:00
|
|
|
property0_: PointerProperty(name='Group', type=bpy.types.NodeTree)
|
2017-04-08 00:34:45 +02:00
|
|
|
|
|
|
|
def init(self, context):
|
2020-09-13 11:27:58 +02:00
|
|
|
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='')
|