forked from LeenkxTeam/LNXSDK
38 lines
1.5 KiB
Python
38 lines
1.5 KiB
Python
from lnx.logicnode.lnx_nodes import *
|
|
|
|
class DrawCameraNode(LnxLogicTreeNode):
|
|
"""Renders the scene from the view of specified cameras and draws
|
|
the render targets to the screen.
|
|
|
|
@input Start: Evaluate the inputs and start drawing the camera render targets.
|
|
@input Stop: Stops the rendering and drawing of the camera render targets.
|
|
@input Camera: The camera from which to render.
|
|
@input X/Y: Position where the camera's render target is drawn, in pixels from the top left corner.
|
|
@input Width/Height: Size of the camera's render target in pixels.
|
|
|
|
@output On Start: Activated after the `Start` input has been activated.
|
|
@output On Stop: Activated after the `Stop` input has been activated.
|
|
"""
|
|
bl_idname = 'LNDrawCameraNode'
|
|
bl_label = 'Draw Camera'
|
|
lnx_section = 'draw'
|
|
lnx_version = 4
|
|
|
|
num_choices: IntProperty(default=0, min=0)
|
|
|
|
def lnx_init(self, context):
|
|
self.add_input('LnxNodeSocketAction', 'Start')
|
|
self.add_input('LnxNodeSocketAction', 'Stop')
|
|
self.add_input('LnxNodeSocketObject', 'Camera ' + str(self.num_choices))
|
|
self.add_input('LnxIntSocket', 'X')
|
|
self.add_input('LnxIntSocket', 'Y')
|
|
self.add_input('LnxIntSocket', 'Width')
|
|
self.add_input('LnxIntSocket', 'Height')
|
|
self.add_input('LnxBoolSocket', 'Paused')
|
|
|
|
self.add_output('LnxNodeSocketAction', 'On Start')
|
|
self.add_output('LnxNodeSocketAction', 'On Stop')
|
|
|
|
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
|
|
return NodeReplacement.Identity(self)
|