LNXSDK/leenkx/blender/lnx/logicnode/event/LN_send_global_event.py
2025-01-22 16:18:30 +01:00

26 lines
740 B
Python

from lnx.logicnode.lnx_nodes import *
class SendGlobalEventNode(LnxLogicTreeNode):
"""Sends the given event to all objects in the scene.
@seeNode Send Event to Object
@seeNode On Event
@input Event: the identifier of the event"""
bl_idname = 'LNSendGlobalEventNode'
bl_label = 'Send Global Event'
lnx_version = 1
lnx_section = 'custom'
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxStringSocket', 'Event')
self.add_output('LnxNodeSocketAction', 'Out')
def draw_label(self) -> str:
if self.inputs[1].is_linked:
return self.bl_label
return f'{self.bl_label}: {self.inputs[1].get_default_value()}'