armory/blender/arm/logicnode/scene/LN_collection.py

24 lines
667 B
Python
Raw Normal View History

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
class GroupNode(ArmLogicTreeNode):
2020-10-05 19:55:56 +02:00
"""Returns the objects of the given collection as an array.
2020-09-28 15:58:41 +02:00
@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'
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)
2017-11-27 09:30:06 +01:00
def init(self, context):
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
add_node(GroupNode, category=PKG_AS_CATEGORY, section='collection')