This commit is contained in:
Gorochu
2026-06-24 00:05:37 -07:00
parent 6db83e559b
commit 38151eb233
30 changed files with 1129 additions and 373 deletions

View File

@ -1,12 +0,0 @@
from lnx.logicnode.lnx_nodes import *
class GetHosekWilkiePropertiesNode(LnxLogicTreeNode):
"""Gets the HosekWilkie properties."""
bl_idname = 'LNGetHosekWilkiePropertiesNode'
bl_label = 'Get HosekWilkie Properties'
lnx_version = 1
def lnx_init(self, context):
self.add_output('LnxFloatSocket', 'Turbidity')
self.add_output('LnxFloatSocket', 'Ground Albedo')
self.add_output('LnxVectorSocket', 'Sun Direction')

View File

@ -1,14 +0,0 @@
from lnx.logicnode.lnx_nodes import *
class GetNishitaPropertiesNode(LnxLogicTreeNode):
"""Gets the Nishita properties."""
bl_idname = 'LNGetNishitaPropertiesNode'
bl_label = 'Get Nishita Properties'
lnx_version = 1
def lnx_init(self, context):
self.add_output('LnxFloatSocket', 'Air')
self.add_output('LnxFloatSocket', 'Dust')
self.add_output('LnxFloatSocket', 'Ozone')
self.add_output('LnxVectorSocket', 'Sun Direction')

View File

@ -0,0 +1,11 @@
from lnx.logicnode.lnx_nodes import *
class GetWorldColorNode(LnxLogicTreeNode):
"""Gets the background color of the active world."""
bl_idname = 'LNGetWorldColorNode'
bl_label = 'Get World Color'
lnx_version = 1
def lnx_init(self, context):
self.add_output('LnxColorSocket', 'Color')

View File

@ -0,0 +1,51 @@
from lnx.logicnode.lnx_nodes import *
class GetWorldSkyNode(LnxLogicTreeNode):
"""Gets the sky properties for the selected sky model."""
bl_idname = 'LNGetWorldSkyNode'
bl_label = 'Get World Sky'
lnx_version = 1
legacy = 'Nishita ' if bpy.app.version < (5, 0, 0) else ''
def update_inputs(self, context):
while len(self.outputs) > 0:
self.outputs.remove(self.outputs[0])
if self.property0 == 'hosek':
self.add_output('LnxFloatSocket', 'Turbidity')
self.add_output('LnxFloatSocket', 'Ground Albedo')
self.add_output('LnxVectorSocket', 'Sun Direction')
elif self.property0 == 'single':
self.add_output('LnxFloatSocket', 'Air')
self.add_output('LnxFloatSocket', 'Dust')
self.add_output('LnxFloatSocket', 'Ozone')
self.add_output('LnxFloatSocket', 'Altitude')
self.add_output('LnxVectorSocket', 'Sun Direction')
elif self.property0 == 'multi':
self.add_output('LnxFloatSocket', 'Air')
self.add_output('LnxFloatSocket', 'Dust')
self.add_output('LnxFloatSocket', 'Ozone')
self.add_output('LnxFloatSocket', 'Sun Elevation')
self.add_output('LnxFloatSocket', 'Sun Rotation')
self.add_output('LnxFloatSocket', 'Sun Size')
self.add_output('LnxFloatSocket', 'Sun Intensity')
self.add_output('LnxFloatSocket', 'Altitude')
self.add_output('LnxIntSocket', 'Sun Disc')
self.add_output('LnxVectorSocket', 'Sun Direction')
property0: HaxeEnumProperty(
'property0',
items=[('hosek', 'Hosek Wilkie', 'Hosek-Wilkie / Preetham sky model'),
('single', f'{legacy}Single Scattering', 'Single scattering sky model'),
('multi', f'{legacy}Multiple Scattering', 'Multiple scattering sky model')],
name='', default='single', update=update_inputs)
def lnx_init(self, context):
self.add_output('LnxFloatSocket', 'Air')
self.add_output('LnxFloatSocket', 'Dust')
self.add_output('LnxFloatSocket', 'Ozone')
self.add_output('LnxFloatSocket', 'Altitude')
self.add_output('LnxVectorSocket', 'Sun Direction')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')

View File

@ -0,0 +1,12 @@
from lnx.logicnode.lnx_nodes import *
class GetWorldTextureNode(LnxLogicTreeNode):
"""Gets the texture properties of the active world (strength, envmap)."""
bl_idname = 'LNGetWorldTextureNode'
bl_label = 'Get World Texture'
lnx_version = 1
def lnx_init(self, context):
self.add_output('LnxFloatSocket', 'Strength')
self.add_output('LnxStringSocket', 'Envmap')

View File

@ -1,38 +0,0 @@
from lnx.logicnode.lnx_nodes import *
class SetHosekWilkiePropertiesNode(LnxLogicTreeNode):
"""Sets the HosekWilkie properties."""
bl_idname = 'LNSetHosekWilkiePropertiesNode'
bl_label = 'Set HosekWilkie Properties'
lnx_version = 1
def remove_extra_inputs(self, context):
while len(self.inputs) > 1:
self.inputs.remove(self.inputs[-1])
if self.property0 == 'Turbidity/Ground Albedo':
self.add_input('LnxFloatSocket', 'Turbidity')
self.add_input('LnxFloatSocket', 'Ground Albedo')
if self.property0 == 'Turbidity':
self.add_input('LnxFloatSocket', 'Turbidity')
if self.property0 == 'Ground Albedo':
self.add_input('LnxFloatSocket', 'Ground Albedo')
if self.property0 == 'Sun Direction':
self.add_input('LnxVectorSocket', 'Sun Direction')
property0: HaxeEnumProperty(
'property0',
items = [('Turbidity/Ground Albedo', 'Turbidity/Ground Albedo', 'Turbidity, Ground Albedo'),
('Turbidity', 'Turbidity', 'Turbidity'),
('Ground Albedo', 'Ground Albedo', 'Ground Albedo'),
('Sun Direction', 'Sun Direction', 'Sun Direction')],
name='', default='Turbidity/Ground Albedo', update=remove_extra_inputs)
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxFloatSocket', 'Turbidity')
self.add_input('LnxFloatSocket', 'Ground_Albedo')
self.add_output('LnxNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')

View File

@ -1,43 +0,0 @@
from lnx.logicnode.lnx_nodes import *
class SetNishitaPropertiesNode(LnxLogicTreeNode):
"""Sets the Nishita properties"""
bl_idname = 'LNSetNishitaPropertiesNode'
bl_label = 'Set Nishita Properties'
lnx_version = 1
def remove_extra_inputs(self, context):
while len(self.inputs) > 1:
self.inputs.remove(self.inputs[-1])
if self.property0 == 'Density':
self.add_input('LnxFloatSocket', 'Air')
self.add_input('LnxFloatSocket', 'Dust')
self.add_input('LnxFloatSocket', 'Ozone')
if self.property0 == 'Air':
self.add_input('LnxFloatSocket', 'Air')
if self.property0 == 'Dust':
self.add_input('LnxFloatSocket', 'Dust')
if self.property0 == 'Ozone':
self.add_input('LnxFloatSocket', 'Ozone')
if self.property0 == 'Sun Direction':
self.add_input('LnxVectorSocket', 'Sun Direction')
property0: HaxeEnumProperty(
'property0',
items = [('Density', 'Density', 'Air, Dust, Ozone'),
('Air', 'Air', 'Air'),
('Dust', 'Dust', 'Dust'),
('Ozone', 'Ozone', 'Ozone'),
('Sun Direction', 'Sun Direction', 'Sun Direction')],
name='', default='Density', update=remove_extra_inputs)
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxFloatSocket', 'Air')
self.add_input('LnxFloatSocket', 'Dust')
self.add_input('LnxFloatSocket', 'Ozone')
self.add_output('LnxNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')

View File

@ -0,0 +1,14 @@
from lnx.logicnode.lnx_nodes import *
class SetWorldColorNode(LnxLogicTreeNode):
"""Sets the background color of the active world."""
bl_idname = 'LNSetWorldColorNode'
bl_label = 'Set World Color'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxColorSocket', 'Color', default_value=[0.0, 0.0, 0.0, 1.0])
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,54 @@
from lnx.logicnode.lnx_nodes import *
class SetWorldSkyNode(LnxLogicTreeNode):
"""Sets the sky properties for the selected sky model."""
bl_idname = 'LNSetWorldSkyNode'
bl_label = 'Set World Sky'
lnx_version = 1
legacy = 'Nishita ' if bpy.app.version < (5, 0, 0) else ''
def update_inputs(self, context):
while len(self.inputs) > 1:
self.inputs.remove(self.inputs[-1])
if self.property0 == 'hosek':
self.add_input('LnxFloatSocket', 'Turbidity', default_value=1.0)
self.add_input('LnxFloatSocket', 'Ground Albedo', default_value=0.0)
self.add_input('LnxVectorSocket', 'Sun Direction', default_value=[0.0, 0.0, 1.0])
elif self.property0 == 'single':
self.add_input('LnxFloatSocket', 'Air', default_value=1.0)
self.add_input('LnxFloatSocket', 'Dust', default_value=1.0)
self.add_input('LnxFloatSocket', 'Ozone', default_value=1.0)
self.add_input('LnxFloatSocket', 'Altitude', default_value=1.0)
self.add_input('LnxVectorSocket', 'Sun Direction', default_value=[0.0, 0.0, 1.0])
elif self.property0 == 'multi':
self.add_input('LnxFloatSocket', 'Air', default_value=1.0)
self.add_input('LnxFloatSocket', 'Dust', default_value=1.0)
self.add_input('LnxFloatSocket', 'Ozone', default_value=1.0)
self.add_input('LnxFloatSocket', 'Sun Elevation', default_value=0.0)
self.add_input('LnxFloatSocket', 'Sun Rotation', default_value=0.0)
self.add_input('LnxFloatSocket', 'Sun Size', default_value=0.545)
self.add_input('LnxFloatSocket', 'Sun Intensity', default_value=1.0)
self.add_input('LnxFloatSocket', 'Altitude', default_value=1.0)
self.add_input('LnxBoolSocket', 'Sun Disc', default_value=True)
self.add_input('LnxVectorSocket', 'Sun Direction', default_value=[0.0, 0.0, 1.0])
property0: HaxeEnumProperty(
'property0',
items=[('hosek', 'Hosek Wilkie', 'Hosek-Wilkie / Preetham sky model'),
('single', f'{legacy}Single Scattering', 'Single scattering sky model'),
('multi', f'{legacy}Multiple Scattering', 'Multiple scattering sky model')],
name='', default='single', update=update_inputs)
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxFloatSocket', 'Air', default_value=1.0)
self.add_input('LnxFloatSocket', 'Dust', default_value=1.0)
self.add_input('LnxFloatSocket', 'Ozone', default_value=1.0)
self.add_input('LnxFloatSocket', 'Altitude', default_value=1.0)
self.add_input('LnxVectorSocket', 'Sun Direction', default_value=[0.0, 0.0, 1.0])
self.add_output('LnxNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')

View File

@ -0,0 +1,15 @@
from lnx.logicnode.lnx_nodes import *
class SetWorldTextureNode(LnxLogicTreeNode):
"""Sets the texture properties of the active world (strength, envmap)."""
bl_idname = 'LNSetWorldTextureNode'
bl_label = 'Set World Texture'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxFloatSocket', 'Strength', default_value=1.0)
self.add_input('LnxStringSocket', 'Envmap')
self.add_output('LnxNodeSocketAction', 'Out')