Skip to content

Commit

Permalink
Merge pull request #270 from BlenderDiplom/FogDisplayValidOptionsOnly
Browse files Browse the repository at this point in the history
Fog Settings Only Display Relevant Parameters
  • Loading branch information
keianhzo authored Mar 18, 2024
2 parents 85e0d0b + 3895563 commit 7017c5e
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 7017c5e

Please sign in to comment.