forked from LeenkxTeam/LNXSDK
Repe [T3DU] Update - 31f26d171bba0355ce2a77031e3aad4c64dbc7e9
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class SetCameraProjectionNode(LnxLogicTreeNode):
|
||||
"""Sets the projection of the given camera."""
|
||||
bl_idname = 'LNSetCameraProjectionNode'
|
||||
bl_label = 'Set Camera Projection'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxNodeSocketObject', 'Camera')
|
||||
self.add_input('LnxIntSocket', 'Width')
|
||||
self.add_input('LnxIntSocket', 'Height')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
@ -13,9 +13,9 @@ class SetCameraStartEndNode(LnxLogicTreeNode):
|
||||
self.inputs.remove(self.inputs[-1])
|
||||
if self.property0 == 'Start':
|
||||
self.add_input('LnxFloatSocket', 'Start')
|
||||
if self.property0 == 'End':
|
||||
elif self.property0 == 'End':
|
||||
self.add_input('LnxFloatSocket', 'End')
|
||||
if self.property0 == 'Start&End':
|
||||
elif self.property0 == 'Start&End':
|
||||
self.add_input('LnxFloatSocket', 'Start')
|
||||
self.add_input('LnxFloatSocket', 'End')
|
||||
|
||||
|
||||
60
leenkx/blender/lnx/logicnode/camera/LN_set_screen_cameras.py
Normal file
60
leenkx/blender/lnx/logicnode/camera/LN_set_screen_cameras.py
Normal file
@ -0,0 +1,60 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class SetScreenCamerasNode(LnxLogicTreeNode):
|
||||
"""Renders the scene from the view of specified cameras.
|
||||
|
||||
@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 = 'LNSetScreenCamerasNode'
|
||||
bl_label = 'Set Screen Cameras'
|
||||
lnx_version = 1
|
||||
min_inputs = 7
|
||||
|
||||
num_choices: IntProperty(default=0, min=0)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SetScreenCamerasNode, self).__init__(*args, **kwargs)
|
||||
array_nodes[str(id(self))] = self
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'Start')
|
||||
self.add_input('LnxNodeSocketAction', 'Stop')
|
||||
self.add_sockets()
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'On Start')
|
||||
self.add_output('LnxNodeSocketAction', 'On Stop')
|
||||
|
||||
def add_sockets(self):
|
||||
self.num_choices += 1
|
||||
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')
|
||||
|
||||
def remove_sockets(self):
|
||||
if self.num_choices > 1:
|
||||
for _ in range(5):
|
||||
self.inputs.remove(self.inputs.values()[-1])
|
||||
self.num_choices -= 1
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
row = layout.row(align=True)
|
||||
|
||||
op = row.operator('lnx.node_call_func', text='Add Camera', icon='PLUS', emboss=True)
|
||||
op.node_index = str(id(self))
|
||||
op.callback_name = 'add_sockets'
|
||||
|
||||
column = row.column(align=True)
|
||||
op = column.operator('lnx.node_call_func', text='', icon='X', emboss=True)
|
||||
op.node_index = str(id(self))
|
||||
op.callback_name = 'remove_sockets'
|
||||
if len(self.inputs) == self.min_inputs:
|
||||
column.enabled = False
|
||||
Reference in New Issue
Block a user