ataylor Posted May 31, 2016 Share Posted May 31, 2016 Xml::setStringArrayData writes out each String element of the provided array in the form of comma-separated values. If a String has spaces, those spaces are preserved. However, when Xml::getStringArrayData reads this data back in, the space characters seem to be treated as delimiters and what was originally a single element is broken into multiple. This seems like a bug. Should I be doing something differently? Link to comment
silent Posted June 1, 2016 Share Posted June 1, 2016 Hi Adam, It looks like a bug to me also. Will create ticket in our internal bug tracker. Thanks for noticing that! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
silent Posted June 1, 2016 Share Posted June 1, 2016 Hi Adam, As a fix, you can try to patch source/engine/common/XmlParser.cpp (two methods Xml::getStringArrayArg should look like this): int Xml::getStringArrayArg(const char *name,Vector<String> &dest) const { dest.clear(); const char *s = getArg(name); const char *to; while((to = strchr(s,',')) != NULL) { dest.append(String::substr(s,0,(int)(to - s))); s = to + 1; } dest.append(s); return 1; } int Xml::getStringArrayData(Vector<String> &dest) const { dest.clear(); const char *s = getData(); const char *to; while((to = strchr(s,',')) != NULL) { dest.append(String::substr(s,0,(int)(to - s))); s = to + 1; } dest.append(s); return 1; } If this fix will be useful in your use-case we will include it in the upcoming Unigine SDK 2.3 update. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Greg.Mildenhall Posted December 21, 2017 Share Posted December 21, 2017 The 2.3.1 version of ColladaImport.cpp appears to depend on the former behaviour. The spaces in the <p/> tags in our <polygons/> data aren't separating the numbers anymore. Please advise. Link to comment
silent Posted December 21, 2017 Share Posted December 21, 2017 Hi Greg, Thanks for the report. The fastest solution I guess will be to patch getStringArrayData() so it could work with space delimiters optionally (default is ",") and than do the fixes in ColladaImport.cpp as well. We can try to do this right now (or you can do it on your side since you also have an access to the engine sources). How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Greg.Mildenhall Posted December 21, 2017 Share Posted December 21, 2017 Yeah I've already done that locally so I could move on with what I'm doing. Link to comment
Recommended Posts