[Bf-extensions-cvs] [a368094a] blender-v3.4-release: glTF importer: Fix import ShaderNodeMix with VertexColor

Julien Duroure noreply at git.blender.org
Wed Dec 14 22:08:47 CET 2022


Commit: a368094a4cf6ab7fcd011280a24a254fad56a91d
Author: Julien Duroure
Date:   Mon Dec 12 13:17:37 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rBAa368094a4cf6ab7fcd011280a24a254fad56a91d

glTF importer: Fix import ShaderNodeMix with VertexColor

===================================================================

M	io_scene_gltf2/__init__.py
M	io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py

===================================================================

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 32bda219..c37c6d8f 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -4,7 +4,7 @@
 bl_info = {
     'name': 'glTF 2.0 format',
     'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
-    "version": (3, 5, 7),
+    "version": (3, 5, 8),
     'blender': (3, 4, 0),
     'location': 'File > Import-Export',
     'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py b/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py
index 519fe221..679dd8b0 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py
@@ -388,7 +388,7 @@ def base_color(
             node.location = x - 140, y
             node.blend_type = 'MULTIPLY'
             # Outputs
-            mh.node_tree.links.new(color_socket, node.outputs[0])
+            mh.node_tree.links.new(color_socket, node.outputs[2])
             # Inputs
             node.inputs['Factor'].default_value = 1.0
             color_socket = node.inputs[6]
@@ -417,14 +417,15 @@ def base_color(
     if base_color_texture is not None and mh.vertex_color:
         node = mh.node_tree.nodes.new('ShaderNodeMix')
         node.label = 'Mix Vertex Color'
+        node.data_type = 'RGBA'
         node.location = x - 140, y
         node.blend_type = 'MULTIPLY'
         # Outputs
-        mh.node_tree.links.new(color_socket, node.outputs[0])
+        mh.node_tree.links.new(color_socket, node.outputs[2])
         # Inputs
-        node.inputs['Fac'].default_value = 1.0
-        texture_color_socket = node.inputs['Color1']
-        vcolor_color_socket = node.inputs['Color2']
+        node.inputs['Factor'].default_value = 1.0
+        texture_color_socket = node.inputs[6]
+        vcolor_color_socket = node.inputs[7]
 
         if alpha_socket is not None:
             node = mh.node_tree.nodes.new('ShaderNodeMath')



More information about the Bf-extensions-cvs mailing list