diff options
author | Martijn Berger <mberger@denc.com> | 2016-05-07 11:50:21 +0300 |
---|---|---|
committer | Martijn Berger <mberger@denc.com> | 2016-05-07 11:50:21 +0300 |
commit | 0a277f7428be13ce892422b8d690931f35e81bd3 (patch) | |
tree | 3f8d51080e1404b1dfa1f6515b709fbcbf7d8522 /intern/cycles/app | |
parent | 4422b3f9199cdd13c162ebc16c9e1d1b18f76bae (diff) |
Fix cycles-xml with OSL support after changes inroduced in 1422f0dd1697d7b671a7b447fd58db7dfe775821
Diffstat (limited to 'intern/cycles/app')
-rw-r--r-- | intern/cycles/app/cycles_xml.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp index c845f28ff90..262e8c063a9 100644 --- a/intern/cycles/app/cycles_xml.cpp +++ b/intern/cycles/app/cycles_xml.cpp @@ -437,7 +437,7 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug /* Generate inputs/outputs from node sockets * * Note: ShaderInput/ShaderOutput store shallow string copies only! - * Socket names must be stored in the extra lists instead. */ + * So we register them as ustring to ensure the pointer stays valid. */ /* read input values */ for(pugi::xml_node param = node.first_child(); param; param = param.next_sibling()) { if(string_iequals(param.name(), "input")) { @@ -449,8 +449,7 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug if(type == SHADER_SOCKET_UNDEFINED) continue; - osl->input_names.push_back(ustring(name)); - osl->add_input(osl->input_names.back().c_str(), type); + osl->add_input(ustring(name).c_str(), type); } else if(string_iequals(param.name(), "output")) { string name; @@ -461,8 +460,7 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug if(type == SHADER_SOCKET_UNDEFINED) continue; - osl->output_names.push_back(ustring(name)); - osl->add_output(osl->output_names.back().c_str(), type); + osl->add_output(ustring(name).c_str(), type); } } |