javier.serrano Posted March 26, 2019 Share Posted March 26, 2019 Hi, I have been writting a simple script to check if all .node files, of a given folder, have a certain material (or an inherit one) attached to each one of the surfaces (only for ObjectMesh* nodes). At the end, the script writes a report with all surfaces that don't have a material of the given family attached. The problem comes when I retrieve the GUID as an string from xml file and I call engine.materials.findMaterialByGUID code is something like this: Xml node_xml; //Xml::load() from .node file string guid_str = node_xml.getArg("material"); //retrieves an string like 'ab4535ec80b5de8e2fd2c3559f3cc474b2587b4d' UGUID guid = new UGUID(); guid.setString(guid_str); guid.isValid(); //returns true always Material material = engine.materials.findMaterialByGUID(guid); //throws an error which says 'Variable::getGUIDSafe(): can't convert extern class to guid' Script is run by a console command in Editor. SDK version is 2.7.2.1 Which is the good way to use 'findMaterialByGUID' ? Is there any other way to retrieve the material? Regards, Javier Link to comment
morbid Posted March 27, 2019 Share Posted March 27, 2019 Hello Javier, Our dev team is currently overloaded with other tasks, we'll come back to your question ASAP. Sorry. 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
morbid Posted March 27, 2019 Share Posted March 27, 2019 Javier, sorry again for the delay with the answer. We've checked this case, this behavior is a bug in the UnigineScript. May I ask you how urgent is this? 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
javier.serrano Posted March 27, 2019 Author Share Posted March 27, 2019 Hi, this is not urgent as is only for a material validation script (we are managing thousands of Objects). I can workaround by instancing nodes and retrieving their material by Object::getMaterial(). Thanks for your quick response, Javier Link to comment
morbid Posted March 28, 2019 Share Posted March 28, 2019 Okay. More likely we'll fix it in SDK 2.8. Do you have plans for an update or your project is based on a frozen version (2.7.2)? 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
javier.serrano Posted March 28, 2019 Author Share Posted March 28, 2019 In this particular project we won't update it because is on its final stages. We create new projects in last SDK version available so it is great to have the fix in 2.8 version. I can workaround in 2.7.2 and use the fix in future projects. Thanks Link to comment
morbid Posted March 28, 2019 Share Posted March 28, 2019 Got it. Thanks for the feedback! 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
morbid Posted April 19, 2019 Share Posted April 19, 2019 Hello Javier, We've fixed this, will be available in the 2.8 (April). 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
Recommended Posts