From f779462f362a4dac44c76687f531dd9b33efa3b2 Mon Sep 17 00:00:00 2001 From: Onek8 Date: Mon, 2 Jun 2025 19:51:11 +0000 Subject: [PATCH] t3du - Post Process Updates --- .../postprocess/LN_set_camera_post_process.py | 77 +++++++++++++++---- 1 file changed, 62 insertions(+), 15 deletions(-) diff --git a/leenkx/blender/lnx/logicnode/postprocess/LN_set_camera_post_process.py b/leenkx/blender/lnx/logicnode/postprocess/LN_set_camera_post_process.py index 3b25cf9..c79922c 100644 --- a/leenkx/blender/lnx/logicnode/postprocess/LN_set_camera_post_process.py +++ b/leenkx/blender/lnx/logicnode/postprocess/LN_set_camera_post_process.py @@ -4,27 +4,74 @@ class CameraSetNode(LnxLogicTreeNode): """Set the post-processing effects of a camera.""" bl_idname = 'LNCameraSetNode' bl_label = 'Set Camera Post Process' - lnx_version = 4 + lnx_version = 5 + + + def remove_extra_inputs(self, context): + while len(self.inputs) > 1: + self.inputs.remove(self.inputs[-1]) + if self.property0 == 'F-stop': + self.add_input('LnxFloatSocket', 'F-stop', default_value=1.0)#0 + if self.property0 == 'Shutter Time': + self.add_input('LnxFloatSocket', 'Shutter Time', default_value=2.8333)#1 + if self.property0 == 'ISO': + self.add_input('LnxFloatSocket', 'ISO', default_value=100.0)#2 + if self.property0 == 'Exposure Compensation': + self.add_input('LnxFloatSocket', 'Exposure Compensation', default_value=0.0)#3 + if self.property0 == 'Fisheye Distortion': + self.add_input('LnxFloatSocket', 'Fisheye Distortion', default_value=0.01)#4 + if self.property0 == 'Auto Focus': + self.add_input('LnxBoolSocket', 'Auto Focus', default_value=True)#5 + if self.property0 == 'DoF Distance': + self.add_input('LnxFloatSocket', 'DoF Distance', default_value=10.0)#6 + if self.property0 == 'DoF Length': + self.add_input('LnxFloatSocket', 'DoF Length', default_value=160.0)#7 + if self.property0 == 'DoF F-Stop': + self.add_input('LnxFloatSocket', 'DoF F-Stop', default_value=128.0)#8 + if self.property0 == 'Tonemapping': + self.add_input('LnxBoolSocket', 'Tonemapping', default_value=False)#9 + if self.property0 == 'Distort': + self.add_input('LnxFloatSocket', 'Distort', default_value=2.0)#10 + if self.property0 == 'Film Grain': + self.add_input('LnxFloatSocket', 'Film Grain', default_value=2.0)#11 + if self.property0 == 'Sharpen': + self.add_input('LnxFloatSocket', 'Sharpen', default_value=0.25)#12 + if self.property0 == 'Vignette': + self.add_input('LnxFloatSocket', 'Vignette', default_value=0.7)#13 + if self.property0 == 'Exposure': + self.add_input('LnxFloatSocket', 'Exposure', default_value=1)#14 + + + property0: HaxeEnumProperty( + 'property0', + items = [('F-stop', 'F-stop', 'F-stop'), + ('Shutter Time', 'Shutter Time', 'Shutter Time'), + ('ISO', 'ISO', 'ISO'), + ('Exposure Compensation', 'Exposure Compensation', 'Exposure Compensation'), + ('Fisheye Distortion', 'Fisheye Distortion', 'Fisheye Distortion'), + ('Auto Focus', 'Auto Focus', 'Auto Focus'), + ('DoF Distance', 'DoF Distance', 'DoF Distance'), + ('DoF Length', 'DoF Length', 'DoF Length'), + ('DoF F-Stop', 'DoF F-Stop', 'DoF F-Stop'), + ('Tonemapping', 'Tonemapping', 'Tonemapping'), + ('Distort', 'Distort', 'Distort'), + ('Film Grain', 'Film Grain', 'Film Grain'), + ('Sharpen', 'Sharpen', 'Sharpen'), + ('Vignette', 'Vignette', 'Vignette'), + ('Exposure', 'Exposure', 'Exposure')], + name='', default='F-stop', update=remove_extra_inputs) + + def lnx_init(self, context): self.add_input('LnxNodeSocketAction', 'In') - self.add_input('LnxFloatSocket', 'F-stop', default_value=1.0)#0 - self.add_input('LnxFloatSocket', 'Shutter Time', default_value=2.8333)#1 - self.add_input('LnxFloatSocket', 'ISO', default_value=100.0)#2 - self.add_input('LnxFloatSocket', 'Exposure Compensation', default_value=0.0)#3 - self.add_input('LnxFloatSocket', 'Fisheye Distortion', default_value=0.01)#4 - self.add_input('LnxBoolSocket', 'Auto Focus', default_value=True)#5 - self.add_input('LnxFloatSocket', 'DoF Distance', default_value=10.0)#6 - self.add_input('LnxFloatSocket', 'DoF Length', default_value=160.0)#7 - self.add_input('LnxFloatSocket', 'DoF F-Stop', default_value=128.0)#8 - self.add_input('LnxBoolSocket', 'Tonemapping', default_value=False)#9 - self.add_input('LnxFloatSocket', 'Distort', default_value=2.0)#10 - self.add_input('LnxFloatSocket', 'Film Grain', default_value=2.0)#11 - self.add_input('LnxFloatSocket', 'Sharpen', default_value=0.25)#12 - self.add_input('LnxFloatSocket', 'Vignette', default_value=0.7)#13 + self.add_input('LnxFloatSocket', 'F-stop', default_value=1.0) self.add_output('LnxNodeSocketAction', 'Out') + def draw_buttons(self, context, layout): + layout.prop(self, 'property0') + def get_replacement_node(self, node_tree: bpy.types.NodeTree): if self.lnx_version not in range(0, 4): raise LookupError()