Skip to content

Commit

Permalink
Merge pull request #300 from Deledrius/fade_fixes
Browse files Browse the repository at this point in the history
Fix two Opacity Fade Modifier corner cases.
  • Loading branch information
Hoikas authored Oct 15, 2021
2 parents 9613b79 + c0a6d0e commit d2ead7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions korman/properties/modifiers/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ def export(self, exporter, bo, so):
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):
Expand Down
3 changes: 2 additions & 1 deletion korman/ui/modifiers/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit d2ead7a

Please sign in to comment.