Fix T49985: cycles standalone using wrong socket names for XML reading.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sat, 12 Nov 2016 14:26:24 +0000 (15:26 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Sat, 12 Nov 2016 16:33:07 +0000 (17:33 +0100)
intern/cycles/app/cycles_xml.cpp

index 8a3eb98a5a05b9e4934562939e277aca9fec8184..b3be07fce4880831ca6d167b6250eb9cc7f44603 100644 (file)
@@ -210,17 +210,6 @@ static void xml_read_camera(XMLReadState& state, pugi::xml_node node)
 
 /* Shader */
 
-static string xml_socket_name(const char *name)
-{
-       string sname = name;
-       size_t i;
-
-       while((i = sname.find(" ")) != string::npos)
-               sname.replace(i, 1, "");
-       
-       return sname;
-}
-
 static void xml_read_shader_graph(XMLReadState& state, Shader *shader, pugi::xml_node graph_node)
 {
        xml_read_node(state, shader, graph_node);
@@ -255,7 +244,7 @@ static void xml_read_shader_graph(XMLReadState& state, Shader *shader, pugi::xml
                                        ShaderNode *fromnode = (ShaderNode*)graph_reader.node_map[from_node_name];
 
                                        foreach(ShaderOutput *out, fromnode->outputs)
-                                               if(string_iequals(xml_socket_name(out->name().c_str()), from_socket_name.c_str()))
+                                               if(string_iequals(out->socket_type.name.string(), from_socket_name.string()))
                                                        output = out;
 
                                        if(!output)
@@ -268,7 +257,7 @@ static void xml_read_shader_graph(XMLReadState& state, Shader *shader, pugi::xml
                                        ShaderNode *tonode = (ShaderNode*)graph_reader.node_map[to_node_name];
 
                                        foreach(ShaderInput *in, tonode->inputs)
-                                               if(string_iequals(xml_socket_name(in->name().c_str()), to_socket_name.c_str()))
+                                               if(string_iequals(in->socket_type.name.string(), to_socket_name.string()))
                                                        input = in;
 
                                        if(!input)