Files
LNXSDK/leenkx/blender/lnx/logicnode/custom/LN_leenkx_message_parser.py
2026-10-06 02:10:08 -07:00

38 lines
1.4 KiB
Python

from lnx.logicnode.lnx_nodes import *
class LeenkxMessageParserNode(LnxLogicTreeNode):
"""Leenkx Message Parser"""
bl_idname = 'LNLeenkxMessageParserNode'
bl_label = 'Leenkx Message Parser'
bl_description = 'Parses messages incoming from the Leenkx network'
lnx_category = 'Leenkx'
lnx_version = 1
property0: HaxeEnumProperty('property0', items=[
('string', 'String', 'Parse the message as a string'),
('vector', 'Vector', 'Parse the message as a vector (Vec4)'),
('float', 'Float', 'Parse the message as a float'),
('integer', 'Integer', 'Parse the message as an integer'),
('boolean', 'Boolean', 'Parse the message as a boolean'),
('transform', 'Transform', 'Parse the message as a transform (Mat4)'),
('rotation', 'Rotation', 'Parse the message as a rotation (Quat)')
], name='', default='string')
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxStringSocket', 'API')
self.add_input('LnxDynamicSocket', 'Data')
self.add_output('LnxNodeSocketAction', 'Out')
self.add_output('LnxDynamicSocket', 'API')
self.add_output('LnxDynamicSocket', 'Data')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
def register():
add_category('Leenkx', icon='ORIENTATION_CURSOR')
LeenkxMessageParserNode.on_register()