From f06bff017e9c4da06940b79c140e9799c021af51 Mon Sep 17 00:00:00 2001 From: Julien Duroure Date: Fri, 30 Aug 2024 06:28:56 +0200 Subject: [PATCH] Merge pull request #2327 from KhronosGroup/fix_2326 Fix #2326 - RGB to Shader socket unlit management regression --- .../blender/exp/material/gltf2_blender_search_node_tree.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_search_node_tree.py b/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_search_node_tree.py index 91761c23a..f1cd9f516 100644 --- a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_search_node_tree.py +++ b/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_search_node_tree.py @@ -336,6 +336,13 @@ def get_constant(self, in_soc=None): color = color[:3] # drop unused alpha component (assumes shader tree) return color, "node_tree." + nav.out_socket.path_from_id() + ".default_value" + elif self.in_socket.type == 'SHADER': + # Historicaly, we manage RGB node plugged into a shader socket (output node) + if nav.node.type == 'RGB': + color = list(nav.out_socket.default_value) + color = color[:3] + return color, "node_tree." + nav.out_socket.path_from_id() + ".default_value" + elif self.in_socket.type == 'VALUE': if nav.node.type == 'VALUE': return nav.out_socket.default_value, "node_tree." + nav.out_socket.path_from_id() + ".default_value"