Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2019-11-09 12:56:01 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-11-09 12:56:01 +0300
commit74a8fb2aa8f983a573cd35be1c883c8701c88093 (patch)
tree24620b43e7093a202af59080c52cb72ba74e531d /io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py
parenteb4085f1dc1522debb6bd490c3002fd0e22e6149 (diff)
glTF importer: use vertexcolor node instead of attributenode
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py')
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py b/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py
index 95427ccd..387db56f 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py
@@ -60,22 +60,22 @@ class BlenderKHR_materials_pbrSpecularGlossiness():
diffuse.inputs[0].default_value = pbrSG['diffuseFactor']
else:
- # Create attribute node to get COLOR_0 data
- attribute_node = node_tree.nodes.new('ShaderNodeAttribute')
- attribute_node.attribute_name = 'COLOR_0'
- attribute_node.location = -500, 0
+ # Create vertexcolor node to get COLOR_0 data
+ vertexcolor_node = node_tree.nodes.new('ShaderNodeVertexColor')
+ vertexcolor_node.layer_name = 'COLOR_0'
+ vertexcolor_node.location = -500, 0
# links
- node_tree.links.new(diffuse.inputs[0], attribute_node.outputs[0])
+ node_tree.links.new(diffuse.inputs[0], vertexcolor_node.outputs[0])
elif pbrSG['diffuse_type'] == gltf.TEXTURE_FACTOR:
# TODO alpha ?
if vertex_color:
# TODO tree locations
- # Create attribute / separate / math nodes
- attribute_node = node_tree.nodes.new('ShaderNodeAttribute')
- attribute_node.attribute_name = 'COLOR_0'
+ # Create vertexcolor / separate / math nodes
+ vertexcolor_node = node_tree.nodes.new('ShaderNodeVertexColor')
+ vertexcolor_node.layer_name = 'COLOR_0'
separate_vertex_color = node_tree.nodes.new('ShaderNodeSeparateRGB')
math_vc_R = node_tree.nodes.new('ShaderNodeMath')
@@ -141,7 +141,7 @@ class BlenderKHR_materials_pbrSpecularGlossiness():
# Create links
if vertex_color:
- node_tree.links.new(separate_vertex_color.inputs[0], attribute_node.outputs[0])
+ node_tree.links.new(separate_vertex_color.inputs[0], vertexcolor_node.outputs[0])
node_tree.links.new(math_vc_R.inputs[1], separate_vertex_color.outputs[0])
node_tree.links.new(math_vc_G.inputs[1], separate_vertex_color.outputs[1])
node_tree.links.new(math_vc_B.inputs[1], separate_vertex_color.outputs[2])
@@ -174,10 +174,10 @@ class BlenderKHR_materials_pbrSpecularGlossiness():
# TODO alpha ?
if vertex_color:
- # Create attribute / separate / math nodes
- attribute_node = node_tree.nodes.new('ShaderNodeAttribute')
- attribute_node.attribute_name = 'COLOR_0'
- attribute_node.location = -2000, 250
+ # Create vertexcolor / separate / math nodes
+ vertexcolor_node = node_tree.nodes.new('ShaderNodeVertexColor')
+ vertexcolor_node.layer_name = 'COLOR_0'
+ vertexcolor_node.location = -2000, 250
separate_vertex_color = node_tree.nodes.new('ShaderNodeSeparateRGB')
separate_vertex_color.location = -1500, 250
@@ -239,7 +239,7 @@ class BlenderKHR_materials_pbrSpecularGlossiness():
# Create links
if vertex_color:
- node_tree.links.new(separate_vertex_color.inputs[0], attribute_node.outputs[0])
+ node_tree.links.new(separate_vertex_color.inputs[0], vertexcolor_node.outputs[0])
node_tree.links.new(math_vc_R.inputs[1], separate_vertex_color.outputs[0])
node_tree.links.new(math_vc_G.inputs[1], separate_vertex_color.outputs[1])