Update Files

This commit is contained in:
2025-01-22 16:18:30 +01:00
parent ed4603cf95
commit a36294b518
16718 changed files with 2960346 additions and 0 deletions

View File

@ -0,0 +1,27 @@
import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from lnx.logicnode.lnx_nodes import *
@deprecated('Get Cursor State')
class GetMouseLockNode(LnxLogicTreeNode):
"""Deprecated. It is recommended to use the 'Get Cursor State' node instead."""
bl_idname = 'LNGetMouseLockNode'
bl_label = 'Get Mouse Lock'
bl_description = "Please use the \"Get Cursor State\" node instead"
lnx_version = 2
lnx_category = 'Input'
lnx_section = 'mouse'
def lnx_init(self, context):
self.outputs.new('LnxBoolSocket', 'Is Locked')
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1):
raise LookupError()
return NodeReplacement(
'LNGetMouseLockNode', self.lnx_version, 'LNGetCursorStateNode', 1,
in_socket_mapping={}, out_socket_mapping={0: 2}
)

View File

@ -0,0 +1,30 @@
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]

View File

@ -0,0 +1,16 @@
import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from lnx.logicnode.lnx_nodes import *
@deprecated('Group Input Node')
class GroupOutputNode(LnxLogicTreeNode):
"""Sets the connected chain of nodes as a group of nodes."""
bl_idname = 'LNGroupOutputNode'
bl_label = 'Group Nodes'
lnx_category = 'Miscellaneous'
lnx_section = 'group'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')

View File

@ -0,0 +1,50 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Get Cursor Location')
class MouseCoordsNode(LnxLogicTreeNode):
"""Deprecated. It is recommended to use 'Get Cursor Location' node and the 'Get Mouse Movement' node instead."""
bl_idname = 'LNMouseCoordsNode'
bl_label = 'Mouse Coords'
bl_description = "Please use the \"Get Cursor Location\" and \"Get Mouse Movement\" nodes instead"
lnx_category = 'Input'
lnx_section = 'mouse'
lnx_version = 2
def lnx_init(self, context):
self.add_output('LnxVectorSocket', 'Coords')
self.add_output('LnxVectorSocket', 'Movement')
self.add_output('LnxIntSocket', 'Wheel')
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1):
raise LookupError()
all_new_nodes = []
if len(self.outputs[0].links) > 0:
# "coords": use the cursor coordinates
newmain = node_tree.nodes.new('LNGetCursorLocationNode')
new_secondary = node_tree.nodes.new('LNVectorNode')
node_tree.links.new(newmain.outputs[0], new_secondary.inputs[0])
node_tree.links.new(newmain.outputs[1], new_secondary.inputs[1])
for link in self.outputs[0].links:
node_tree.links.new(new_secondary.outputs[0], link.to_socket)
all_new_nodes += [newmain, new_secondary]
if len(self.outputs[1].links) > 0 or len(self.outputs[2].links) > 0:
# "movement": use the mouse movement
# "wheel": use data from mouse movement as well
newmain = node_tree.nodes.new('LNGetMouseMovementNode')
all_new_nodes.append(newmain)
if len(self.outputs[1].links) > 0:
new_secondary = node_tree.nodes.new('LNVectorNode')
all_new_nodes.append(new_secondary)
node_tree.links.new(newmain.outputs[0], new_secondary.inputs[0])
node_tree.links.new(newmain.outputs[1], new_secondary.inputs[1])
for link in self.outputs[1].links:
node_tree.links.new(new_secondary.outputs[0], link.to_socket)
for link in self.outputs[2].links:
node_tree.links.new(newmain.outputs[2], link.to_socket)
return all_new_nodes

View File

@ -0,0 +1,62 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Gamepad')
class OnGamepadNode(LnxLogicTreeNode):
"""Deprecated. It is recommended to use the 'Gamepad' node instead."""
bl_idname = 'LNOnGamepadNode'
bl_label = "On Gamepad"
bl_description = "Please use the \"Gamepad\" node instead"
lnx_category = 'Input'
lnx_section = 'gamepad'
lnx_version = 2
property0: HaxeEnumProperty(
'property0',
items = [('Down', 'Down', 'Down'),
('Started', 'Started', 'Started'),
('Released', 'Released', 'Released')],
# ('Moved Left', 'Moved Left', 'Moved Left'),
# ('Moved Right', 'Moved Right', 'Moved Right'),],
name='', default='Started')
property1: HaxeEnumProperty(
'property1',
items = [('cross', 'cross / a', 'cross / a'),
('circle', 'circle / b', 'circle / b'),
('square', 'square / x', 'square / x'),
('triangle', 'triangle / y', 'triangle / y'),
('l1', 'l1', 'l1'),
('r1', 'r1', 'r1'),
('l2', 'l2', 'l2'),
('r2', 'r2', 'r2'),
('share', 'share', 'share'),
('options', 'options', 'options'),
('l3', 'l3', 'l3'),
('r3', 'r3', 'r3'),
('up', 'up', 'up'),
('down', 'down', 'down'),
('left', 'left', 'left'),
('right', 'right', 'right'),
('home', 'home', 'home'),
('touchpad', 'touchpad', 'touchpad'),],
name='', default='cross')
def lnx_init(self, context):
self.add_output('LnxNodeSocketAction', 'Out')
self.add_input('LnxIntSocket', 'Gamepad')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
layout.prop(self, 'property1')
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1):
raise LookupError()
return NodeReplacement(
"LNOnGamepadNode", self.lnx_version,
"LNMergedGamepadNode", 1,
in_socket_mapping={0: 0}, out_socket_mapping={0: 0},
property_mapping={"property0": "property0", "property1": "property1"}
)

View File

@ -0,0 +1,93 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Keyboard')
class OnKeyboardNode(LnxLogicTreeNode):
"""Deprecated. It is recommended to use the 'Keyboard' node instead."""
bl_idname = 'LNOnKeyboardNode'
bl_label = "On Keyboard"
bl_description = "Please use the \"Keyboard\" node instead"
lnx_category = 'Input'
lnx_section = 'keyboard'
lnx_version = 2
property0: HaxeEnumProperty(
'property0',
items = [('Down', 'Down', 'Down'),
('Started', 'Started', 'Started'),
('Released', 'Released', 'Released')],
name='', default='Started')
property1: HaxeEnumProperty(
'property1',
items = [('a', 'a', 'a'),
('b', 'b', 'b'),
('c', 'c', 'c'),
('d', 'd', 'd'),
('e', 'e', 'e'),
('f', 'f', 'f'),
('g', 'g', 'g'),
('h', 'h', 'h'),
('i', 'i', 'i'),
('j', 'j', 'j'),
('k', 'k', 'k'),
('l', 'l', 'l'),
('m', 'm', 'm'),
('n', 'n', 'n'),
('o', 'o', 'o'),
('p', 'p', 'p'),
('q', 'q', 'q'),
('r', 'r', 'r'),
('s', 's', 's'),
('t', 't', 't'),
('u', 'u', 'u'),
('v', 'v', 'v'),
('w', 'w', 'w'),
('x', 'x', 'x'),
('y', 'y', 'y'),
('z', 'z', 'z'),
('0', '0', '0'),
('1', '1', '1'),
('2', '2', '2'),
('3', '3', '3'),
('4', '4', '4'),
('5', '5', '5'),
('6', '6', '6'),
('7', '7', '7'),
('8', '8', '8'),
('9', '9', '9'),
('.', 'period', 'period'),
(',', 'comma', 'comma'),
('space', 'space', 'space'),
('backspace', 'backspace', 'backspace'),
('tab', 'tab', 'tab'),
('enter', 'enter', 'enter'),
('shift', 'shift', 'shift'),
('control', 'control', 'control'),
('alt', 'alt', 'alt'),
('escape', 'escape', 'escape'),
('delete', 'delete', 'delete'),
('back', 'back', 'back'),
('up', 'up', 'up'),
('right', 'right', 'right'),
('left', 'left', 'left'),
('down', 'down', 'down'),],
name='', default='space')
def lnx_init(self, context):
self.add_output('LnxNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
layout.prop(self, 'property1')
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1):
raise LookupError()
return NodeReplacement(
"LNOnKeyboardNode", self.lnx_version,
"LNMergedKeyboardNode", 1,
in_socket_mapping={}, out_socket_mapping={0: 0},
property_mapping={"property0": "property0", "property1": "property1"}
)

View File

@ -0,0 +1,47 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Mouse')
class OnMouseNode(LnxLogicTreeNode):
"""Deprecated. It is recommended to use the 'Mouse' node instead."""
bl_idname = 'LNOnMouseNode'
bl_label = "On Mouse"
bl_description = "Please use the \"Mouse\" node instead"
lnx_category = 'Input'
lnx_section = 'mouse'
lnx_version = 2
property0: HaxeEnumProperty(
'property0',
items = [('Down', 'Down', 'Down'),
('Started', 'Started', 'Started'),
('Released', 'Released', 'Released'),
('Moved', 'Moved', 'Moved')],
name='', default='Down')
property1: HaxeEnumProperty(
'property1',
items = [('left', 'left', 'left'),
('right', 'right', 'right'),
('middle', 'middle', 'middle')],
name='', default='left')
def lnx_init(self, context):
self.add_output('LnxNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
layout.prop(self, 'property1')
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1):
raise LookupError()
newnode = node_tree.nodes.new('LNMergedMouseNode')
newnode.property0 = self.property0.lower()
newnode.property1 = self.property1
NodeReplacement.replace_output_socket(node_tree, self.outputs[0], newnode.outputs[0])
return newnode

View File

@ -0,0 +1,26 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Surface')
class OnSurfaceNode(LnxLogicTreeNode):
"""Deprecated. Is recommended to use the 'Surface' node instead."""
bl_idname = 'LNOnSurfaceNode'
bl_label = 'On Surface'
bl_description = "Please use the \"Surface\" node instead"
lnx_category = 'Input'
lnx_section = 'surface'
lnx_version = 2
property0: HaxeEnumProperty(
'property0',
items = [('Touched', 'Touched', 'Touched'),
('Started', 'Started', 'Started'),
('Released', 'Released', 'Released'),
('Moved', 'Moved', 'Moved')],
name='', default='Touched')
def lnx_init(self, context):
self.add_output('LnxNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')

View File

@ -0,0 +1,27 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Virtual Button')
class OnVirtualButtonNode(LnxLogicTreeNode):
"""Deprecated. Is recommended to use 'Virtual Button' node instead."""
bl_idname = 'LNOnVirtualButtonNode'
bl_label = 'On Virtual Button'
bl_description = "Please use the \"Virtual Button\" node instead"
lnx_category = 'Input'
lnx_section = 'virtual'
lnx_version = 2
property0: HaxeEnumProperty(
'property0',
items = [('Down', 'Down', 'Down'),
('Started', 'Started', 'Started'),
('Released', 'Released', 'Released')],
name='', default='Started')
property1: HaxeStringProperty('property1', name='', default='button')
def lnx_init(self, context):
self.add_output('LnxNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
layout.prop(self, 'property1')

View File

@ -0,0 +1,16 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Set Action Paused')
class PauseActionNode(LnxLogicTreeNode):
"""Pauses the given action."""
bl_idname = 'LNPauseActionNode'
bl_label = 'Pause Action'
bl_description = "Please use the \"Set Action Paused\" node instead"
lnx_category = 'Animation'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,17 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Set Tilesheet Paused')
class PauseTilesheetNode(LnxLogicTreeNode):
"""Pauses the given tilesheet action."""
bl_idname = 'LNPauseTilesheetNode'
bl_label = 'Pause Tilesheet'
bl_description = "Please use the \"Set Tilesheet Paused\" node instead"
lnx_category = 'Animation'
lnx_section = 'tilesheet'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,16 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Set Trait Paused')
class PauseTraitNode(LnxLogicTreeNode):
"""Pauses the given trait."""
bl_idname = 'LNPauseTraitNode'
bl_label = 'Pause Trait'
bl_description = "Please use the \"Set Trait Paused\" node instead"
lnx_category = 'Trait'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxDynamicSocket', 'Trait')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,19 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Play Action From')
class PlayActionNode(LnxLogicTreeNode):
"""Plays the given action."""
bl_idname = 'LNPlayActionNode'
bl_label = 'Play Action'
bl_description = "Please use the \"Play Action From\" node instead"
lnx_category = 'Animation'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxNodeSocketAnimAction', 'Action')
self.add_input('LnxFloatSocket', 'Blend', default_value=0.2)
self.add_output('LnxNodeSocketAction', 'Out')
self.add_output('LnxNodeSocketAction', 'Done')

View File

@ -0,0 +1,75 @@
from lnx.logicnode.lnx_nodes import *
from mathutils import Vector
@deprecated(message='Do not use quaternion sockets')
class QuaternionNode(LnxLogicTreeNode):
"""TO DO."""
bl_idname = 'LNQuaternionNode'
bl_label = 'Quaternion'
bl_description = 'Create a quaternion variable (transported through a vector socket)'
lnx_category = 'Variable'
lnx_section = 'quaternions'
lnx_version = 2 # deprecate
def lnx_init(self, context):
self.add_input('LnxFloatSocket', 'X')
self.add_input('LnxFloatSocket', 'Y')
self.add_input('LnxFloatSocket', 'Z')
self.add_input('LnxFloatSocket', 'W', default_value=1.0)
self.add_output('LnxVectorSocket', 'Quaternion')
self.add_output('LnxVectorSocket', 'XYZ')
self.add_output('LnxVectorSocket', 'W')
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1):
raise LookupError()
# transition from version 1 to version 2[deprecated]
newnodes = []
rawlinks = self.outputs[0].links
xyzlinks = self.outputs[1].links
wlinks = self.outputs[2].links
if len(rawlinks)>0 or len(xyzlinks)>0:
xyzcomb = node_tree.nodes.new('LNVectorNode')
newnodes.append(xyzcomb)
xyzcomb.inputs[0].default_value = self.inputs[0].default_value
xyzcomb.inputs[1].default_value = self.inputs[1].default_value
xyzcomb.inputs[2].default_value = self.inputs[2].default_value
for link in self.inputs[0].links:
node_tree.links.new(link.from_socket, xyzcomb.inputs[0])
for link in self.inputs[1].links:
node_tree.links.new(link.from_socket, xyzcomb.inputs[1])
for link in self.inputs[2].links:
node_tree.links.new(link.from_socket, xyzcomb.inputs[2])
for link in xyzlinks:
node_tree.links.new(xyzcomb.outputs[0], link.to_socket)
if len(rawlinks)>0:
rotnode = node_tree.nodes.new('LNRotationNode')
newnodes.append(rotnode)
rotnode.property0 = 'Quaternion'
rotnode.inputs[0].default_value = Vector(
(self.inputs[0].default_value,
self.inputs[1].default_value,
self.inputs[2].default_value))
rotnode.inputs[1].default_value = self.inputs[3].default_value
node_tree.links.new(xyzcomb.outputs[0], rotnode.inputs[0])
for link in self.inputs[3].links: # 0 or 1
node_tree.links.new(link.from_socket, rotnode.inputs[1])
for link in rawlinks:
node_tree.links.new(rotnode.outputs[0], link.to_socket)
if len(self.inputs[3].links)>0:
fromval = self.inputs[3].links[0].from_socket
for link in self.outputs[2].links:
node_tree.links.new(fromval, link.to_socket)
else:
for link in self.outputs[2].links:
link.to_socket.default_value = self.inputs[3].default_value
return newnodes

View File

@ -0,0 +1,16 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Set Action Paused')
class ResumeActionNode(LnxLogicTreeNode):
"""Resumes the given action."""
bl_idname = 'LNResumeActionNode'
bl_label = 'Resume Action'
bl_description = "Please use the \"Set Action Paused\" node instead"
lnx_category = 'Animation'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,16 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Set Tilesheet Paused')
class ResumeTilesheetNode(LnxLogicTreeNode):
"""Resumes the given tilesheet action."""
bl_idname = 'LNResumeTilesheetNode'
bl_label = 'Resume Tilesheet'
bl_description = "Please use the \"Set Tilesheet Paused\" node instead"
lnx_category = 'Animation'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,16 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Set Trait Paused')
class ResumeTraitNode(LnxLogicTreeNode):
"""Resumes the given trait."""
bl_idname = 'LNResumeTraitNode'
bl_label = 'Resume Trait'
bl_description = "Please use the \"Set Trait Paused\" node instead"
lnx_category = 'Trait'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxDynamicSocket', 'Trait')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,29 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Rotate Object')
class RotateObjectAroundAxisNode(LnxLogicTreeNode):
"""Deprecated. It is recommended to use the 'Rotate Object' node instead."""
bl_idname = 'LNRotateObjectAroundAxisNode'
bl_label = 'Rotate Object Around Axis'
bl_description = "Please use the \"Rotate Object\" node instead"
lnx_category = 'Transform'
lnx_section = 'rotation'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxVectorSocket', 'Axis', default_value=[0, 0, 1])
self.add_input('LnxFloatSocket', 'Angle')
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(
'LNRotateObjectAroundAxisNode', self.lnx_version, 'LNRotateObjectNode', 1,
in_socket_mapping = {0:0, 1:1, 2:2, 3:3}, out_socket_mapping={0:0},
property_defaults={'property0': "Angle Axies (Radians)"}
)

View File

@ -0,0 +1,18 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Set Object Scale')
class ScaleObjectNode(LnxLogicTreeNode):
"""Deprecated. 'Use Set Object Scale' instead."""
bl_idname = 'LNScaleObjectNode'
bl_label = 'Scale Object'
bl_description = "Please use the \"Set Object Scale\" node instead"
lnx_category = 'Transform'
lnx_section = 'scale'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxVectorSocket', 'Scale')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,45 @@
from lnx.logicnode.lnx_nodes import *
@deprecated(message='Do not use quaternion sockets')
class SeparateQuaternionNode(LnxLogicTreeNode):
"""Splits the given quaternion into X, Y, Z and W."""
bl_idname = 'LNSeparateQuaternionNode'
bl_label = "Separate Quaternion (do not use: quaternions sockets have been phased out entirely)"
bl_description = "Separate a quaternion object (transported through a vector socket) into its four compoents."
lnx_category = 'Math'
lnx_section = 'quaternions'
lnx_version = 2 # deprecate
def lnx_init(self, context):
self.add_input('LnxVectorSocket', 'Quaternion')
self.add_output('LnxFloatSocket', 'X')
self.add_output('LnxFloatSocket', 'Y')
self.add_output('LnxFloatSocket', 'Z')
self.add_output('LnxFloatSocket', 'W')
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1):
raise LookupError()
# transition from version 1 to version 2[deprecated]
newself = node_tree.nodes.new('LNSeparateRotationNode')
separator = node_tree.nodes.new('LNSeparateVectorNode')
newself.property0 = 'Quaternion'
newself.property1 = 'Rad' # bogus
newself.property2 = 'XYZ' # bogus
for link in self.inputs[0].links:
node_tree.links.new(link.from_socket, newself.inputs[0])
node_tree.links.new(newself.outputs[0], separator.inputs[0])
for link in self.outputs[0].links:
node_tree.links.new(separator.outputs[0], link.to_socket)
for link in self.outputs[1].links:
node_tree.links.new(separator.outputs[1], link.to_socket)
for link in self.outputs[2].links:
node_tree.links.new(separator.outputs[2], link.to_socket)
for link in self.outputs[3].links:
node_tree.links.new(newself.outputs[1], link.to_socket)
return [newself, separator]

View File

@ -0,0 +1,33 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Set Canvas Color')
class CanvasSetProgressBarColorNode(LnxLogicTreeNode):
"""Sets the color of the given UI element."""
bl_idname = 'LNCanvasSetProgressBarColorNode'
bl_label = 'Set Canvas Progress Bar Color'
lnx_version = 2
lnx_category = 'Canvas'
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxStringSocket', 'Element')
self.add_input('LnxColorSocket', 'Color In', default_value=[1.0, 1.0, 1.0, 1.0])
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()
newnode = node_tree.nodes.new('LNCanvasSetColorNode')
newnode.property0 = 'color_progress'
NodeReplacement.replace_input_socket(node_tree, self.inputs[0], newnode.inputs[0])
NodeReplacement.replace_input_socket(node_tree, self.inputs[1], newnode.inputs[1])
NodeReplacement.replace_input_socket(node_tree, self.inputs[2], newnode.inputs[2])
NodeReplacement.replace_output_socket(node_tree, self.outputs[0], newnode.outputs[0])
return newnode

View File

@ -0,0 +1,49 @@
from lnx.logicnode.lnx_nodes import *
import lnx.node_utils as node_utils
@deprecated('Set Canvas Color')
class CanvasSetTextColorNode(LnxLogicTreeNode):
"""Sets the text color of the given UI element."""
bl_idname = 'LNCanvasSetTextColorNode'
bl_label = 'Set Canvas Text Color'
lnx_version = 2
lnx_category = 'Canvas'
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxStringSocket', 'Element')
self.add_input('LnxFloatSocket', 'R')
self.add_input('LnxFloatSocket', 'G')
self.add_input('LnxFloatSocket', 'B')
self.add_input('LnxFloatSocket', 'A')
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()
newnode = node_tree.nodes.new('LNCanvasSetColorNode')
newnode.property0 = 'color_text'
NodeReplacement.replace_input_socket(node_tree, self.inputs[0], newnode.inputs[0])
NodeReplacement.replace_input_socket(node_tree, self.inputs[1], newnode.inputs[1])
# We do not have a RGBA to Color node or a Vec4 node currently,
# so we cannot reconnect color inputs... So unfortunately we can only
# use the socket default colors here
node_utils.set_socket_default(
newnode.inputs[2],
[
node_utils.get_socket_default(self.inputs[2]),
node_utils.get_socket_default(self.inputs[3]),
node_utils.get_socket_default(self.inputs[4]),
node_utils.get_socket_default(self.inputs[5])
]
)
NodeReplacement.replace_output_socket(node_tree, self.outputs[0], newnode.outputs[0])
return newnode

View File

@ -0,0 +1,27 @@
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"}
)

View File

@ -0,0 +1,43 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Set Cursor State')
class ShowMouseNode(LnxLogicTreeNode):
"""Deprecated. It is recommended to use the 'Set Cursor State' node instead."""
bl_idname = 'LNShowMouseNode'
bl_label = "Set Mouse Visible"
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', 'Show')
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()
if len(self.inputs[1].links) == 0:
# if the value is 'hard-coded', then use a simple replacement. Otherwise, use a Not node.
return NodeReplacement(
'LNShowMouseNode', self.lnx_version, 'LNSetCursorStateNode', 1,
in_socket_mapping={0:0}, out_socket_mapping={0:0}, # deliberately forgetting input 1 here: it is taken care of in the next line
input_defaults={1: not self.inputs[1].default_value},
property_defaults={'property0': 'Hide'}
)
new_main = node_tree.nodes.new('LNSetCursorStateNode')
new_secondary = node_tree.nodes.new('LNNotNode')
new_main.property0 = 'Hide'
node_tree.links.new(self.inputs[0].links[0].from_socket, new_main.inputs[0]) # Action in
node_tree.links.new(self.inputs[1].links[0].from_socket, new_secondary.inputs[0]) # Value in
node_tree.links.new(new_secondary.outputs[0], new_main.inputs[1]) # Value in, part 2
for link in self.outputs[0].links:
node_tree.links.new(new_main.outputs[0], link.to_socket) # Action out
return [new_main, new_secondary]

View File

@ -0,0 +1,17 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Set Object Material Slot')
class SetMaterialNode(LnxLogicTreeNode):
"""Sets the material of the given object."""
bl_idname = 'LNSetMaterialNode'
bl_label = 'Set Object Material'
bl_description = "Please use the \"Set Object Material Slot\" node instead"
lnx_category = 'Material'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxDynamicSocket', 'Material')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,16 @@
from lnx.logicnode.lnx_nodes import *
@deprecated('Get Touch Movement', 'Get Touch Location')
class SurfaceCoordsNode(LnxLogicTreeNode):
"""Deprecated. Is recommended to use 'Get Touch Location' and 'Get Touch Movement' node instead."""
bl_idname = 'LNSurfaceCoordsNode'
bl_label = 'Surface Coords'
bl_description = "Please use the \"Get Touch Movement\" and \"Get Touch Location\" nodes instead"
lnx_category = 'Input'
lnx_section = 'surface'
lnx_version = 2
def lnx_init(self, context):
self.add_output('LnxVectorSocket', 'Coords')
self.add_output('LnxVectorSocket', 'Movement')

View File

@ -0,0 +1 @@
"""dummy file to include the code fro the deprecated nodes"""