24 lines
		
	
	
		
			969 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			969 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from lnx.logicnode.lnx_nodes import *
 | |
| 
 | |
| 
 | |
| class GetMouseMovementNode(LnxLogicTreeNode):
 | |
|     """Get the movement coordinates of the mouse and the mouse wheel delta.
 | |
|     The multiplied output variants default to -1 to invert the values."""
 | |
|     bl_idname = 'LNGetMouseMovementNode'
 | |
|     bl_label = 'Get Mouse Movement'
 | |
|     lnx_section = 'mouse'
 | |
|     lnx_version = 1
 | |
| 
 | |
|     def lnx_init(self, context):
 | |
| 
 | |
|         self.add_input('LnxFloatSocket', 'X Multiplier', default_value=-1.0)
 | |
|         self.add_input('LnxFloatSocket', 'Y Multiplier', default_value=-1.0)
 | |
|         self.add_input('LnxFloatSocket', 'Wheel Delta Multiplier', default_value=-1.0)
 | |
| 
 | |
|         self.add_output('LnxFloatSocket', 'X')
 | |
|         self.add_output('LnxFloatSocket', 'Y')
 | |
|         self.add_output('LnxFloatSocket', 'Multiplied X')
 | |
|         self.add_output('LnxFloatSocket', 'Multiplied Y')
 | |
|         self.add_output('LnxIntSocket', 'Wheel Delta')
 | |
|         self.add_output('LnxFloatSocket', 'Multiplied Wheel Delta')
 |