forked from LeenkxTeam/LNXSDK
t3du - Post Process Updates
This commit is contained in:
@ -4,27 +4,74 @@ class CameraSetNode(LnxLogicTreeNode):
|
|||||||
"""Set the post-processing effects of a camera."""
|
"""Set the post-processing effects of a camera."""
|
||||||
bl_idname = 'LNCameraSetNode'
|
bl_idname = 'LNCameraSetNode'
|
||||||
bl_label = 'Set Camera Post Process'
|
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):
|
def lnx_init(self, context):
|
||||||
self.add_input('LnxNodeSocketAction', 'In')
|
self.add_input('LnxNodeSocketAction', 'In')
|
||||||
self.add_input('LnxFloatSocket', 'F-stop', default_value=1.0)#0
|
self.add_input('LnxFloatSocket', 'F-stop', default_value=1.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_output('LnxNodeSocketAction', 'Out')
|
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):
|
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
|
||||||
if self.lnx_version not in range(0, 4):
|
if self.lnx_version not in range(0, 4):
|
||||||
raise LookupError()
|
raise LookupError()
|
||||||
|
Reference in New Issue
Block a user