forked from LeenkxTeam/LNXSDK
		
	
		
			
	
	
		
			31 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
		
		
			
		
	
	
			31 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
|  | import bpy | ||
|  | from bpy.props import * | ||
|  | from bpy.types import Node, NodeSocket | ||
|  | from lnx.logicnode.lnx_nodes import * | ||
|  | 
 | ||
|  | 
 | ||
|  | @deprecated('Get Cursor State') | ||
|  | class GetMouseVisibleNode(LnxLogicTreeNode): | ||
|  |     """Deprecated. It is recommended to use the 'Get Cursor State' node instead.""" | ||
|  |     bl_idname = 'LNGetMouseVisibleNode' | ||
|  |     bl_label = 'Get Mouse Visible' | ||
|  |     bl_description = "Please use the \"Get Cursor State\" node instead" | ||
|  |     lnx_category = 'Input' | ||
|  |     lnx_section = 'mouse' | ||
|  |     lnx_version = 2 | ||
|  | 
 | ||
|  |     def lnx_init(self, context): | ||
|  |         self.outputs.new('LnxBoolSocket', 'Is Visible') | ||
|  | 
 | ||
|  |     def get_replacement_node(self, node_tree: bpy.types.NodeTree): | ||
|  |         if self.lnx_version not in (0, 1): | ||
|  |             raise LookupError() | ||
|  | 
 | ||
|  |         mainnode = node_tree.nodes.new('LNGetCursorStateNode') | ||
|  |         secondnode = node_tree.nodes.new('LNNotNode') | ||
|  |         node_tree.links.new(mainnode.outputs[2], secondnode.inputs[0]) | ||
|  |         for link in self.outputs[0].links: | ||
|  |             node_tree.links.new(secondnode.outputs[0], link.to_socket) | ||
|  | 
 | ||
|  |         return [mainnode, secondnode] |