forked from LeenkxTeam/LNXSDK
Repe [T3DU] and Moises Jpelaez updates
This commit is contained in:
@ -0,0 +1,18 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class GetTilesheetFlipNode(LnxLogicTreeNode):
|
||||
"""Returns the flip state of the tilesheet.
|
||||
|
||||
@output Flip X: Whether the sprite is flipped horizontally.
|
||||
@output Flip Y: Whether the sprite is flipped vertically.
|
||||
"""
|
||||
bl_idname = 'LNGetTilesheetFlipNode'
|
||||
bl_label = 'Get Tilesheet Flip'
|
||||
lnx_version = 1
|
||||
lnx_section = 'tilesheet'
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
|
||||
self.add_output('LnxBoolSocket', 'Flip X')
|
||||
self.add_output('LnxBoolSocket', 'Flip Y')
|
||||
@ -2,8 +2,8 @@ from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class GetTilesheetStateNode(LnxLogicTreeNode):
|
||||
"""Returns the information about the current tilesheet of the given object.
|
||||
|
||||
@output Active Tilesheet: Current active tilesheet.
|
||||
|
||||
@output Tilesheet: Tilesheet name.
|
||||
|
||||
@output Active Action: Current action in the tilesheet.
|
||||
|
||||
@ -15,23 +15,28 @@ class GetTilesheetStateNode(LnxLogicTreeNode):
|
||||
"""
|
||||
bl_idname = 'LNGetTilesheetStateNode'
|
||||
bl_label = 'Get Tilesheet State'
|
||||
lnx_version = 2
|
||||
lnx_version = 4
|
||||
lnx_section = 'tilesheet'
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
|
||||
self.add_output('LnxStringSocket', 'Active Tilesheet')
|
||||
self.add_output('LnxStringSocket', 'Tilesheet')
|
||||
self.add_output('LnxStringSocket', 'Active Action')
|
||||
self.add_output('LnxIntSocket', 'Frame')
|
||||
self.add_output('LnxIntSocket', 'Absolute Frame')
|
||||
self.add_output('LnxBoolSocket', 'Is Paused')
|
||||
|
||||
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
|
||||
if self.lnx_version not in (0, 1):
|
||||
raise LookupError()
|
||||
|
||||
return NodeReplacement(
|
||||
'LNGetTilesheetStateNode', self.lnx_version, 'LNGetTilesheetStateNode', 2,
|
||||
in_socket_mapping={}, out_socket_mapping={0:1, 1:3, 2:4}
|
||||
)
|
||||
if self.lnx_version in (0, 1):
|
||||
return NodeReplacement(
|
||||
'LNGetTilesheetStateNode', self.lnx_version, 'LNGetTilesheetStateNode', 4,
|
||||
in_socket_mapping={}, out_socket_mapping={0: 1, 1: 3, 2: 4}
|
||||
)
|
||||
elif self.lnx_version in (2, 3):
|
||||
# Version 2 and 3 have same outputs, just rename Material to Tilesheet
|
||||
return NodeReplacement(
|
||||
'LNGetTilesheetStateNode', self.lnx_version, 'LNGetTilesheetStateNode', 4,
|
||||
in_socket_mapping={0: 0}, out_socket_mapping={0: 0, 1: 1, 2: 2, 3: 3, 4: 4}
|
||||
)
|
||||
raise LookupError()
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class PlayTilesheetNode(LnxLogicTreeNode):
|
||||
class PlayTilesheetActionNode(LnxLogicTreeNode):
|
||||
"""Plays the given tilesheet action."""
|
||||
bl_idname = 'LNPlayTilesheetNode'
|
||||
bl_label = 'Play Tilesheet'
|
||||
bl_idname = 'LNPlayTilesheetActionNode'
|
||||
bl_label = 'Play Tilesheet Action'
|
||||
lnx_version = 1
|
||||
lnx_section = 'tilesheet'
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
self.add_input('LnxStringSocket', 'Name')
|
||||
self.add_input('LnxStringSocket', 'Action')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxNodeSocketAction', 'Done')
|
||||
@ -1,16 +1,15 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class SetActiveTilesheetNode(LnxLogicTreeNode):
|
||||
"""Set the active tilesheet."""
|
||||
bl_idname = 'LNSetActiveTilesheetNode'
|
||||
bl_label = 'Set Active Tilesheet'
|
||||
class SetTilesheetActionNode(LnxLogicTreeNode):
|
||||
"""Sets the tilesheet action for the given object."""
|
||||
bl_idname = 'LNSetTilesheetActionNode'
|
||||
bl_label = 'Set Tilesheet Action'
|
||||
lnx_version = 1
|
||||
lnx_section = 'tilesheet'
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
self.add_input('LnxStringSocket', 'Tilesheet')
|
||||
self.add_input('LnxStringSocket', 'Action')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
@ -0,0 +1,21 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class SetTilesheetFlipNode(LnxLogicTreeNode):
|
||||
"""Set the flip state of the tilesheet for UV-based sprite flipping.
|
||||
This is useful for billboarded sprites where mesh scaling cannot be used.
|
||||
|
||||
@input Flip X: Flip the sprite horizontally.
|
||||
@input Flip Y: Flip the sprite vertically.
|
||||
"""
|
||||
bl_idname = 'LNSetTilesheetFlipNode'
|
||||
bl_label = 'Set Tilesheet Flip'
|
||||
lnx_version = 1
|
||||
lnx_section = 'tilesheet'
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
self.add_input('LnxBoolSocket', 'Flip X')
|
||||
self.add_input('LnxBoolSocket', 'Flip Y')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
Reference in New Issue
Block a user