LNXSDK/leenkx/blender/lnx/logicnode/deprecated/LN_set_mouse_lock.py

28 lines
987 B
Python
Raw Normal View History

2025-01-22 16:18:30 +01:00
from lnx.logicnode.lnx_nodes import *
@deprecated('Set Cursor State')
class SetMouseLockNode(LnxLogicTreeNode):
"""Deprecated. It is recommended to use the 'Set Cursor State' node instead."""
bl_idname = 'LNSetMouseLockNode'
bl_label = 'Set Mouse Lock'
bl_description = "Please use the \"Set Cursor State\" node instead"
lnx_category = 'Input'
lnx_section = 'mouse'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxBoolSocket', 'Lock')
self.add_output('LnxNodeSocketAction', 'Out')
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1):
raise LookupError()
return NodeReplacement(
'LNSetMouseLockNode', self.lnx_version, 'LNSetCursorStateNode', 1,
in_socket_mapping = {0:0, 1:1}, out_socket_mapping={0:0},
property_defaults={'property0': "Lock"}
)