-
Notifications
You must be signed in to change notification settings - Fork 315
/
LN_get_tilesheet_state.py
37 lines (27 loc) · 1.31 KB
/
LN_get_tilesheet_state.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from arm.logicnode.arm_nodes import *
class GetTilesheetStateNode(ArmLogicTreeNode):
"""Returns the information about the current tilesheet of the given object.
@output Active Tilesheet: Current active tilesheet.
@output Active Action: Current action in the tilesheet.
@output Frame: Frame offset with 0 as the first frame of the active action.
@output Absolute Frame: Absolute frame index in this tilesheet.
@output Is Paused: Tilesheet action paused.
"""
bl_idname = 'LNGetTilesheetStateNode'
bl_label = 'Get Tilesheet State'
arm_version = 2
arm_section = 'tilesheet'
def arm_init(self, context):
self.add_input('ArmNodeSocketObject', 'Object')
self.add_output('ArmStringSocket', 'Active Tilesheet')
self.add_output('ArmStringSocket', 'Active Action')
self.add_output('ArmIntSocket', 'Frame')
self.add_output('ArmIntSocket', 'Absolute Frame')
self.add_output('ArmBoolSocket', 'Is Paused')
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.arm_version not in (0, 1):
raise LookupError()
return NodeReplacement(
'LNGetTilesheetStateNode', self.arm_version, 'LNGetTilesheetStateNode', 2,
in_socket_mapping={}, out_socket_mapping={0:1, 1:3, 2:4}
)