Skip to content

Commit

Permalink
- Fix: Glossy Translucent material issues
Browse files Browse the repository at this point in the history
  • Loading branch information
odil24 authored Jan 4, 2025
1 parent f61c26c commit 52492ef
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions nodes/materials/glossytranslucent.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,35 @@ class LuxCoreNodeMatGlossyTranslucent(LuxCoreNodeMaterial, bpy.types.Node):
bl_width_default = 160

def update_use_ior(self, context):
self.inputs["IOR"].enabled = self.use_ior
self.inputs["Specular Color"].enabled = not self.use_ior
id = self.inputs.find("IOR")
self.inputs[id].enabled = self.use_ior

id = self.inputs.find("Specular Color")
self.inputs[id].enabled = not self.use_ior
utils_node.force_viewport_update(self, context)

def update_use_ior_bf(self, context):
self.inputs["BF IOR"].enabled = self.use_ior_bf
self.inputs["BF Specular Color"].enabled = not self.use_ior_bf
id = self.inputs.find("BF IOR")
self.inputs[id].enabled = self.use_ior_bf

id = self.inputs.find("BF Specular Color")
self.inputs[id].enabled = not self.use_ior_bf
utils_node.force_viewport_update(self, context)

def update_use_backface(self, context):
# Note: these are the names (strings), not references to the sockets
sockets = [socket for socket in self.inputs.keys() if socket.startswith("BF ")]

for socket in sockets:
id = self.inputs.find(socket)
if socket == "BF V-Roughness":
self.inputs[socket].enabled = self.use_backface and self.use_anisotropy
self.inputs[id].enabled = self.use_backface and self.use_anisotropy
elif socket == "BF IOR":
self.inputs[socket].enabled = self.use_backface and self.use_ior_bf
self.inputs[id].enabled = self.use_backface and self.use_ior_bf
elif socket == "BF Specular Color":
self.inputs[socket].enabled = self.use_backface and not self.use_ior_bf
self.inputs[id].enabled = self.use_backface and not self.use_ior_bf
else:
self.inputs[socket].enabled = self.use_backface
self.inputs[id].enabled = self.use_backface

if context:
utils_node.force_viewport_update(self, context)
Expand Down

0 comments on commit 52492ef

Please sign in to comment.