MCPcopy Create free account
hub / github.com/blender/cycles / xml_read_float_array

Function xml_read_float_array

src/graph/node_xml.cpp:27–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26template<int VECTOR_SIZE, typename T>
27static void xml_read_float_array(T &value, xml_attribute attr)
28{
29 vector<string> tokens;
30 string_split(tokens, attr.value());
31
32 if (tokens.size() % VECTOR_SIZE != 0) {
33 return;
34 }
35
36 value.resize(tokens.size() / VECTOR_SIZE);
37 for (size_t i = 0; i < value.size(); i++) {
38 float *value_float = (float *)&value[i];
39
40 for (size_t j = 0; j < VECTOR_SIZE; j++) {
41 value_float[j] = (float)atof(tokens[i * VECTOR_SIZE + j].c_str());
42 }
43 }
44}
45
46void xml_read_node(XMLReader &reader, Node *node, const xml_node xml_node)
47{

Callers

nothing calls this directly

Calls 3

string_splitFunction · 0.85
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected