forked from LeenkxTeam/LNXSDK
		
	
		
			
	
	
		
			26 lines
		
	
	
		
			740 B
		
	
	
	
		
			Python
		
	
	
	
	
	
		
		
			
		
	
	
			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()}'
							 |