Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two Opacity Fade Modifier corner cases. #300

Merged
merged 3 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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