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):
|
2020-09-08 17:03:24 +02:00
|
|
|
"""Call group node"""
|
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-08-07 18:58:19 +02:00
|
|
|
bl_icon = 'NONE'
|
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):
|
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='')
|
|
|
|
|
2020-09-08 17:03:24 +02:00
|
|
|
add_node(CallGroupNode, category=MODULE_AS_CATEGORY, section='group')
|