glTF importer: Fix import ShaderNodeMix with VertexColor

This commit is contained in:
Julien Duroure 2022-12-12 13:17:37 +01:00
parent 71828a83e7
commit b17b70d1b4
Notes: blender-bot 2023-02-13 13:52:55 +01:00
Referenced by issue blender/blender#102967: 3.4: Potential candidates for corrective releases
Referenced by issue blender/blender#102967, 3.4: Potential candidates for corrective releases
2 changed files with 7 additions and 6 deletions

View File

@ -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',

View File

@ -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')