Skip to content
Snippets Groups Projects
Commit c28c92c1 authored by Julien Duroure's avatar Julien Duroure
Browse files

glTF: Replace Separate RGB shader node by new Separate Color node

parent f07a4456
Branches
Tags
No related merge requests found
......@@ -4,8 +4,8 @@
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, 3, 1),
'blender': (3, 1, 0),
"version": (3, 3, 2),
'blender': (3, 3, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
'warning': '',
......
......@@ -193,11 +193,11 @@ def __get_image_data(sockets, export_settings) -> ExportImage:
# rudimentarily try follow the node tree to find the correct image data.
src_chan = Channel.R
for elem in result.path:
if isinstance(elem.from_node, bpy.types.ShaderNodeSeparateRGB):
if isinstance(elem.from_node, bpy.types.ShaderNodeSeparateColor):
src_chan = {
'R': Channel.R,
'G': Channel.G,
'B': Channel.B,
'Red': Channel.R,
'Green': Channel.G,
'Blue': Channel.B,
}[elem.from_socket.name]
if elem.from_socket.name == 'Alpha':
src_chan = Channel.A
......
......@@ -39,10 +39,10 @@ def clearcoat(mh, location, clearcoat_socket):
x -= 200
# Separate RGB
node = mh.node_tree.nodes.new('ShaderNodeSeparateRGB')
node = mh.node_tree.nodes.new('ShaderNodeSeparateColor')
node.location = x - 150, y - 75
# Outputs
mh.node_tree.links.new(clearcoat_socket, node.outputs['R'])
mh.node_tree.links.new(clearcoat_socket, node.outputs['Red'])
# Inputs
clearcoat_socket = node.inputs[0]
......@@ -92,10 +92,10 @@ def clearcoat_roughness(mh, location, roughness_socket):
x -= 200
# Separate RGB (roughness is in G)
node = mh.node_tree.nodes.new('ShaderNodeSeparateRGB')
node = mh.node_tree.nodes.new('ShaderNodeSeparateColor')
node.location = x - 150, y - 75
# Outputs
mh.node_tree.links.new(roughness_socket, node.outputs['G'])
mh.node_tree.links.new(roughness_socket, node.outputs['Green'])
# Inputs
color_socket = node.inputs[0]
......
......@@ -363,11 +363,11 @@ def metallic_roughness(mh: MaterialHelper, location, metallic_socket, roughness_
x -= 200
# Separate RGB
node = mh.node_tree.nodes.new('ShaderNodeSeparateRGB')
node = mh.node_tree.nodes.new('ShaderNodeSeparateColor')
node.location = x - 150, y - 75
# Outputs
mh.node_tree.links.new(metallic_socket, node.outputs['B'])
mh.node_tree.links.new(roughness_socket, node.outputs['G'])
mh.node_tree.links.new(metallic_socket, node.outputs['Blue'])
mh.node_tree.links.new(roughness_socket, node.outputs['Green'])
# Inputs
color_socket = node.inputs[0]
......@@ -447,10 +447,10 @@ def occlusion(mh: MaterialHelper, location, occlusion_socket):
x -= 200
# Separate RGB
node = mh.node_tree.nodes.new('ShaderNodeSeparateRGB')
node = mh.node_tree.nodes.new('ShaderNodeSeparateColor')
node.location = x - 150, y - 75
# Outputs
mh.node_tree.links.new(occlusion_socket, node.outputs['R'])
mh.node_tree.links.new(occlusion_socket, node.outputs['Red'])
# Inputs
color_socket = node.inputs[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment