diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/io/collada/Materials.cpp | 12 | ||||
-rw-r--r-- | source/blender/io/collada/Materials.h | 1 | ||||
m--------- | source/tools | 0 |
3 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/io/collada/Materials.cpp b/source/blender/io/collada/Materials.cpp index 194a9ea397e..35f1b82a71f 100644 --- a/source/blender/io/collada/Materials.cpp +++ b/source/blender/io/collada/Materials.cpp @@ -133,6 +133,16 @@ void MaterialNode::add_link(bNode *from_node, int from_index, bNode *to_node, in nodeAddLink(ntree, from_node, from_socket, to_node, to_socket); } +void MaterialNode::add_link(bNode *from_node, const char* from_label, bNode *to_node, const char* to_label) +{ + bNodeSocket *from_socket = nodeFindSocket(from_node, SOCK_OUT, from_label); + bNodeSocket *to_socket = nodeFindSocket(to_node, SOCK_IN, to_label); + + if (from_socket && to_socket) { + nodeAddLink(ntree, from_node, from_socket, to_node, to_socket); + } +} + void MaterialNode::set_reflectivity(COLLADAFW::FloatOrParam &val) { float reflectivity = val.getFloatValue(); @@ -326,7 +336,7 @@ void MaterialNode::set_emission(COLLADAFW::ColorOrTexture &cot) else if (cot.isTexture()) { bNode *texture_node = add_texture_node(cot, -300, locy, "Emission"); if (texture_node != nullptr) { - add_link(texture_node, 0, shader_node, 0); + add_link(texture_node, "Color", shader_node, "Emission"); } } diff --git a/source/blender/io/collada/Materials.h b/source/blender/io/collada/Materials.h index 2d8c823a4c2..431c309467a 100644 --- a/source/blender/io/collada/Materials.h +++ b/source/blender/io/collada/Materials.h @@ -48,6 +48,7 @@ class MaterialNode { bNodeTree *prepare_material_nodetree(); bNode *add_node(int node_type, int locx, int locy, std::string label); void add_link(bNode *from_node, int from_index, bNode *to_node, int to_index); + void add_link(bNode *from_node, const char* from_label, bNode *to_node, const char* to_label); bNode *add_texture_node(COLLADAFW::ColorOrTexture &cot, int locx, int locy, std::string label); void setShaderType(); diff --git a/source/tools b/source/tools -Subproject 2afbb8ec472cac5102eb239f57b006f8c938768 +Subproject f99d29ae3e6ad44d45d79309454c45f8088781a |