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 *
|
|
|
|
|
|
|
|
class GetChildNode(Node, ArmLogicTreeNode):
|
|
|
|
'''Get child node'''
|
|
|
|
bl_idname = 'LNGetChildNode'
|
|
|
|
bl_label = 'Get Child'
|
2018-12-18 23:48:38 +01:00
|
|
|
bl_icon = 'QUESTION'
|
|
|
|
property0: EnumProperty(
|
2018-07-04 12:29:41 +02:00
|
|
|
items = [('By Name', 'By Name', 'By Name'),
|
|
|
|
('Contains', 'Contains', 'Contains'),
|
|
|
|
('Starts With', 'Starts With', 'Starts With'),
|
|
|
|
('Ends With', 'Ends With', 'Ends With'),
|
|
|
|
],
|
|
|
|
name='', default='By Name')
|
2017-04-08 00:34:45 +02:00
|
|
|
|
|
|
|
def init(self, context):
|
|
|
|
self.inputs.new('ArmNodeSocketObject', 'Object')
|
|
|
|
self.inputs.new('NodeSocketString', 'Child')
|
|
|
|
self.outputs.new('ArmNodeSocketObject', 'Object')
|
|
|
|
|
2018-07-04 12:29:41 +02:00
|
|
|
def draw_buttons(self, context, layout):
|
|
|
|
layout.prop(self, 'property0')
|
|
|
|
|
2017-04-08 00:34:45 +02:00
|
|
|
add_node(GetChildNode, category='Value')
|