Browse Source

Merge pull request #300 from Deledrius/fade_fixes

Fix two Opacity Fade Modifier corner cases.
pull/301/head
Adam Johnson 3 years ago committed by GitHub
parent
commit
d2ead7a3f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      korman/properties/modifiers/render.py
  2. 3
      korman/ui/modifiers/render.py

4
korman/properties/modifiers/render.py

@ -264,6 +264,10 @@ class PlasmaFadeMod(PlasmaModifierProperties):
mod.nearOpaq = 0.0
mod.farOpaq = self.far_opaq
mod.farTrans = self.far_trans
@property
def requires_actor(self):
return self.fader_type == "FadeOpacity"
class PlasmaFollowMod(idprops.IDPropObjectMixin, PlasmaModifierProperties):

3
korman/ui/modifiers/render.py

@ -162,7 +162,8 @@ def fademod(modifier, layout, context):
col.prop(modifier, "far_opaq")
col.prop(modifier, "far_trans")
if not (modifier.near_trans <= modifier.near_opaq <= modifier.far_opaq <= modifier.far_trans):
if (modifier.fader_type in ("SimpleDist", "DistOpacity") and
not (modifier.near_trans <= modifier.near_opaq <= modifier.far_opaq <= modifier.far_trans)):
# Warn the user that the values are not recommended.
layout.label("Distance values must be equal or increasing!", icon="ERROR")

Loading…
Cancel
Save