diff --git a/nodes/materials/glossytranslucent.py b/nodes/materials/glossytranslucent.py index 752b8fd8..abdd4321 100644 --- a/nodes/materials/glossytranslucent.py +++ b/nodes/materials/glossytranslucent.py @@ -22,13 +22,19 @@ 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): @@ -36,14 +42,15 @@ def update_use_backface(self, context): 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) diff --git a/nodes/textures/imagemap.py b/nodes/textures/imagemap.py index b2f31626..de7e2943 100644 --- a/nodes/textures/imagemap.py +++ b/nodes/textures/imagemap.py @@ -66,11 +66,13 @@ def update_image(self, context): description="Brightness multiplier") def update_is_normal_map(self, context): - color_output = self.outputs["Color"] - bump_output = self.outputs["Bump"] - alpha_output = self.outputs["Alpha"] + id = self.outputs.find("Color") + color_output = self.outputs[id] + id = self.outputs.find("Bump") + bump_output = self.outputs[id] + id = self.outputs.find("Alpha") + alpha_output = self.outputs[id] was_color_enabled = color_output.enabled - color_output.enabled = not self.is_normal_map alpha_output.enabled = not self.is_normal_map bump_output.enabled = self.is_normal_map