Vladimir_tyutenkov Posted December 23, 2019 Share Posted December 23, 2019 How to get the path of a property file to disk? the given code does not allow to get the path to the property file int prop_count=node->getNumProperties(); for (int j = 0; j < prop_count; j++) { if(auto prop = node->getProperty(j)) { std::string name_prop=prop->getName();//return property name std::string path_prop=prop->getPath(); //causes an error Unigine::UGUID file_guid=prop->getFileGUID(); //returns a empty guid Unigine::UGUID guid=prop->getGUID(); // not empty guid but I can’t get the path Unigine::String path= Unigine::FileSystem::get()->getAbsolutePath(guid);//return guid as string, but not path } } moreover, std::string path_prop=prop->getPath(); the use causes an error Link to comment
morbid Posted December 24, 2019 Share Posted December 24, 2019 Hello Vladimir, Each assigned to the node property is a child of a parent property and kept in the XML. To implement planned you need to find the parent first, like this: if (PropertyPtr parent = property->getParent()) { Log::message("property name %s\n", parent->getName()); Log::message("property file guid %s\n", parent->getFileGUID().getFileSystemString()); Log::message("property abs path %s\n", FileSystem::get()->getAbsolutePath(parent->getFileGUID()).get()); } 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
Vladimir_tyutenkov Posted December 24, 2019 Author Share Posted December 24, 2019 Thanks morbid , actual information Link to comment
Recommended Posts