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