forked from LeenkxTeam/LNXSDK
26 lines
808 B
Python
26 lines
808 B
Python
from lnx.logicnode.lnx_nodes import *
|
|
|
|
|
|
class OnRender2DNode(LnxLogicTreeNode):
|
|
"""Registers a 2D rendering callback to activate its output on each
|
|
frame after the frame has been drawn and other non-2D render callbacks
|
|
have been executed.
|
|
"""
|
|
bl_idname = 'LNOnRender2DNode'
|
|
bl_label = 'On Render2D'
|
|
lnx_version = 2
|
|
|
|
def lnx_init(self, context):
|
|
self.add_input('LnxIntSocket', 'Index')
|
|
|
|
self.add_output('LnxNodeSocketAction', 'Out')
|
|
self.add_output('LnxDynamicSocket', 'Render2D')
|
|
self.add_output('LnxIntSocket', 'Index', default_value = -1)
|
|
|
|
|
|
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
|
|
if self.lnx_version not in (0, 1):
|
|
raise LookupError()
|
|
|
|
return NodeReplacement.Identity(self)
|