2017-11-27 09:30:06 +01:00
|
|
|
import bpy
|
2020-09-08 23:21:41 +02:00
|
|
|
|
2017-11-27 09:30:06 +01:00
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
2020-09-08 23:21:41 +02:00
|
|
|
|
2020-09-08 21:16:20 +02:00
|
|
|
class GroupNode(ArmLogicTreeNode):
|
2020-09-28 15:58:41 +02:00
|
|
|
"""Returns the collection's objects as an array.
|
|
|
|
|
|
|
|
@seeNode Get Collection"""
|
2017-11-27 09:30:06 +01:00
|
|
|
bl_idname = 'LNGroupNode'
|
2019-01-22 15:35:06 +01:00
|
|
|
bl_label = 'Collection'
|
2020-09-13 11:27:58 +02:00
|
|
|
arm_version = 1
|
2017-11-27 09:30:06 +01:00
|
|
|
|
2019-01-22 15:35:06 +01:00
|
|
|
property0: PointerProperty(name='', type=bpy.types.Collection)
|
2020-09-08 17:03:24 +02:00
|
|
|
|
2017-11-27 09:30:06 +01:00
|
|
|
def init(self, context):
|
2020-09-13 11:27:58 +02:00
|
|
|
super(GroupNode, self).init(context)
|
2020-09-08 21:49:02 +02:00
|
|
|
self.add_output('ArmNodeSocketArray', 'Array')
|
2017-11-27 09:30:06 +01:00
|
|
|
|
|
|
|
def draw_buttons(self, context, layout):
|
2019-01-22 15:35:06 +01:00
|
|
|
layout.prop_search(self, 'property0', bpy.data, 'collections', icon='NONE', text='')
|
2017-11-27 09:30:06 +01:00
|
|
|
|
2020-09-09 20:48:35 +02:00
|
|
|
add_node(GroupNode, category=PKG_AS_CATEGORY, section='collection')
|