From da9bf97fbf05b1912a0df3ed1c5025e82fd716c4 Mon Sep 17 00:00:00 2001 From: Spiderguy-F Date: Thu, 15 Feb 2024 14:17:02 +0100 Subject: [PATCH 1/2] Fog Settings Only Display Valid Parameters --- addons/io_hubs_addon/components/definitions/fog.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/io_hubs_addon/components/definitions/fog.py b/addons/io_hubs_addon/components/definitions/fog.py index 5135d56d..c0be2db1 100644 --- a/addons/io_hubs_addon/components/definitions/fog.py +++ b/addons/io_hubs_addon/components/definitions/fog.py @@ -13,6 +13,16 @@ class Fog(HubsComponent): 'icon': 'MOD_OCEAN', '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") + print("Type:", self.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", @@ -29,7 +39,7 @@ class Fog(HubsComponent): min=0, max=1) - # TODO Make these properties to be displayed dynamically based on the fog type + # TODO Make these properties to be displayed dynamically based on the fog type, BlenderDiplom: Done near: FloatProperty( name="Near", description="Fog Near Distance (linear only)", default=1.0) From 38955634b106c0e155600d557bce73aafecee0c3 Mon Sep 17 00:00:00 2001 From: Spiderguy-F Date: Thu, 14 Mar 2024 11:49:43 +0100 Subject: [PATCH 2/2] Fixed Style Issues --- addons/io_hubs_addon/components/definitions/fog.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/io_hubs_addon/components/definitions/fog.py b/addons/io_hubs_addon/components/definitions/fog.py index c0be2db1..95734043 100644 --- a/addons/io_hubs_addon/components/definitions/fog.py +++ b/addons/io_hubs_addon/components/definitions/fog.py @@ -13,11 +13,10 @@ class Fog(HubsComponent): 'icon': 'MOD_OCEAN', '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") - print("Type:", self.type) if self.type == "linear": layout.prop(data=self, property="near") layout.prop(data=self, property="far") @@ -39,7 +38,6 @@ def draw(self, context, layout, panel): min=0, max=1) - # TODO Make these properties to be displayed dynamically based on the fog type, BlenderDiplom: Done near: FloatProperty( name="Near", description="Fog Near Distance (linear only)", default=1.0)