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

Fog Settings Only Display Relevant Parameters #270

Merged
Merged
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
10 changes: 9 additions & 1 deletion addons/io_hubs_addon/components/definitions/fog.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ class Fog(HubsComponent):
'version': (1, 0, 0)
}

def draw(self, context, layout, panel):
'''Draw method to be called by the panel. The base class method will print all the component properties'''
layout.prop(data=self, property="type")
if self.type == "linear":
layout.prop(data=self, property="near")
layout.prop(data=self, property="far")
else:
layout.prop(data=self, property="density")

type: EnumProperty(
name="type",
description="Fog Type",
Expand All @@ -29,7 +38,6 @@ class Fog(HubsComponent):
min=0,
max=1)

# TODO Make these properties to be displayed dynamically based on the fog type
near: FloatProperty(
name="Near", description="Fog Near Distance (linear only)", default=1.0)

Expand Down
Loading