From 4c37ad41fa27378e34c1003debda49fe905461d5 Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Tue, 20 Oct 2020 15:46:26 -0400 Subject: [PATCH 1/2] Fix Exponential Fog For some reason, SetDefExp2 type fog doesn't seem to work upon export, but regular SetDefExp does. This is just a proposed minor change to use the regular SetDefExp option if fixing the other is too big a task. --- korman/exporter/manager.py | 4 ++-- korman/properties/prop_world.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/korman/exporter/manager.py b/korman/exporter/manager.py index f62672c..034620a 100644 --- a/korman/exporter/manager.py +++ b/korman/exporter/manager.py @@ -321,8 +321,8 @@ class ExportManager: stream.writeLine("Graphics.Renderer.Fog.SetDefColor {} {} {}".format(*fni.fog_color)) if fni.fog_method == "linear": stream.writeLine("Graphics.Renderer.Fog.SetDefLinear {} {} {}".format(fni.fog_start, fni.fog_end, fni.fog_density)) - elif fni.fog_method == "exp2": - stream.writeLine("Graphics.Renderer.Fog.SetDefExp2 {} {}".format(fni.fog_end, fni.fog_density)) + elif fni.fog_method == "exp": + stream.writeLine("Graphics.Renderer.Fog.SetDefExp {} {}".format(fni.fog_end, fni.fog_density)) def _write_pages(self): age_name = self._age_info.name diff --git a/korman/properties/prop_world.py b/korman/properties/prop_world.py index 1e159a5..453f2d9 100644 --- a/korman/properties/prop_world.py +++ b/korman/properties/prop_world.py @@ -31,7 +31,7 @@ class PlasmaFni(bpy.types.PropertyGroup): fog_method = EnumProperty(name="Fog Type", items=[ ("linear", "Linear", "Linear Fog"), - ("exp2", "Exponential", "Exponential Fog"), + ("exp", "Exponential", "Exponential Fog"), ("none", "None", "Use fog from the previous age") ]) fog_start = FloatProperty(name="Start", From cf217d352881c96be040d61643ea37225b94c0c7 Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Mon, 26 Oct 2020 23:52:07 -0400 Subject: [PATCH 2/2] Add Linear Fog Value Warning Warns the user if the linear fog start value is greater than the end value, which can cause visual fog problems. --- korman/ui/ui_world.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/korman/ui/ui_world.py b/korman/ui/ui_world.py index 5443248..c4bcb8c 100644 --- a/korman/ui/ui_world.py +++ b/korman/ui/ui_world.py @@ -262,6 +262,10 @@ class PlasmaEnvironmentPanel(AgeButtonsPanel, bpy.types.Panel): layout = self.layout fni = context.world.plasma_fni + # warn about reversed linear fog values + if fni.fog_method == "linear" and fni.fog_start >= fni.fog_end and (fni.fog_start + fni.fog_end) != 0: + layout.label(text="Fog Start Value should be less than the End Value", icon="ERROR") + # basic colors split = layout.split() col = split.column()